diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml index d0dba16dd0bb..2e0e44ef0586 100644 --- a/eng/.docsettings.yml +++ b/eng/.docsettings.yml @@ -105,6 +105,7 @@ known_content_issues: - ['sdk/monitor/azure-monitor-opentelemetry-exporter/swagger/README.md', '#4554'] - ['sdk/monitor/azure-monitor-opentelemetry-exporter/README.md', '#4554'] - ['sdk/digitaltwins/azure-digitaltwins-core/swagger/README.md', '#4554'] + - ['sdk/textanalytics/azure-ai-textanalytics/swagger/README.md', '#4554'] - ['sdk/media/azure-media-nspkg/README.md', '#4554'] # nspckg and common. diff --git a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md index 8023b7eff46a..75a958665252 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md +++ b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md @@ -4,6 +4,7 @@ **Breaking Changes** +- Removed property `related_entities` on `HealthcareEntity` and added `entity_relations` onto the document response level for healthcare - Renamed properties `aspect` and `opinions` to `target` and `assessments` respectively in class `MinedOpinion`. - Renamed classes `AspectSentiment` and `OpinionSentiment` to `TargetSentiment` and `AssessmentSentiment` respectively. @@ -87,7 +88,7 @@ used in conjunction with the Bing Entity Search API to fetch additional relevant - Removed `grapheme_offset` and `grapheme_length` from `CategorizedEntity`, `SentenceSentiment`, and `LinkedEntityMatch` - `TextDocumentStatistics` attribute `grapheme_count` has been renamed to `character_count` -## 1.0.0b5 +## 1.0.0b5 - This was a broken release diff --git a/sdk/textanalytics/azure-ai-textanalytics/README.md b/sdk/textanalytics/azure-ai-textanalytics/README.md index dc39ce76e2be..344086538019 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/README.md +++ b/sdk/textanalytics/azure-ai-textanalytics/README.md @@ -476,15 +476,14 @@ for idx, doc in enumerate(docs): for data_source in entity.data_sources: print("......Entity ID: {}".format(data_source.entity_id)) print("......Name: {}".format(data_source.name)) - if len(entity.related_entities) > 0: - print("...Related Entities:") - for related_entity, relation_type in entity.related_entities.items(): - print("......Entity Text: {}".format(related_entity.text)) - print("......Relation Type: {}".format(relation_type)) + for relation in doc.entity_relations: + print("Relation of type: {} has the following roles".format(relation.relation_type)) + for role in relation.roles: + print("...Role '{}' with entity '{}'".format(role.name, role.entity.text)) print("------------------------------------------") ``` -Note: The Healthcare Entities Analysis service is currently available only in API version v3.1-preview.3 in gated preview. Since this is a gated preview, AAD is not supported. More information [here](https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?tabs=ner#request-access-to-the-public-preview). +Note: The Healthcare Entities Analysis service is currently available only in the API v3.1 preview versions and is in gated preview. Since this is a gated preview, AAD is not supported. More information [here](https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?tabs=ner#request-access-to-the-public-preview). ### Batch Analysis @@ -559,7 +558,7 @@ for idx, doc in enumerate(docs): The returned response is an object encapsulating multiple iterables, each representing results of individual analyses. -Note: Batch analysis is currently available only in API version v3.1-preview.3. +Note: Batch analysis is currently available only in the v3.1-preview API version. ## Optional Configuration diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py index 83f09344ee03..1286f4c21d57 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py @@ -42,8 +42,10 @@ RequestStatistics, AnalyzeBatchActionsType, AnalyzeBatchActionsError, + HealthcareEntityRelationRoleType, ) from ._paging import AnalyzeHealthcareEntitiesResult +from ._generated.v3_1_preview_4.models import RelationType as HealthcareEntityRelationType __all__ = [ 'TextAnalyticsApiVersion', @@ -83,6 +85,8 @@ 'RequestStatistics', 'AnalyzeBatchActionsType', "AnalyzeBatchActionsError", + "HealthcareEntityRelationType", + "HealthcareEntityRelationRoleType", ] __version__ = VERSION diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_async_lro.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_async_lro.py index 8b3e2764fc3d..c7f2079bb1b6 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_async_lro.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_async_lro.py @@ -85,7 +85,7 @@ def __init__(self, *args, **kwargs): @property def _current_body(self): - from ._generated.v3_1_preview_3.models import JobMetadata + from ._generated.v3_1_preview_4.models import JobMetadata return JobMetadata.deserialize(self._pipeline_response) @property @@ -170,7 +170,7 @@ class AsyncAnalyzeBatchActionsLROPollingMethod(TextAnalyticsAsyncLROPollingMetho @property def _current_body(self): - from ._generated.v3_1_preview_3.models import AnalyzeJobMetadata + from ._generated.v3_1_preview_4.models import AnalyzeJobMetadata return AnalyzeJobMetadata.deserialize(self._pipeline_response) @property @@ -265,4 +265,3 @@ def total_actions_count(self): @property def id(self): return self._polling_method.id - \ No newline at end of file diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py index 5c52ede10fd8..cc898c5d8048 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py @@ -15,7 +15,6 @@ class TextAnalyticsApiVersion(str, Enum): #: this is the default version V3_1_PREVIEW = "v3.1-preview.4" - V3_1_PREVIEW_3 = "v3.1-preview.3" V3_0 = "v3.0" def _authentication_policy(credential): diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_operations_mixin.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_operations_mixin.py index 07e1856dae5f..c151a51ced57 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_operations_mixin.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_operations_mixin.py @@ -54,13 +54,11 @@ def analyze_status( :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeJobState, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState + :rtype: ~azure.ai.textanalytics.v3_1_preview_4.models.AnalyzeJobState :raises: ~azure.core.exceptions.HttpResponseError """ 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': + if 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)) @@ -83,7 +81,7 @@ def begin_analyze( executed. :param body: Collection of documents to analyze and tasks to execute. - :type body: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeBatchInput + :type body: ~azure.ai.textanalytics.v3_1_preview_4.models.AnalyzeBatchInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the AnalyzeBatchActionsLROPollingMethod polling method, @@ -91,13 +89,11 @@ def begin_analyze( :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AnalyzeBatchActionsLROPoller that returns either AnalyzeJobState or the result of cls(response) - :rtype: ~...._lro.AnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState] + :rtype: ~...._lro.AnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_4.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.operations import TextAnalyticsClientOperationsMixin as OperationClass - elif api_version == 'v3.1-preview.4': + if 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)) @@ -131,9 +127,7 @@ def begin_cancel_health_job( :raises ~azure.core.exceptions.HttpResponseError: """ 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': + if 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)) @@ -158,14 +152,14 @@ def begin_health( symptoms, etc) and their relations. :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] + :type documents: list[~azure.ai.textanalytics.v3_1_preview_4.models.MultiLanguageInput] :param model_version: (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. :type model_version: str :param string_index_type: (Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType + :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_4.models.StringIndexType :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the AnalyzeHealthcareEntitiesLROPollingMethod polling method, @@ -173,13 +167,11 @@ def begin_health( :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AnalyzeHealthcareEntitiesLROPoller that returns either HealthcareJobState or the result of cls(response) - :rtype: ~...._lro.AnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState] + :rtype: ~...._lro.AnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1_preview_4.models.HealthcareJobState] :raises ~azure.core.exceptions.HttpResponseError: """ 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': + if 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)) @@ -220,8 +212,6 @@ def entities_linking( api_version = self._get_api_version('entities_linking') if api_version == 'v3.0': 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: @@ -264,8 +254,6 @@ def entities_recognition_general( api_version = self._get_api_version('entities_recognition_general') if api_version == 'v3.0': 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: @@ -285,6 +273,7 @@ def entities_recognition_pii( show_stats=None, # type: Optional[bool] domain=None, # type: Optional[str] string_index_type="TextElements_v8", # type: Optional[Union[str, "_models.StringIndexType"]] + pii_categories=None, # type: Optional[List[Union[str, "_models.PiiCategory"]]] **kwargs # type: Any ): """Entities containing personal information. @@ -296,7 +285,7 @@ def entities_recognition_pii( list of enabled languages. :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] + :type documents: list[~azure.ai.textanalytics.v3_1_preview_4.models.MultiLanguageInput] :param model_version: (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. :type model_version: str @@ -309,16 +298,16 @@ def entities_recognition_pii( :param string_index_type: (Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType + :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_4.models.StringIndexType + :param pii_categories: (Optional) describes the PII categories to return. + :type pii_categories: list[str or ~azure.ai.textanalytics.v3_1_preview_4.models.PiiCategory] :keyword callable cls: A custom type or function that will be passed the direct response :return: PiiResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiResult + :rtype: ~azure.ai.textanalytics.v3_1_preview_4.models.PiiResult :raises: ~azure.core.exceptions.HttpResponseError """ 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': + if 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)) @@ -328,7 +317,7 @@ def entities_recognition_pii( mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.entities_recognition_pii(documents, model_version, show_stats, domain, string_index_type, **kwargs) + return mixin_instance.entities_recognition_pii(documents, model_version, show_stats, domain, string_index_type, pii_categories, **kwargs) def health_status( self, @@ -355,13 +344,11 @@ def health_status( :type show_stats: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: HealthcareJobState, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState + :rtype: ~azure.ai.textanalytics.v3_1_preview_4.models.HealthcareJobState :raises: ~azure.core.exceptions.HttpResponseError """ 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': + if 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)) @@ -402,8 +389,6 @@ def key_phrases( api_version = self._get_api_version('key_phrases') if api_version == 'v3.0': 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: @@ -446,8 +431,6 @@ def languages( api_version = self._get_api_version('languages') if api_version == 'v3.0': 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: @@ -490,8 +473,6 @@ def sentiment( api_version = self._get_api_version('sentiment') if api_version == 'v3.0': 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: diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_text_analytics_client.py index 11dd20effe38..4924acdf0fab 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_text_analytics_client.py @@ -24,6 +24,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -73,8 +74,6 @@ def __init__( ): if api_version == 'v3.0': 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: @@ -95,15 +94,11 @@ def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: * v3.0: :mod:`v3_0.models` - * v3.1-preview.3: :mod:`v3_1_preview_3.models` * v3.1-preview.4: :mod:`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 diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_operations_mixin.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_operations_mixin.py index cedc40af0fc8..3e93045a668c 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_operations_mixin.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_operations_mixin.py @@ -50,13 +50,11 @@ async def analyze_status( :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeJobState, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState + :rtype: ~azure.ai.textanalytics.v3_1_preview_4.models.AnalyzeJobState :raises: ~azure.core.exceptions.HttpResponseError """ 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': + if 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)) @@ -79,7 +77,7 @@ async def begin_analyze( executed. :param body: Collection of documents to analyze and tasks to execute. - :type body: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeBatchInput + :type body: ~azure.ai.textanalytics.v3_1_preview_4.models.AnalyzeBatchInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the AsyncAnalyzeBatchActionsLROPollingMethod polling method, @@ -87,13 +85,11 @@ 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_4.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': + if 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)) @@ -127,9 +123,7 @@ async def begin_cancel_health_job( :raises ~azure.core.exceptions.HttpResponseError: """ 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': + if 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)) @@ -154,14 +148,14 @@ async def begin_health( symptoms, etc) and their relations. :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] + :type documents: list[~azure.ai.textanalytics.v3_1_preview_4.models.MultiLanguageInput] :param model_version: (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. :type model_version: str :param string_index_type: (Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType + :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_4.models.StringIndexType :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the AnalyzeHealthcareEntitiesAsyncLROPollingMethod polling method, @@ -169,13 +163,11 @@ async def begin_health( :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 AnalyzeHealthcareEntitiesAsyncLROPoller that returns either HealthcareJobState or the result of cls(response) - :rtype: ~....._async_lro.AnalyzeHealthcareEntitiesAsyncLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState] + :rtype: ~....._async_lro.AnalyzeHealthcareEntitiesAsyncLROPoller[~azure.ai.textanalytics.v3_1_preview_4.models.HealthcareJobState] :raises ~azure.core.exceptions.HttpResponseError: """ 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': + if 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)) @@ -216,8 +208,6 @@ async def entities_linking( api_version = self._get_api_version('entities_linking') if api_version == 'v3.0': 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: @@ -260,8 +250,6 @@ async def entities_recognition_general( api_version = self._get_api_version('entities_recognition_general') if api_version == 'v3.0': 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: @@ -281,6 +269,7 @@ async def entities_recognition_pii( show_stats: Optional[bool] = None, domain: Optional[str] = None, string_index_type: Optional[Union[str, "_models.StringIndexType"]] = "TextElements_v8", + pii_categories: Optional[List[Union[str, "_models.PiiCategory"]]] = None, **kwargs ) -> "_models.PiiResult": """Entities containing personal information. @@ -292,7 +281,7 @@ async def entities_recognition_pii( list of enabled languages. :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] + :type documents: list[~azure.ai.textanalytics.v3_1_preview_4.models.MultiLanguageInput] :param model_version: (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. :type model_version: str @@ -305,16 +294,16 @@ async def entities_recognition_pii( :param string_index_type: (Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType + :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_4.models.StringIndexType + :param pii_categories: (Optional) describes the PII categories to return. + :type pii_categories: list[str or ~azure.ai.textanalytics.v3_1_preview_4.models.PiiCategory] :keyword callable cls: A custom type or function that will be passed the direct response :return: PiiResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiResult + :rtype: ~azure.ai.textanalytics.v3_1_preview_4.models.PiiResult :raises: ~azure.core.exceptions.HttpResponseError """ 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': + if 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)) @@ -324,7 +313,7 @@ async def entities_recognition_pii( mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.entities_recognition_pii(documents, model_version, show_stats, domain, string_index_type, **kwargs) + return await mixin_instance.entities_recognition_pii(documents, model_version, show_stats, domain, string_index_type, pii_categories, **kwargs) async def health_status( self, @@ -351,13 +340,11 @@ async def health_status( :type show_stats: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: HealthcareJobState, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState + :rtype: ~azure.ai.textanalytics.v3_1_preview_4.models.HealthcareJobState :raises: ~azure.core.exceptions.HttpResponseError """ 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': + if 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)) @@ -398,8 +385,6 @@ async def key_phrases( api_version = self._get_api_version('key_phrases') if api_version == 'v3.0': 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: @@ -442,8 +427,6 @@ async def languages( api_version = self._get_api_version('languages') if api_version == 'v3.0': 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: @@ -486,8 +469,6 @@ async def sentiment( api_version = self._get_api_version('sentiment') if api_version == 'v3.0': 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: diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_text_analytics_client.py index cac9a1c199c1..c31d28562074 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_text_analytics_client.py @@ -12,6 +12,7 @@ from typing import Any, Optional, TYPE_CHECKING from azure.core import AsyncPipelineClient +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin from msrest import Deserializer, Serializer @@ -71,8 +72,6 @@ def __init__( ) -> None: if api_version == 'v3.0': 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: @@ -93,15 +92,11 @@ def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: * v3.0: :mod:`v3_0.models` - * v3.1-preview.3: :mod:`v3_1_preview_3.models` * v3.1-preview.4: :mod:`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 diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_metadata.json b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_metadata.json index c4af58b22177..c9ade25f1f36 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_metadata.json +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_metadata.json @@ -10,8 +10,8 @@ "azure_arm": false, "has_lro_operations": false, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"TextAnalyticsClientConfiguration\"], \"._operations_mixin\": [\"TextAnalyticsClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"TextAnalyticsClientConfiguration\"], \"._operations_mixin\": [\"TextAnalyticsClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"TextAnalyticsClientConfiguration\"], \"._operations_mixin\": [\"TextAnalyticsClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"TextAnalyticsClientConfiguration\"], \"._operations_mixin\": [\"TextAnalyticsClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_text_analytics_client.py index 3a7c99f7257a..1549d8848edb 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_text_analytics_client.py @@ -16,6 +16,7 @@ from typing import Any from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import TextAnalyticsClientConfiguration from .operations import TextAnalyticsClientOperationsMixin @@ -48,6 +49,24 @@ def __init__( self._deserialize = Deserializer(client_models) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/aio/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/aio/_text_analytics_client.py index 9e658f7b4af9..2453bcc1b7cf 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/aio/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/aio/_text_analytics_client.py @@ -9,6 +9,7 @@ from typing import Any, TYPE_CHECKING from azure.core import AsyncPipelineClient +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from msrest import Deserializer, Serializer if TYPE_CHECKING: @@ -45,6 +46,23 @@ def __init__( self._deserialize = Deserializer(client_models) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/__init__.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/__init__.py deleted file mode 100644 index ca973ce68900..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._text_analytics_client import TextAnalyticsClient -__all__ = ['TextAnalyticsClient'] - -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/_configuration.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/_configuration.py deleted file mode 100644 index e216512dcf2e..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/_configuration.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - -VERSION = "unknown" - -class TextAnalyticsClientConfiguration(Configuration): - """Configuration for TextAnalyticsClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - endpoint, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - super(TextAnalyticsClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.endpoint = endpoint - self.credential_scopes = kwargs.pop('credential_scopes', ['https://cognitiveservices.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'ai-textanalytics/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/_metadata.json b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/_metadata.json deleted file mode 100644 index 870a86ee2d3e..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/_metadata.json +++ /dev/null @@ -1,264 +0,0 @@ -{ - "chosen_version": "v3.1-preview.3", - "total_api_version_list": ["v3.1-preview.3"], - "client": { - "name": "TextAnalyticsClient", - "filename": "_text_analytics_client", - "description": "The Text Analytics API is a suite of natural language processing (NLP) services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. Further documentation can be found in :code:`\u003ca href=\"https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview\"\u003ehttps://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview\u003c/a\u003e`.", - "base_url": null, - "custom_base_url": "\u0027{Endpoint}/text/analytics/v3.1-preview.3\u0027", - "azure_arm": false, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"TextAnalyticsClientConfiguration\"], \"._operations_mixin\": [\"TextAnalyticsClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"TextAnalyticsClientConfiguration\"], \"._operations_mixin\": [\"TextAnalyticsClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "endpoint": { - "signature": "endpoint, # type: str", - "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "endpoint": { - "signature": "endpoint: str,", - "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, endpoint", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://cognitiveservices.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - }, - "operation_mixins": { - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"...._lro\": [\"AnalyzeBatchActionsLROPoller\", \"AnalyzeBatchActionsLROPollingMethod\", \"AnalyzeHealthcareEntitiesLROPoller\", \"AnalyzeHealthcareEntitiesLROPollingMethod\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.core.polling.base_polling\": [\"LROBasePolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\", \"Union\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"....._async_lro\": [\"AnalyzeHealthcareEntitiesAsyncLROPoller\", \"AnalyzeHealthcareEntitiesAsyncLROPollingMethod\", \"AsyncAnalyzeBatchActionsLROPoller\", \"AsyncAnalyzeBatchActionsLROPollingMethod\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.core.polling.async_base_polling\": [\"AsyncLROBasePolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\", \"Union\"]}}}", - "operations": { - "_analyze_initial" : { - "sync": { - "signature": "def _analyze_initial(\n self,\n body=None, # type: Optional[\"_models.AnalyzeBatchInput\"]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param body: Collection of documents to analyze and tasks to execute.\n:type body: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeBatchInput\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeJobState, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def _analyze_initial(\n self,\n body: Optional[\"_models.AnalyzeBatchInput\"] = None,\n **kwargs\n) -\u003e Optional[\"_models.AnalyzeJobState\"]:\n", - "doc": "\"\"\"\n\n:param body: Collection of documents to analyze and tasks to execute.\n:type body: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeBatchInput\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeJobState, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "body" - }, - "begin_analyze" : { - "sync": { - "signature": "def begin_analyze(\n self,\n body=None, # type: Optional[\"_models.AnalyzeBatchInput\"]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Submit analysis job.\n\nSubmit a collection of text documents for analysis. Specify one or more unique tasks to be\nexecuted.\n\n:param body: Collection of documents to analyze and tasks to execute.\n:type body: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeBatchInput\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AnalyzeBatchActionsLROPollingMethod polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AnalyzeBatchActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)\n:rtype: ~...._lro.AnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def begin_analyze(\n self,\n body: Optional[\"_models.AnalyzeBatchInput\"] = None,\n **kwargs\n) -\u003e AsyncAnalyzeBatchActionsLROPoller[\"_models.AnalyzeJobState\"]:\n", - "doc": "\"\"\"Submit analysis job.\n\nSubmit a collection of text documents for analysis. Specify one or more unique tasks to be\nexecuted.\n\n:param body: Collection of documents to analyze and tasks to execute.\n:type body: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeBatchInput\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncAnalyzeBatchActionsLROPollingMethod polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncAnalyzeBatchActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)\n:rtype: ~....._async_lro.AsyncAnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "body" - }, - "analyze_status" : { - "sync": { - "signature": "def analyze_status(\n self,\n job_id, # type: str\n show_stats=None, # type: Optional[bool]\n top=20, # type: Optional[int]\n skip=0, # type: Optional[int]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get analysis status and results.\n\nGet the status of an analysis job. A job may consist of one or more tasks. Once all tasks are\ncompleted, the job will transition to the completed state and results will be available for\neach task.\n\n:param job_id: Job ID for Analyze.\n:type job_id: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:param top: (Optional) Set the maximum number of results per task. When both $top and $skip are\n specified, $skip is applied first.\n:type top: int\n:param skip: (Optional) Set the number of elements to offset in the response. When both $top\n and $skip are specified, $skip is applied first.\n:type skip: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeJobState, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def analyze_status(\n self,\n job_id: str,\n show_stats: Optional[bool] = None,\n top: Optional[int] = 20,\n skip: Optional[int] = 0,\n **kwargs\n) -\u003e \"_models.AnalyzeJobState\":\n", - "doc": "\"\"\"Get analysis status and results.\n\nGet the status of an analysis job. A job may consist of one or more tasks. Once all tasks are\ncompleted, the job will transition to the completed state and results will be available for\neach task.\n\n:param job_id: Job ID for Analyze.\n:type job_id: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:param top: (Optional) Set the maximum number of results per task. When both $top and $skip are\n specified, $skip is applied first.\n:type top: int\n:param skip: (Optional) Set the number of elements to offset in the response. When both $top\n and $skip are specified, $skip is applied first.\n:type skip: int\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AnalyzeJobState, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "job_id, show_stats, top, skip" - }, - "health_status" : { - "sync": { - "signature": "def health_status(\n self,\n job_id, # type: str\n top=20, # type: Optional[int]\n skip=0, # type: Optional[int]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get healthcare analysis job status and results.\n\nGet details of the healthcare prediction job specified by the jobId.\n\n:param job_id: Job ID.\n:type job_id: str\n:param top: (Optional) Set the maximum number of results per task. When both $top and $skip are\n specified, $skip is applied first.\n:type top: int\n:param skip: (Optional) Set the number of elements to offset in the response. When both $top\n and $skip are specified, $skip is applied first.\n:type skip: int\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: HealthcareJobState, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def health_status(\n self,\n job_id: str,\n top: Optional[int] = 20,\n skip: Optional[int] = 0,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"_models.HealthcareJobState\":\n", - "doc": "\"\"\"Get healthcare analysis job status and results.\n\nGet details of the healthcare prediction job specified by the jobId.\n\n:param job_id: Job ID.\n:type job_id: str\n:param top: (Optional) Set the maximum number of results per task. When both $top and $skip are\n specified, $skip is applied first.\n:type top: int\n:param skip: (Optional) Set the number of elements to offset in the response. When both $top\n and $skip are specified, $skip is applied first.\n:type skip: int\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: HealthcareJobState, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "job_id, top, skip, show_stats" - }, - "_cancel_health_job_initial" : { - "sync": { - "signature": "def _cancel_health_job_initial(\n self,\n job_id, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param job_id: Job ID.\n:type job_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def _cancel_health_job_initial(\n self,\n job_id: str,\n **kwargs\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param job_id: Job ID.\n:type job_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "job_id" - }, - "begin_cancel_health_job" : { - "sync": { - "signature": "def begin_cancel_health_job(\n self,\n job_id, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Cancel healthcare prediction job.\n\nCancel healthcare prediction job.\n\n:param job_id: Job ID.\n:type job_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the LROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def begin_cancel_health_job(\n self,\n job_id: str,\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Cancel healthcare prediction job.\n\nCancel healthcare prediction job.\n\n:param job_id: Job ID.\n:type job_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncLROBasePolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "job_id" - }, - "_health_initial" : { - "sync": { - "signature": "def _health_initial(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n string_index_type=\"TextElements_v8\", # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: HealthcareJobState, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def _health_initial(\n self,\n documents: List[\"_models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n string_index_type: Optional[Union[str, \"_models.StringIndexType\"]] = \"TextElements_v8\",\n **kwargs\n) -\u003e Optional[\"_models.HealthcareJobState\"]:\n", - "doc": "\"\"\"\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: HealthcareJobState, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "documents, model_version, string_index_type" - }, - "begin_health" : { - "sync": { - "signature": "def begin_health(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n string_index_type=\"TextElements_v8\", # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Submit healthcare analysis job.\n\nStart a healthcare analysis job to recognize healthcare related entities (drugs, conditions,\nsymptoms, etc) and their relations.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AnalyzeHealthcareEntitiesLROPollingMethod polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AnalyzeHealthcareEntitiesLROPoller that returns either HealthcareJobState or the result of cls(response)\n:rtype: ~...._lro.AnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def begin_health(\n self,\n documents: List[\"_models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n string_index_type: Optional[Union[str, \"_models.StringIndexType\"]] = \"TextElements_v8\",\n **kwargs\n) -\u003e AnalyzeHealthcareEntitiesAsyncLROPoller[\"_models.HealthcareJobState\"]:\n", - "doc": "\"\"\"Submit healthcare analysis job.\n\nStart a healthcare analysis job to recognize healthcare related entities (drugs, conditions,\nsymptoms, etc) and their relations.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AnalyzeHealthcareEntitiesAsyncLROPollingMethod polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AnalyzeHealthcareEntitiesAsyncLROPoller that returns either HealthcareJobState or the result of cls(response)\n:rtype: ~....._async_lro.AnalyzeHealthcareEntitiesAsyncLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "documents, model_version, string_index_type" - }, - "entities_recognition_general" : { - "sync": { - "signature": "def entities_recognition_general(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n string_index_type=\"TextElements_v8\", # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Named Entity Recognition.\n\nThe API returns a list of general named entities in a given document. For the list of supported\nentity types, check :code:`\u003ca href=\"https://aka.ms/taner\"\u003eSupported Entity Types in Text\nAnalytics API\u003c/a\u003e`. See the :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text\nAnalytics API\u003c/a\u003e` for the list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntitiesResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def entities_recognition_general(\n self,\n documents: List[\"_models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n string_index_type: Optional[Union[str, \"_models.StringIndexType\"]] = \"TextElements_v8\",\n **kwargs\n) -\u003e \"_models.EntitiesResult\":\n", - "doc": "\"\"\"Named Entity Recognition.\n\nThe API returns a list of general named entities in a given document. For the list of supported\nentity types, check :code:`\u003ca href=\"https://aka.ms/taner\"\u003eSupported Entity Types in Text\nAnalytics API\u003c/a\u003e`. See the :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text\nAnalytics API\u003c/a\u003e` for the list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntitiesResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "documents, model_version, show_stats, string_index_type" - }, - "entities_recognition_pii" : { - "sync": { - "signature": "def entities_recognition_pii(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n domain=None, # type: Optional[str]\n string_index_type=\"TextElements_v8\", # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Entities containing personal information.\n\nThe API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in\nthe document. For the list of supported entity types, check :code:`\u003ca\nhref=\"https://aka.ms/tanerpii\"\u003eSupported Entity Types in Text Analytics API\u003c/a\u003e`. See the\n:code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the\nlist of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:param domain: (Optional) if specified, will set the PII domain to include only a subset of the\n entity categories. Possible values include: \u0027PHI\u0027, \u0027none\u0027.\n:type domain: str\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PiiResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def entities_recognition_pii(\n self,\n documents: List[\"_models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n domain: Optional[str] = None,\n string_index_type: Optional[Union[str, \"_models.StringIndexType\"]] = \"TextElements_v8\",\n **kwargs\n) -\u003e \"_models.PiiResult\":\n", - "doc": "\"\"\"Entities containing personal information.\n\nThe API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in\nthe document. For the list of supported entity types, check :code:`\u003ca\nhref=\"https://aka.ms/tanerpii\"\u003eSupported Entity Types in Text Analytics API\u003c/a\u003e`. See the\n:code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the\nlist of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:param domain: (Optional) if specified, will set the PII domain to include only a subset of the\n entity categories. Possible values include: \u0027PHI\u0027, \u0027none\u0027.\n:type domain: str\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PiiResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "documents, model_version, show_stats, domain, string_index_type" - }, - "entities_linking" : { - "sync": { - "signature": "def entities_linking(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n string_index_type=\"TextElements_v8\", # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Linked entities from a well-known knowledge base.\n\nThe API returns a list of recognized entities with links to a well-known knowledge base. See\nthe :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for\nthe list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntityLinkingResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.EntityLinkingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def entities_linking(\n self,\n documents: List[\"_models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n string_index_type: Optional[Union[str, \"_models.StringIndexType\"]] = \"TextElements_v8\",\n **kwargs\n) -\u003e \"_models.EntityLinkingResult\":\n", - "doc": "\"\"\"Linked entities from a well-known knowledge base.\n\nThe API returns a list of recognized entities with links to a well-known knowledge base. See\nthe :code:`\u003ca href=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for\nthe list of enabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EntityLinkingResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.EntityLinkingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "documents, model_version, show_stats, string_index_type" - }, - "key_phrases" : { - "sync": { - "signature": "def key_phrases(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Key Phrases.\n\nThe API returns a list of strings denoting the key phrases in the input text. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyPhraseResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhraseResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def key_phrases(\n self,\n documents: List[\"_models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"_models.KeyPhraseResult\":\n", - "doc": "\"\"\"Key Phrases.\n\nThe API returns a list of strings denoting the key phrases in the input text. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: KeyPhraseResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhraseResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "documents, model_version, show_stats" - }, - "languages" : { - "sync": { - "signature": "def languages(\n self,\n documents, # type: List[\"_models.LanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Detect Language.\n\nThe API returns the detected language and a numeric score between 0 and 1. Scores close to 1\nindicate 100% certainty that the identified language is true. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents:\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.LanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: LanguageResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.LanguageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def languages(\n self,\n documents: List[\"_models.LanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n **kwargs\n) -\u003e \"_models.LanguageResult\":\n", - "doc": "\"\"\"Detect Language.\n\nThe API returns the detected language and a numeric score between 0 and 1. Scores close to 1\nindicate 100% certainty that the identified language is true. See the :code:`\u003ca\nhref=\"https://aka.ms/talangs\"\u003eSupported languages in Text Analytics API\u003c/a\u003e` for the list of\nenabled languages.\n\n:param documents:\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.LanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: LanguageResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.LanguageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "documents, model_version, show_stats" - }, - "sentiment" : { - "sync": { - "signature": "def sentiment(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n show_stats=None, # type: Optional[bool]\n opinion_mining=None, # type: Optional[bool]\n string_index_type=\"TextElements_v8\", # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Sentiment.\n\nThe API returns a detailed sentiment analysis for the input text. The analysis is done in\nmultiple levels of granularity, start from the a document level, down to sentence and key terms\n(aspects) and opinions.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:param opinion_mining: (Optional) if set to true, response will contain input and document\n level statistics including aspect-based sentiment analysis results.\n:type opinion_mining: bool\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SentimentResponse, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.SentimentResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def sentiment(\n self,\n documents: List[\"_models.MultiLanguageInput\"],\n model_version: Optional[str] = None,\n show_stats: Optional[bool] = None,\n opinion_mining: Optional[bool] = None,\n string_index_type: Optional[Union[str, \"_models.StringIndexType\"]] = \"TextElements_v8\",\n **kwargs\n) -\u003e \"_models.SentimentResponse\":\n", - "doc": "\"\"\"Sentiment.\n\nThe API returns a detailed sentiment analysis for the input text. The analysis is done in\nmultiple levels of granularity, start from the a document level, down to sentence and key terms\n(aspects) and opinions.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput]\n:param model_version: (Optional) This value indicates which model will be used for scoring. If\n a model-version is not specified, the API should default to the latest, non-preview version.\n:type model_version: str\n:param show_stats: (Optional) if set to true, response will contain request and document level\n statistics.\n:type show_stats: bool\n:param opinion_mining: (Optional) if set to true, response will contain input and document\n level statistics including aspect-based sentiment analysis results.\n:type opinion_mining: bool\n:param string_index_type: (Optional) Specifies the method used to interpret string offsets.\n Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information\n see https://aka.ms/text-analytics-offsets.\n:type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SentimentResponse, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.SentimentResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "documents, model_version, show_stats, opinion_mining, string_index_type" - } - } - } -} \ No newline at end of file diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/_text_analytics_client.py deleted file mode 100644 index eb8bcf036d98..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/_text_analytics_client.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core import PipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - -from ._configuration import TextAnalyticsClientConfiguration -from .operations import TextAnalyticsClientOperationsMixin -from . import models - - -class TextAnalyticsClient(TextAnalyticsClientOperationsMixin): - """The Text Analytics API is a suite of natural language processing (NLP) services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. Further documentation can be found in :code:`https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview`. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - endpoint, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - base_url = '{Endpoint}/text/analytics/v3.1-preview.3' - self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs) - self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> TextAnalyticsClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/__init__.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/__init__.py deleted file mode 100644 index b64fe33ea84d..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._text_analytics_client import TextAnalyticsClient -__all__ = ['TextAnalyticsClient'] diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/_configuration.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/_configuration.py deleted file mode 100644 index 033d80c38005..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/_configuration.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class TextAnalyticsClientConfiguration(Configuration): - """Configuration for TextAnalyticsClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - endpoint: str, - **kwargs: Any - ) -> None: - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - super(TextAnalyticsClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.endpoint = endpoint - self.credential_scopes = kwargs.pop('credential_scopes', ['https://cognitiveservices.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'ai-textanalytics/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/_text_analytics_client.py deleted file mode 100644 index d4f49a3f2f9e..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/_text_analytics_client.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core import AsyncPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import TextAnalyticsClientConfiguration -from .operations import TextAnalyticsClientOperationsMixin -from .. import models - - -class TextAnalyticsClient(TextAnalyticsClientOperationsMixin): - """The Text Analytics API is a suite of natural language processing (NLP) services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. Further documentation can be found in :code:`https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview`. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - endpoint: str, - **kwargs: Any - ) -> None: - base_url = '{Endpoint}/text/analytics/v3.1-preview.3' - self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs) - self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "TextAnalyticsClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/operations/__init__.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/operations/__init__.py deleted file mode 100644 index 4384511c0346..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/operations/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._text_analytics_client_operations import TextAnalyticsClientOperationsMixin - -__all__ = [ - 'TextAnalyticsClientOperationsMixin', -] diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/operations/_text_analytics_client_operations.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/operations/_text_analytics_client_operations.py deleted file mode 100644 index 07b6892a3009..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/aio/operations/_text_analytics_client_operations.py +++ /dev/null @@ -1,1058 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -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 -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.polling.async_base_polling import AsyncLROBasePolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class TextAnalyticsClientOperationsMixin: - - async def _analyze_initial( - self, - body: Optional["_models.AnalyzeBatchInput"] = None, - **kwargs - ) -> Optional["_models.AnalyzeJobState"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AnalyzeJobState"]] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._analyze_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if body is not None: - body_content = self._serialize.body(body, 'AnalyzeBatchInput') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AnalyzeJobState', pipeline_response) - - if response.status_code == 202: - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - _analyze_initial.metadata = {'url': '/analyze'} # type: ignore - - async def begin_analyze( - self, - body: Optional["_models.AnalyzeBatchInput"] = None, - **kwargs - ) -> AsyncAnalyzeBatchActionsLROPoller["_models.AnalyzeJobState"]: - """Submit analysis job. - - Submit a collection of text documents for analysis. Specify one or more unique tasks to be - executed. - - :param body: Collection of documents to analyze and tasks to execute. - :type body: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeBatchInput - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncAnalyzeBatchActionsLROPollingMethod polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. - :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] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeJobState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._analyze_initial( - body=body, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AnalyzeJobState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - - if polling is True: polling_method = AsyncAnalyzeBatchActionsLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncAnalyzeBatchActionsLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncAnalyzeBatchActionsLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_analyze.metadata = {'url': '/analyze'} # type: ignore - - async def analyze_status( - self, - job_id: str, - show_stats: Optional[bool] = None, - top: Optional[int] = 20, - skip: Optional[int] = 0, - **kwargs - ) -> "_models.AnalyzeJobState": - """Get analysis status and results. - - Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are - completed, the job will transition to the completed state and results will be available for - each task. - - :param job_id: Job ID for Analyze. - :type job_id: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :param top: (Optional) Set the maximum number of results per task. When both $top and $skip are - specified, $skip is applied first. - :type top: int - :param skip: (Optional) Set the number of elements to offset in the response. When both $top - and $skip are specified, $skip is applied first. - :type skip: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AnalyzeJobState, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeJobState"] - error_map = { - 401: ClientAuthenticationError, - 409: ResourceExistsError, - 404: lambda response: ResourceNotFoundError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - - # Construct URL - url = self.analyze_status.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'jobId': self._serialize.url("job_id", job_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=50, minimum=1) - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('AnalyzeJobState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - analyze_status.metadata = {'url': '/analyze/jobs/{jobId}'} # type: ignore - - async def health_status( - self, - job_id: str, - top: Optional[int] = 20, - skip: Optional[int] = 0, - show_stats: Optional[bool] = None, - **kwargs - ) -> "_models.HealthcareJobState": - """Get healthcare analysis job status and results. - - Get details of the healthcare prediction job specified by the jobId. - - :param job_id: Job ID. - :type job_id: str - :param top: (Optional) Set the maximum number of results per task. When both $top and $skip are - specified, $skip is applied first. - :type top: int - :param skip: (Optional) Set the number of elements to offset in the response. When both $top - and $skip are specified, $skip is applied first. - :type skip: int - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HealthcareJobState, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.HealthcareJobState"] - error_map = { - 401: ClientAuthenticationError, - 409: ResourceExistsError, - 404: lambda response: ResourceNotFoundError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - - # Construct URL - url = self.health_status.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'jobId': self._serialize.url("job_id", job_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=50, minimum=1) - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('HealthcareJobState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - health_status.metadata = {'url': '/entities/health/jobs/{jobId}'} # type: ignore - - async def _cancel_health_job_initial( - self, - job_id: str, - **kwargs - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, - 409: ResourceExistsError, - 404: lambda response: ResourceNotFoundError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - - # Construct URL - url = self._cancel_health_job_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'jobId': self._serialize.url("job_id", job_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - - if cls: - return cls(pipeline_response, None, response_headers) - - _cancel_health_job_initial.metadata = {'url': '/entities/health/jobs/{jobId}'} # type: ignore - - async def begin_cancel_health_job( - self, - job_id: str, - **kwargs - ) -> AsyncLROPoller[None]: - """Cancel healthcare prediction job. - - Cancel healthcare prediction job. - - :param job_id: Job ID. - :type job_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. - :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 AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._cancel_health_job_initial( - job_id=job_id, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'jobId': self._serialize.url("job_id", job_id, 'str'), - } - - if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_cancel_health_job.metadata = {'url': '/entities/health/jobs/{jobId}'} # type: ignore - - async def _health_initial( - self, - documents: List["_models.MultiLanguageInput"], - model_version: Optional[str] = None, - string_index_type: Optional[Union[str, "_models.StringIndexType"]] = "TextElements_v8", - **kwargs - ) -> Optional["_models.HealthcareJobState"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.HealthcareJobState"]] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._health_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if string_index_type is not None: - query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('HealthcareJobState', pipeline_response) - - if response.status_code == 202: - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - _health_initial.metadata = {'url': '/entities/health/jobs'} # type: ignore - - async def begin_health( - self, - documents: List["_models.MultiLanguageInput"], - model_version: Optional[str] = None, - string_index_type: Optional[Union[str, "_models.StringIndexType"]] = "TextElements_v8", - **kwargs - ) -> AnalyzeHealthcareEntitiesAsyncLROPoller["_models.HealthcareJobState"]: - """Submit healthcare analysis job. - - Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions, - symptoms, etc) and their relations. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param string_index_type: (Optional) Specifies the method used to interpret string offsets. - Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information - see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AnalyzeHealthcareEntitiesAsyncLROPollingMethod polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. - :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 AnalyzeHealthcareEntitiesAsyncLROPoller that returns either HealthcareJobState or the result of cls(response) - :rtype: ~....._async_lro.AnalyzeHealthcareEntitiesAsyncLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.HealthcareJobState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._health_initial( - documents=documents, - model_version=model_version, - string_index_type=string_index_type, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('HealthcareJobState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - - if polling is True: polling_method = AnalyzeHealthcareEntitiesAsyncLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AnalyzeHealthcareEntitiesAsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AnalyzeHealthcareEntitiesAsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_health.metadata = {'url': '/entities/health/jobs'} # type: ignore - - async def entities_recognition_general( - self, - documents: List["_models.MultiLanguageInput"], - model_version: Optional[str] = None, - show_stats: Optional[bool] = None, - string_index_type: Optional[Union[str, "_models.StringIndexType"]] = "TextElements_v8", - **kwargs - ) -> "_models.EntitiesResult": - """Named Entity Recognition. - - The API returns a list of general named entities in a given document. For the list of supported - entity types, check :code:`Supported Entity Types in Text - Analytics API`. See the :code:`Supported languages in Text - Analytics API` for the list of enabled languages. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :param string_index_type: (Optional) Specifies the method used to interpret string offsets. - Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information - see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EntitiesResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EntitiesResult"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.entities_recognition_general.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - if string_index_type is not None: - query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('EntitiesResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - entities_recognition_general.metadata = {'url': '/entities/recognition/general'} # type: ignore - - async def entities_recognition_pii( - self, - documents: List["_models.MultiLanguageInput"], - model_version: Optional[str] = None, - show_stats: Optional[bool] = None, - domain: Optional[str] = None, - string_index_type: Optional[Union[str, "_models.StringIndexType"]] = "TextElements_v8", - **kwargs - ) -> "_models.PiiResult": - """Entities containing personal information. - - The API returns a list of entities with personal information (\"SSN\", \"Bank Account\" etc) in - the document. For the list of supported entity types, check :code:`Supported Entity Types in Text Analytics API`. See the - :code:`Supported languages in Text Analytics API` for the - list of enabled languages. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :param domain: (Optional) if specified, will set the PII domain to include only a subset of the - entity categories. Possible values include: 'PHI', 'none'. - :type domain: str - :param string_index_type: (Optional) Specifies the method used to interpret string offsets. - Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information - see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PiiResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PiiResult"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.entities_recognition_pii.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - if domain is not None: - query_parameters['domain'] = self._serialize.query("domain", domain, 'str') - if string_index_type is not None: - query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('PiiResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - entities_recognition_pii.metadata = {'url': '/entities/recognition/pii'} # type: ignore - - async def entities_linking( - self, - documents: List["_models.MultiLanguageInput"], - model_version: Optional[str] = None, - show_stats: Optional[bool] = None, - string_index_type: Optional[Union[str, "_models.StringIndexType"]] = "TextElements_v8", - **kwargs - ) -> "_models.EntityLinkingResult": - """Linked entities from a well-known knowledge base. - - The API returns a list of recognized entities with links to a well-known knowledge base. See - the :code:`Supported languages in Text Analytics API` for - the list of enabled languages. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :param string_index_type: (Optional) Specifies the method used to interpret string offsets. - Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information - see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EntityLinkingResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.EntityLinkingResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EntityLinkingResult"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.entities_linking.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - if string_index_type is not None: - query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('EntityLinkingResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - entities_linking.metadata = {'url': '/entities/linking'} # type: ignore - - async def key_phrases( - self, - documents: List["_models.MultiLanguageInput"], - model_version: Optional[str] = None, - show_stats: Optional[bool] = None, - **kwargs - ) -> "_models.KeyPhraseResult": - """Key Phrases. - - The API returns a list of strings denoting the key phrases in the input text. See the :code:`Supported languages in Text Analytics API` for the list of - enabled languages. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: KeyPhraseResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhraseResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyPhraseResult"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.key_phrases.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('KeyPhraseResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - key_phrases.metadata = {'url': '/keyPhrases'} # type: ignore - - async def languages( - self, - documents: List["_models.LanguageInput"], - model_version: Optional[str] = None, - show_stats: Optional[bool] = None, - **kwargs - ) -> "_models.LanguageResult": - """Detect Language. - - The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 - indicate 100% certainty that the identified language is true. See the :code:`Supported languages in Text Analytics API` for the list of - enabled languages. - - :param documents: - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.LanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LanguageResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.LanguageResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LanguageResult"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.LanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.languages.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'LanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('LanguageResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - languages.metadata = {'url': '/languages'} # type: ignore - - async def sentiment( - self, - documents: List["_models.MultiLanguageInput"], - model_version: Optional[str] = None, - show_stats: Optional[bool] = None, - opinion_mining: Optional[bool] = None, - string_index_type: Optional[Union[str, "_models.StringIndexType"]] = "TextElements_v8", - **kwargs - ) -> "_models.SentimentResponse": - """Sentiment. - - The API returns a detailed sentiment analysis for the input text. The analysis is done in - multiple levels of granularity, start from the a document level, down to sentence and key terms - (aspects) and opinions. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :param opinion_mining: (Optional) if set to true, response will contain input and document - level statistics including aspect-based sentiment analysis results. - :type opinion_mining: bool - :param string_index_type: (Optional) Specifies the method used to interpret string offsets. - Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information - see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SentimentResponse, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.SentimentResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SentimentResponse"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.sentiment.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - if opinion_mining is not None: - query_parameters['opinionMining'] = self._serialize.query("opinion_mining", opinion_mining, 'bool') - if string_index_type is not None: - query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('SentimentResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - sentiment.metadata = {'url': '/sentiment'} # type: ignore diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/__init__.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/__init__.py deleted file mode 100644 index 2283433631d4..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/__init__.py +++ /dev/null @@ -1,227 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AnalyzeBatchInput - from ._models_py3 import AnalyzeJobMetadata - from ._models_py3 import AnalyzeJobState - from ._models_py3 import AspectConfidenceScoreLabel - from ._models_py3 import AspectRelation - from ._models_py3 import Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1 - from ._models_py3 import Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1 - from ._models_py3 import Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1 - from ._models_py3 import DetectedLanguage - from ._models_py3 import DocumentEntities - from ._models_py3 import DocumentError - from ._models_py3 import DocumentHealthcareEntities - from ._models_py3 import DocumentKeyPhrases - from ._models_py3 import DocumentLanguage - from ._models_py3 import DocumentLinkedEntities - from ._models_py3 import DocumentSentiment - from ._models_py3 import DocumentStatistics - from ._models_py3 import EntitiesResult - from ._models_py3 import EntitiesTask - from ._models_py3 import EntitiesTaskParameters - from ._models_py3 import Entity - from ._models_py3 import EntityLinkingResult - from ._models_py3 import ErrorResponse - from ._models_py3 import HealthcareEntity - from ._models_py3 import HealthcareEntityLink - from ._models_py3 import HealthcareJobState - from ._models_py3 import HealthcareRelation - from ._models_py3 import HealthcareResult - from ._models_py3 import InnerError - from ._models_py3 import JobDescriptor - from ._models_py3 import JobManifest - from ._models_py3 import JobManifestTasks - from ._models_py3 import JobMetadata - from ._models_py3 import KeyPhraseResult - from ._models_py3 import KeyPhrasesTask - from ._models_py3 import KeyPhrasesTaskParameters - from ._models_py3 import LanguageBatchInput - from ._models_py3 import LanguageInput - from ._models_py3 import LanguageResult - from ._models_py3 import LinkedEntity - from ._models_py3 import Match - from ._models_py3 import MultiLanguageBatchInput - from ._models_py3 import MultiLanguageInput - from ._models_py3 import Pagination - from ._models_py3 import PiiDocumentEntities - from ._models_py3 import PiiResult - from ._models_py3 import PiiTask - from ._models_py3 import PiiTaskParameters - from ._models_py3 import RequestStatistics - from ._models_py3 import SentenceAspect - from ._models_py3 import SentenceOpinion - from ._models_py3 import SentenceSentiment - from ._models_py3 import SentimentConfidenceScorePerLabel - from ._models_py3 import SentimentResponse - from ._models_py3 import TaskState - from ._models_py3 import TasksState - from ._models_py3 import TasksStateTasks - from ._models_py3 import TasksStateTasksDetails - from ._models_py3 import TasksStateTasksEntityRecognitionPiiTasksItem - from ._models_py3 import TasksStateTasksEntityRecognitionTasksItem - from ._models_py3 import TasksStateTasksKeyPhraseExtractionTasksItem - from ._models_py3 import TextAnalyticsError - from ._models_py3 import TextAnalyticsWarning -except (SyntaxError, ImportError): - from ._models import AnalyzeBatchInput # type: ignore - from ._models import AnalyzeJobMetadata # type: ignore - from ._models import AnalyzeJobState # type: ignore - from ._models import AspectConfidenceScoreLabel # type: ignore - from ._models import AspectRelation # type: ignore - from ._models import Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1 # type: ignore - from ._models import Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1 # type: ignore - from ._models import Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1 # type: ignore - from ._models import DetectedLanguage # type: ignore - from ._models import DocumentEntities # type: ignore - from ._models import DocumentError # type: ignore - from ._models import DocumentHealthcareEntities # type: ignore - from ._models import DocumentKeyPhrases # type: ignore - from ._models import DocumentLanguage # type: ignore - from ._models import DocumentLinkedEntities # type: ignore - from ._models import DocumentSentiment # type: ignore - from ._models import DocumentStatistics # type: ignore - from ._models import EntitiesResult # type: ignore - from ._models import EntitiesTask # type: ignore - from ._models import EntitiesTaskParameters # type: ignore - from ._models import Entity # type: ignore - from ._models import EntityLinkingResult # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import HealthcareEntity # type: ignore - from ._models import HealthcareEntityLink # type: ignore - from ._models import HealthcareJobState # type: ignore - from ._models import HealthcareRelation # type: ignore - from ._models import HealthcareResult # type: ignore - from ._models import InnerError # type: ignore - from ._models import JobDescriptor # type: ignore - from ._models import JobManifest # type: ignore - from ._models import JobManifestTasks # type: ignore - from ._models import JobMetadata # type: ignore - from ._models import KeyPhraseResult # type: ignore - from ._models import KeyPhrasesTask # type: ignore - from ._models import KeyPhrasesTaskParameters # type: ignore - from ._models import LanguageBatchInput # type: ignore - from ._models import LanguageInput # type: ignore - from ._models import LanguageResult # type: ignore - from ._models import LinkedEntity # type: ignore - from ._models import Match # type: ignore - from ._models import MultiLanguageBatchInput # type: ignore - from ._models import MultiLanguageInput # type: ignore - from ._models import Pagination # type: ignore - from ._models import PiiDocumentEntities # type: ignore - from ._models import PiiResult # type: ignore - from ._models import PiiTask # type: ignore - from ._models import PiiTaskParameters # type: ignore - from ._models import RequestStatistics # type: ignore - from ._models import SentenceAspect # type: ignore - from ._models import SentenceOpinion # type: ignore - from ._models import SentenceSentiment # type: ignore - from ._models import SentimentConfidenceScorePerLabel # type: ignore - from ._models import SentimentResponse # type: ignore - from ._models import TaskState # type: ignore - from ._models import TasksState # type: ignore - from ._models import TasksStateTasks # type: ignore - from ._models import TasksStateTasksDetails # type: ignore - from ._models import TasksStateTasksEntityRecognitionPiiTasksItem # type: ignore - from ._models import TasksStateTasksEntityRecognitionTasksItem # type: ignore - from ._models import TasksStateTasksKeyPhraseExtractionTasksItem # type: ignore - from ._models import TextAnalyticsError # type: ignore - from ._models import TextAnalyticsWarning # type: ignore - -from ._text_analytics_client_enums import ( - AspectRelationType, - DocumentSentimentValue, - ErrorCodeValue, - InnerErrorCodeValue, - PiiTaskParametersDomain, - SentenceSentimentValue, - State, - StringIndexType, - StringIndexTypeResponse, - TokenSentimentValue, - WarningCodeValue, -) - -__all__ = [ - 'AnalyzeBatchInput', - 'AnalyzeJobMetadata', - 'AnalyzeJobState', - 'AspectConfidenceScoreLabel', - 'AspectRelation', - 'Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1', - 'Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1', - 'Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1', - 'DetectedLanguage', - 'DocumentEntities', - 'DocumentError', - 'DocumentHealthcareEntities', - 'DocumentKeyPhrases', - 'DocumentLanguage', - 'DocumentLinkedEntities', - 'DocumentSentiment', - 'DocumentStatistics', - 'EntitiesResult', - 'EntitiesTask', - 'EntitiesTaskParameters', - 'Entity', - 'EntityLinkingResult', - 'ErrorResponse', - 'HealthcareEntity', - 'HealthcareEntityLink', - 'HealthcareJobState', - 'HealthcareRelation', - 'HealthcareResult', - 'InnerError', - 'JobDescriptor', - 'JobManifest', - 'JobManifestTasks', - 'JobMetadata', - 'KeyPhraseResult', - 'KeyPhrasesTask', - 'KeyPhrasesTaskParameters', - 'LanguageBatchInput', - 'LanguageInput', - 'LanguageResult', - 'LinkedEntity', - 'Match', - 'MultiLanguageBatchInput', - 'MultiLanguageInput', - 'Pagination', - 'PiiDocumentEntities', - 'PiiResult', - 'PiiTask', - 'PiiTaskParameters', - 'RequestStatistics', - 'SentenceAspect', - 'SentenceOpinion', - 'SentenceSentiment', - 'SentimentConfidenceScorePerLabel', - 'SentimentResponse', - 'TaskState', - 'TasksState', - 'TasksStateTasks', - 'TasksStateTasksDetails', - 'TasksStateTasksEntityRecognitionPiiTasksItem', - 'TasksStateTasksEntityRecognitionTasksItem', - 'TasksStateTasksKeyPhraseExtractionTasksItem', - 'TextAnalyticsError', - 'TextAnalyticsWarning', - 'AspectRelationType', - 'DocumentSentimentValue', - 'ErrorCodeValue', - 'InnerErrorCodeValue', - 'PiiTaskParametersDomain', - 'SentenceSentimentValue', - 'State', - 'StringIndexType', - 'StringIndexTypeResponse', - 'TokenSentimentValue', - 'WarningCodeValue', -] diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/_models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/_models.py deleted file mode 100644 index 951f9939c49e..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/_models.py +++ /dev/null @@ -1,2365 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class JobManifest(msrest.serialization.Model): - """JobManifest. - - All required parameters must be populated in order to send to Azure. - - :param tasks: Required. The set of tasks to execute on the input documents. Cannot specify the - same task more than once. - :type tasks: ~azure.ai.textanalytics.v3_1_preview_3.models.JobManifestTasks - """ - - _validation = { - 'tasks': {'required': True}, - } - - _attribute_map = { - 'tasks': {'key': 'tasks', 'type': 'JobManifestTasks'}, - } - - def __init__( - self, - **kwargs - ): - super(JobManifest, self).__init__(**kwargs) - self.tasks = kwargs['tasks'] - - -class JobDescriptor(msrest.serialization.Model): - """JobDescriptor. - - :param display_name: Optional display name for the analysis job. - :type display_name: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobDescriptor, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - - -class AnalyzeBatchInput(JobDescriptor, JobManifest): - """AnalyzeBatchInput. - - All required parameters must be populated in order to send to Azure. - - :param tasks: Required. The set of tasks to execute on the input documents. Cannot specify the - same task more than once. - :type tasks: ~azure.ai.textanalytics.v3_1_preview_3.models.JobManifestTasks - :param display_name: Optional display name for the analysis job. - :type display_name: str - :param analysis_input: Required. Contains a set of input documents to be analyzed by the - service. - :type analysis_input: ~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageBatchInput - """ - - _validation = { - 'tasks': {'required': True}, - 'analysis_input': {'required': True}, - } - - _attribute_map = { - 'tasks': {'key': 'tasks', 'type': 'JobManifestTasks'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'analysis_input': {'key': 'analysisInput', 'type': 'MultiLanguageBatchInput'}, - } - - def __init__( - self, - **kwargs - ): - super(AnalyzeBatchInput, self).__init__(**kwargs) - self.tasks = kwargs['tasks'] - self.analysis_input = kwargs['analysis_input'] - self.display_name = kwargs.get('display_name', None) - self.analysis_input = kwargs['analysis_input'] - - -class JobMetadata(msrest.serialization.Model): - """JobMetadata. - - All required parameters must be populated in order to send to Azure. - - :param created_date_time: Required. - :type created_date_time: ~datetime.datetime - :param expiration_date_time: - :type expiration_date_time: ~datetime.datetime - :param job_id: Required. - :type job_id: str - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'created_date_time': {'required': True}, - 'job_id': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobMetadata, self).__init__(**kwargs) - self.created_date_time = kwargs['created_date_time'] - self.expiration_date_time = kwargs.get('expiration_date_time', None) - self.job_id = kwargs['job_id'] - self.last_update_date_time = kwargs['last_update_date_time'] - self.status = kwargs['status'] - - -class AnalyzeJobMetadata(JobMetadata): - """AnalyzeJobMetadata. - - All required parameters must be populated in order to send to Azure. - - :param created_date_time: Required. - :type created_date_time: ~datetime.datetime - :param expiration_date_time: - :type expiration_date_time: ~datetime.datetime - :param job_id: Required. - :type job_id: str - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - :param display_name: - :type display_name: str - """ - - _validation = { - 'created_date_time': {'required': True}, - 'job_id': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AnalyzeJobMetadata, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - - -class Pagination(msrest.serialization.Model): - """Pagination. - - :param next_link: - :type next_link: str - """ - - _attribute_map = { - 'next_link': {'key': '@nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Pagination, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - - -class TasksState(msrest.serialization.Model): - """TasksState. - - All required parameters must be populated in order to send to Azure. - - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasks - """ - - _validation = { - 'tasks': {'required': True}, - } - - _attribute_map = { - 'tasks': {'key': 'tasks', 'type': 'TasksStateTasks'}, - } - - def __init__( - self, - **kwargs - ): - super(TasksState, self).__init__(**kwargs) - self.tasks = kwargs['tasks'] - - -class AnalyzeJobState(AnalyzeJobMetadata, TasksState, Pagination): - """AnalyzeJobState. - - All required parameters must be populated in order to send to Azure. - - :param next_link: - :type next_link: str - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasks - :param created_date_time: Required. - :type created_date_time: ~datetime.datetime - :param expiration_date_time: - :type expiration_date_time: ~datetime.datetime - :param job_id: Required. - :type job_id: str - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - :param display_name: - :type display_name: str - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - """ - - _validation = { - 'tasks': {'required': True}, - 'created_date_time': {'required': True}, - 'job_id': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'next_link': {'key': '@nextLink', 'type': 'str'}, - 'tasks': {'key': 'tasks', 'type': 'TasksStateTasks'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[TextAnalyticsError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__( - self, - **kwargs - ): - super(AnalyzeJobState, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.tasks = kwargs['tasks'] - self.errors = kwargs.get('errors', None) - self.statistics = kwargs.get('statistics', None) - self.next_link = kwargs.get('next_link', None) - self.created_date_time = kwargs['created_date_time'] - self.expiration_date_time = kwargs.get('expiration_date_time', None) - self.job_id = kwargs['job_id'] - self.last_update_date_time = kwargs['last_update_date_time'] - self.status = kwargs['status'] - self.display_name = kwargs.get('display_name', None) - self.errors = kwargs.get('errors', None) - self.statistics = kwargs.get('statistics', None) - self.tasks = kwargs['tasks'] - self.created_date_time = kwargs['created_date_time'] - self.expiration_date_time = kwargs.get('expiration_date_time', None) - self.job_id = kwargs['job_id'] - self.last_update_date_time = kwargs['last_update_date_time'] - self.status = kwargs['status'] - self.display_name = kwargs.get('display_name', None) - self.errors = kwargs.get('errors', None) - self.statistics = kwargs.get('statistics', None) - - -class AspectConfidenceScoreLabel(msrest.serialization.Model): - """Represents the confidence scores across all sentiment classes: positive, neutral, negative. - - All required parameters must be populated in order to send to Azure. - - :param positive: Required. - :type positive: float - :param negative: Required. - :type negative: float - """ - - _validation = { - 'positive': {'required': True}, - 'negative': {'required': True}, - } - - _attribute_map = { - 'positive': {'key': 'positive', 'type': 'float'}, - 'negative': {'key': 'negative', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(AspectConfidenceScoreLabel, self).__init__(**kwargs) - self.positive = kwargs['positive'] - self.negative = kwargs['negative'] - - -class AspectRelation(msrest.serialization.Model): - """AspectRelation. - - All required parameters must be populated in order to send to Azure. - - :param relation_type: Required. The type related to the aspect. Possible values include: - "opinion", "aspect". - :type relation_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.AspectRelationType - :param ref: Required. The JSON pointer indicating the linked object. - :type ref: str - """ - - _validation = { - 'relation_type': {'required': True}, - 'ref': {'required': True}, - } - - _attribute_map = { - 'relation_type': {'key': 'relationType', 'type': 'str'}, - 'ref': {'key': 'ref', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AspectRelation, self).__init__(**kwargs) - self.relation_type = kwargs['relation_type'] - self.ref = kwargs['ref'] - - -class Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1(msrest.serialization.Model): - """Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesResult - """ - - _validation = { - 'results': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'EntitiesResult'}, - } - - def __init__( - self, - **kwargs - ): - super(Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1, self).__init__(**kwargs) - self.results = kwargs['results'] - - -class Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1(msrest.serialization.Model): - """Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiResult - """ - - _validation = { - 'results': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'PiiResult'}, - } - - def __init__( - self, - **kwargs - ): - super(Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1, self).__init__(**kwargs) - self.results = kwargs['results'] - - -class Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1(msrest.serialization.Model): - """Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhraseResult - """ - - _validation = { - 'results': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'KeyPhraseResult'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1, self).__init__(**kwargs) - self.results = kwargs['results'] - - -class DetectedLanguage(msrest.serialization.Model): - """DetectedLanguage. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Long name of a detected language (e.g. English, French). - :type name: str - :param iso6391_name: Required. A two letter representation of the detected language according - to the ISO 639-1 standard (e.g. en, fr). - :type iso6391_name: str - :param confidence_score: Required. A confidence score between 0 and 1. Scores close to 1 - indicate 100% certainty that the identified language is true. - :type confidence_score: float - """ - - _validation = { - 'name': {'required': True}, - 'iso6391_name': {'required': True}, - 'confidence_score': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, - 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(DetectedLanguage, self).__init__(**kwargs) - self.name = kwargs['name'] - self.iso6391_name = kwargs['iso6391_name'] - self.confidence_score = kwargs['confidence_score'] - - -class DocumentEntities(msrest.serialization.Model): - """DocumentEntities. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param entities: Required. Recognized entities in the document. - :type entities: list[~azure.ai.textanalytics.v3_1_preview_3.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'entities': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[Entity]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - **kwargs - ): - super(DocumentEntities, self).__init__(**kwargs) - self.id = kwargs['id'] - self.entities = kwargs['entities'] - self.warnings = kwargs['warnings'] - self.statistics = kwargs.get('statistics', None) - - -class DocumentError(msrest.serialization.Model): - """DocumentError. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Document Id. - :type id: str - :param error: Required. Document Error. - :type error: ~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsError - """ - - _validation = { - 'id': {'required': True}, - 'error': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'TextAnalyticsError'}, - } - - def __init__( - self, - **kwargs - ): - super(DocumentError, self).__init__(**kwargs) - self.id = kwargs['id'] - self.error = kwargs['error'] - - -class DocumentHealthcareEntities(msrest.serialization.Model): - """DocumentHealthcareEntities. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param entities: Required. Healthcare entities. - :type entities: list[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareEntity] - :param relations: Required. Healthcare entity relations. - :type relations: list[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareRelation] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'entities': {'required': True}, - 'relations': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[HealthcareEntity]'}, - 'relations': {'key': 'relations', 'type': '[HealthcareRelation]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - **kwargs - ): - super(DocumentHealthcareEntities, self).__init__(**kwargs) - self.id = kwargs['id'] - self.entities = kwargs['entities'] - self.relations = kwargs['relations'] - self.warnings = kwargs['warnings'] - self.statistics = kwargs.get('statistics', None) - - -class DocumentKeyPhrases(msrest.serialization.Model): - """DocumentKeyPhrases. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param key_phrases: Required. A list of representative words or phrases. The number of key - phrases returned is proportional to the number of words in the input document. - :type key_phrases: list[str] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'key_phrases': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - **kwargs - ): - super(DocumentKeyPhrases, self).__init__(**kwargs) - self.id = kwargs['id'] - self.key_phrases = kwargs['key_phrases'] - self.warnings = kwargs['warnings'] - self.statistics = kwargs.get('statistics', None) - - -class DocumentLanguage(msrest.serialization.Model): - """DocumentLanguage. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param detected_language: Required. Detected Language. - :type detected_language: ~azure.ai.textanalytics.v3_1_preview_3.models.DetectedLanguage - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'detected_language': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'detected_language': {'key': 'detectedLanguage', 'type': 'DetectedLanguage'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - **kwargs - ): - super(DocumentLanguage, self).__init__(**kwargs) - self.id = kwargs['id'] - self.detected_language = kwargs['detected_language'] - self.warnings = kwargs['warnings'] - self.statistics = kwargs.get('statistics', None) - - -class DocumentLinkedEntities(msrest.serialization.Model): - """DocumentLinkedEntities. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param entities: Required. Recognized well-known entities in the document. - :type entities: list[~azure.ai.textanalytics.v3_1_preview_3.models.LinkedEntity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'entities': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[LinkedEntity]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - **kwargs - ): - super(DocumentLinkedEntities, self).__init__(**kwargs) - self.id = kwargs['id'] - self.entities = kwargs['entities'] - self.warnings = kwargs['warnings'] - self.statistics = kwargs.get('statistics', None) - - -class DocumentSentiment(msrest.serialization.Model): - """DocumentSentiment. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param sentiment: Required. Predicted sentiment for document (Negative, Neutral, Positive, or - Mixed). Possible values include: "positive", "neutral", "negative", "mixed". - :type sentiment: str or ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentSentimentValue - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - :param confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 - for each sentiment class. - :type confidence_scores: - ~azure.ai.textanalytics.v3_1_preview_3.models.SentimentConfidenceScorePerLabel - :param sentences: Required. Sentence level sentiment analysis. - :type sentences: list[~azure.ai.textanalytics.v3_1_preview_3.models.SentenceSentiment] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - """ - - _validation = { - 'id': {'required': True}, - 'sentiment': {'required': True}, - 'confidence_scores': {'required': True}, - 'sentences': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'sentiment': {'key': 'sentiment', 'type': 'str'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - 'confidence_scores': {'key': 'confidenceScores', 'type': 'SentimentConfidenceScorePerLabel'}, - 'sentences': {'key': 'sentences', 'type': '[SentenceSentiment]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - } - - def __init__( - self, - **kwargs - ): - super(DocumentSentiment, self).__init__(**kwargs) - self.id = kwargs['id'] - self.sentiment = kwargs['sentiment'] - self.statistics = kwargs.get('statistics', None) - self.confidence_scores = kwargs['confidence_scores'] - self.sentences = kwargs['sentences'] - self.warnings = kwargs['warnings'] - - -class DocumentStatistics(msrest.serialization.Model): - """if showStats=true was specified in the request this field will contain information about the document payload. - - All required parameters must be populated in order to send to Azure. - - :param characters_count: Required. Number of text elements recognized in the document. - :type characters_count: int - :param transactions_count: Required. Number of transactions for the document. - :type transactions_count: int - """ - - _validation = { - 'characters_count': {'required': True}, - 'transactions_count': {'required': True}, - } - - _attribute_map = { - 'characters_count': {'key': 'charactersCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(DocumentStatistics, self).__init__(**kwargs) - self.characters_count = kwargs['characters_count'] - self.transactions_count = kwargs['transactions_count'] - - -class EntitiesResult(msrest.serialization.Model): - """EntitiesResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentEntities]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EntitiesResult, self).__init__(**kwargs) - self.documents = kwargs['documents'] - self.errors = kwargs['errors'] - self.statistics = kwargs.get('statistics', None) - self.model_version = kwargs['model_version'] - - -class EntitiesTask(msrest.serialization.Model): - """EntitiesTask. - - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesTaskParameters - """ - - _attribute_map = { - 'parameters': {'key': 'parameters', 'type': 'EntitiesTaskParameters'}, - } - - def __init__( - self, - **kwargs - ): - super(EntitiesTask, self).__init__(**kwargs) - self.parameters = kwargs.get('parameters', None) - - -class EntitiesTaskParameters(msrest.serialization.Model): - """EntitiesTaskParameters. - - :param model_version: - :type model_version: str - :param string_index_type: Possible values include: "TextElements_v8", "UnicodeCodePoint", - "Utf16CodeUnit". Default value: "TextElements_v8". - :type string_index_type: str or - ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexTypeResponse - """ - - _attribute_map = { - 'model_version': {'key': 'model-version', 'type': 'str'}, - 'string_index_type': {'key': 'stringIndexType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EntitiesTaskParameters, self).__init__(**kwargs) - self.model_version = kwargs.get('model_version', "latest") - self.string_index_type = kwargs.get('string_index_type', "TextElements_v8") - - -class Entity(msrest.serialization.Model): - """Entity. - - All required parameters must be populated in order to send to Azure. - - :param text: Required. Entity text as appears in the request. - :type text: str - :param category: Required. Entity type. - :type category: str - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' - values can affect the offset returned. - :type offset: int - :param length: Required. Length for the entity text. Use of different 'stringIndexType' values - can affect the length returned. - :type length: int - :param confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. - :type confidence_score: float - """ - - _validation = { - 'text': {'required': True}, - 'category': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - 'confidence_score': {'required': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'subcategory': {'key': 'subcategory', 'type': 'str'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(Entity, self).__init__(**kwargs) - self.text = kwargs['text'] - self.category = kwargs['category'] - self.subcategory = kwargs.get('subcategory', None) - self.offset = kwargs['offset'] - self.length = kwargs['length'] - self.confidence_score = kwargs['confidence_score'] - - -class EntityLinkingResult(msrest.serialization.Model): - """EntityLinkingResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentLinkedEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentLinkedEntities]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EntityLinkingResult, self).__init__(**kwargs) - self.documents = kwargs['documents'] - self.errors = kwargs['errors'] - self.statistics = kwargs.get('statistics', None) - self.model_version = kwargs['model_version'] - - -class ErrorResponse(msrest.serialization.Model): - """ErrorResponse. - - All required parameters must be populated in order to send to Azure. - - :param error: Required. Document Error. - :type error: ~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsError - """ - - _validation = { - 'error': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'TextAnalyticsError'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs['error'] - - -class HealthcareEntity(Entity): - """HealthcareEntity. - - All required parameters must be populated in order to send to Azure. - - :param text: Required. Entity text as appears in the request. - :type text: str - :param category: Required. Entity type. - :type category: str - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' - values can affect the offset returned. - :type offset: int - :param length: Required. Length for the entity text. Use of different 'stringIndexType' values - can affect the length returned. - :type length: int - :param confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. - :type confidence_score: float - :param is_negated: Required. - :type is_negated: bool - :param links: Entity references in known data sources. - :type links: list[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareEntityLink] - """ - - _validation = { - 'text': {'required': True}, - 'category': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - 'confidence_score': {'required': True}, - 'is_negated': {'required': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'subcategory': {'key': 'subcategory', 'type': 'str'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, - 'is_negated': {'key': 'isNegated', 'type': 'bool'}, - 'links': {'key': 'links', 'type': '[HealthcareEntityLink]'}, - } - - def __init__( - self, - **kwargs - ): - super(HealthcareEntity, self).__init__(**kwargs) - self.is_negated = kwargs['is_negated'] - self.links = kwargs.get('links', None) - - -class HealthcareEntityLink(msrest.serialization.Model): - """HealthcareEntityLink. - - All required parameters must be populated in order to send to Azure. - - :param data_source: Required. Entity Catalog. Examples include: UMLS, CHV, MSH, etc. - :type data_source: str - :param id: Required. Entity id in the given source catalog. - :type id: str - """ - - _validation = { - 'data_source': {'required': True}, - 'id': {'required': True}, - } - - _attribute_map = { - 'data_source': {'key': 'dataSource', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HealthcareEntityLink, self).__init__(**kwargs) - self.data_source = kwargs['data_source'] - self.id = kwargs['id'] - - -class HealthcareJobState(JobMetadata, Pagination): - """HealthcareJobState. - - All required parameters must be populated in order to send to Azure. - - :param next_link: - :type next_link: str - :param created_date_time: Required. - :type created_date_time: ~datetime.datetime - :param expiration_date_time: - :type expiration_date_time: ~datetime.datetime - :param job_id: Required. - :type job_id: str - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - :param results: - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareResult - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsError] - """ - - _validation = { - 'created_date_time': {'required': True}, - 'job_id': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'next_link': {'key': '@nextLink', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'results': {'key': 'results', 'type': 'HealthcareResult'}, - 'errors': {'key': 'errors', 'type': '[TextAnalyticsError]'}, - } - - def __init__( - self, - **kwargs - ): - super(HealthcareJobState, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.results = kwargs.get('results', None) - self.errors = kwargs.get('errors', None) - self.created_date_time = kwargs['created_date_time'] - self.expiration_date_time = kwargs.get('expiration_date_time', None) - self.job_id = kwargs['job_id'] - self.last_update_date_time = kwargs['last_update_date_time'] - self.status = kwargs['status'] - self.results = kwargs.get('results', None) - self.errors = kwargs.get('errors', None) - - -class HealthcareRelation(msrest.serialization.Model): - """HealthcareRelation. - - All required parameters must be populated in order to send to Azure. - - :param relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or - 'FrequencyOfMedication', etc. - :type relation_type: str - :param bidirectional: Required. If true the relation between the entities is bidirectional, - otherwise directionality is source to target. - :type bidirectional: bool - :param source: Required. Reference link to the source entity. - :type source: str - :param target: Required. Reference link to the target entity. - :type target: str - """ - - _validation = { - 'relation_type': {'required': True}, - 'bidirectional': {'required': True}, - 'source': {'required': True}, - 'target': {'required': True}, - } - - _attribute_map = { - 'relation_type': {'key': 'relationType', 'type': 'str'}, - 'bidirectional': {'key': 'bidirectional', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HealthcareRelation, self).__init__(**kwargs) - self.relation_type = kwargs['relation_type'] - self.bidirectional = kwargs['bidirectional'] - self.source = kwargs['source'] - self.target = kwargs['target'] - - -class HealthcareResult(msrest.serialization.Model): - """HealthcareResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentHealthcareEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentHealthcareEntities]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HealthcareResult, self).__init__(**kwargs) - self.documents = kwargs['documents'] - self.errors = kwargs['errors'] - self.statistics = kwargs.get('statistics', None) - self.model_version = kwargs['model_version'] - - -class InnerError(msrest.serialization.Model): - """InnerError. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Error code. Possible values include: "InvalidParameterValue", - "InvalidRequestBodyFormat", "EmptyRequest", "MissingInputRecords", "InvalidDocument", - "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", - "InvalidCountryHint". - :type code: str or ~azure.ai.textanalytics.v3_1_preview_3.models.InnerErrorCodeValue - :param message: Required. Error message. - :type message: str - :param details: Error details. - :type details: dict[str, str] - :param target: Error target. - :type target: str - :param innererror: Inner error contains more specific information. - :type innererror: ~azure.ai.textanalytics.v3_1_preview_3.models.InnerError - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '{str}'}, - 'target': {'key': 'target', 'type': 'str'}, - 'innererror': {'key': 'innererror', 'type': 'InnerError'}, - } - - def __init__( - self, - **kwargs - ): - super(InnerError, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - self.details = kwargs.get('details', None) - self.target = kwargs.get('target', None) - self.innererror = kwargs.get('innererror', None) - - -class JobManifestTasks(msrest.serialization.Model): - """The set of tasks to execute on the input documents. Cannot specify the same task more than once. - - :param entity_recognition_tasks: - :type entity_recognition_tasks: - list[~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesTask] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_1_preview_3.models.PiiTask] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: - list[~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhrasesTask] - """ - - _attribute_map = { - 'entity_recognition_tasks': {'key': 'entityRecognitionTasks', 'type': '[EntitiesTask]'}, - 'entity_recognition_pii_tasks': {'key': 'entityRecognitionPiiTasks', 'type': '[PiiTask]'}, - 'key_phrase_extraction_tasks': {'key': 'keyPhraseExtractionTasks', 'type': '[KeyPhrasesTask]'}, - } - - def __init__( - self, - **kwargs - ): - super(JobManifestTasks, self).__init__(**kwargs) - self.entity_recognition_tasks = kwargs.get('entity_recognition_tasks', None) - self.entity_recognition_pii_tasks = kwargs.get('entity_recognition_pii_tasks', None) - self.key_phrase_extraction_tasks = kwargs.get('key_phrase_extraction_tasks', None) - - -class KeyPhraseResult(msrest.serialization.Model): - """KeyPhraseResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentKeyPhrases] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentKeyPhrases]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(KeyPhraseResult, self).__init__(**kwargs) - self.documents = kwargs['documents'] - self.errors = kwargs['errors'] - self.statistics = kwargs.get('statistics', None) - self.model_version = kwargs['model_version'] - - -class KeyPhrasesTask(msrest.serialization.Model): - """KeyPhrasesTask. - - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhrasesTaskParameters - """ - - _attribute_map = { - 'parameters': {'key': 'parameters', 'type': 'KeyPhrasesTaskParameters'}, - } - - def __init__( - self, - **kwargs - ): - super(KeyPhrasesTask, self).__init__(**kwargs) - self.parameters = kwargs.get('parameters', None) - - -class KeyPhrasesTaskParameters(msrest.serialization.Model): - """KeyPhrasesTaskParameters. - - :param model_version: - :type model_version: str - """ - - _attribute_map = { - 'model_version': {'key': 'model-version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(KeyPhrasesTaskParameters, self).__init__(**kwargs) - self.model_version = kwargs.get('model_version', "latest") - - -class LanguageBatchInput(msrest.serialization.Model): - """LanguageBatchInput. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.LanguageInput] - """ - - _validation = { - 'documents': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[LanguageInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(LanguageBatchInput, self).__init__(**kwargs) - self.documents = kwargs['documents'] - - -class LanguageInput(msrest.serialization.Model): - """LanguageInput. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param text: Required. - :type text: str - :param country_hint: - :type country_hint: str - """ - - _validation = { - 'id': {'required': True}, - 'text': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - 'country_hint': {'key': 'countryHint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LanguageInput, self).__init__(**kwargs) - self.id = kwargs['id'] - self.text = kwargs['text'] - self.country_hint = kwargs.get('country_hint', None) - - -class LanguageResult(msrest.serialization.Model): - """LanguageResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentLanguage] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentLanguage]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LanguageResult, self).__init__(**kwargs) - self.documents = kwargs['documents'] - self.errors = kwargs['errors'] - self.statistics = kwargs.get('statistics', None) - self.model_version = kwargs['model_version'] - - -class LinkedEntity(msrest.serialization.Model): - """LinkedEntity. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Entity Linking formal name. - :type name: str - :param matches: Required. List of instances this entity appears in the text. - :type matches: list[~azure.ai.textanalytics.v3_1_preview_3.models.Match] - :param language: Required. Language used in the data source. - :type language: str - :param id: Unique identifier of the recognized entity from the data source. - :type id: str - :param url: Required. URL for the entity's page from the data source. - :type url: str - :param data_source: Required. Data source used to extract entity linking, such as Wiki/Bing - etc. - :type data_source: str - :param bing_id: Bing Entity Search API unique identifier of the recognized entity. - :type bing_id: str - """ - - _validation = { - 'name': {'required': True}, - 'matches': {'required': True}, - 'language': {'required': True}, - 'url': {'required': True}, - 'data_source': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'matches': {'key': 'matches', 'type': '[Match]'}, - 'language': {'key': 'language', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'data_source': {'key': 'dataSource', 'type': 'str'}, - 'bing_id': {'key': 'bingId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LinkedEntity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.matches = kwargs['matches'] - self.language = kwargs['language'] - self.id = kwargs.get('id', None) - self.url = kwargs['url'] - self.data_source = kwargs['data_source'] - self.bing_id = kwargs.get('bing_id', None) - - -class Match(msrest.serialization.Model): - """Match. - - All required parameters must be populated in order to send to Azure. - - :param confidence_score: Required. If a well-known item is recognized, a decimal number - denoting the confidence level between 0 and 1 will be returned. - :type confidence_score: float - :param text: Required. Entity text as appears in the request. - :type text: str - :param offset: Required. Start position for the entity match text. - :type offset: int - :param length: Required. Length for the entity match text. - :type length: int - """ - - _validation = { - 'confidence_score': {'required': True}, - 'text': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - } - - _attribute_map = { - 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, - 'text': {'key': 'text', 'type': 'str'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(Match, self).__init__(**kwargs) - self.confidence_score = kwargs['confidence_score'] - self.text = kwargs['text'] - self.offset = kwargs['offset'] - self.length = kwargs['length'] - - -class MultiLanguageBatchInput(msrest.serialization.Model): - """Contains a set of input documents to be analyzed by the service. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - """ - - _validation = { - 'documents': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(MultiLanguageBatchInput, self).__init__(**kwargs) - self.documents = kwargs['documents'] - - -class MultiLanguageInput(msrest.serialization.Model): - """Contains an input document to be analyzed by the service. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. A unique, non-empty document identifier. - :type id: str - :param text: Required. The input text to process. - :type text: str - :param language: (Optional) This is the 2 letter ISO 639-1 representation of a language. For - example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as - default. - :type language: str - """ - - _validation = { - 'id': {'required': True}, - 'text': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MultiLanguageInput, self).__init__(**kwargs) - self.id = kwargs['id'] - self.text = kwargs['text'] - self.language = kwargs.get('language', None) - - -class PiiDocumentEntities(msrest.serialization.Model): - """PiiDocumentEntities. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param redacted_text: Required. Returns redacted text. - :type redacted_text: str - :param entities: Required. Recognized entities in the document. - :type entities: list[~azure.ai.textanalytics.v3_1_preview_3.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'redacted_text': {'required': True}, - 'entities': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'redacted_text': {'key': 'redactedText', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[Entity]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - **kwargs - ): - super(PiiDocumentEntities, self).__init__(**kwargs) - self.id = kwargs['id'] - self.redacted_text = kwargs['redacted_text'] - self.entities = kwargs['entities'] - self.warnings = kwargs['warnings'] - self.statistics = kwargs.get('statistics', None) - - -class PiiResult(msrest.serialization.Model): - """PiiResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.PiiDocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[PiiDocumentEntities]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PiiResult, self).__init__(**kwargs) - self.documents = kwargs['documents'] - self.errors = kwargs['errors'] - self.statistics = kwargs.get('statistics', None) - self.model_version = kwargs['model_version'] - - -class PiiTask(msrest.serialization.Model): - """PiiTask. - - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiTaskParameters - """ - - _attribute_map = { - 'parameters': {'key': 'parameters', 'type': 'PiiTaskParameters'}, - } - - def __init__( - self, - **kwargs - ): - super(PiiTask, self).__init__(**kwargs) - self.parameters = kwargs.get('parameters', None) - - -class PiiTaskParameters(msrest.serialization.Model): - """PiiTaskParameters. - - :param domain: Possible values include: "phi", "none". Default value: "none". - :type domain: str or ~azure.ai.textanalytics.v3_1_preview_3.models.PiiTaskParametersDomain - :param model_version: - :type model_version: str - :param string_index_type: Possible values include: "TextElements_v8", "UnicodeCodePoint", - "Utf16CodeUnit". Default value: "TextElements_v8". - :type string_index_type: str or - ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexTypeResponse - """ - - _attribute_map = { - 'domain': {'key': 'domain', 'type': 'str'}, - 'model_version': {'key': 'model-version', 'type': 'str'}, - 'string_index_type': {'key': 'stringIndexType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PiiTaskParameters, self).__init__(**kwargs) - self.domain = kwargs.get('domain', "none") - self.model_version = kwargs.get('model_version', "latest") - self.string_index_type = kwargs.get('string_index_type', "TextElements_v8") - - -class RequestStatistics(msrest.serialization.Model): - """if showStats=true was specified in the request this field will contain information about the request payload. - - All required parameters must be populated in order to send to Azure. - - :param documents_count: Required. Number of documents submitted in the request. - :type documents_count: int - :param valid_documents_count: Required. Number of valid documents. This excludes empty, over- - size limit or non-supported languages documents. - :type valid_documents_count: int - :param erroneous_documents_count: Required. Number of invalid documents. This includes empty, - over-size limit or non-supported languages documents. - :type erroneous_documents_count: int - :param transactions_count: Required. Number of transactions for the request. - :type transactions_count: long - """ - - _validation = { - 'documents_count': {'required': True}, - 'valid_documents_count': {'required': True}, - 'erroneous_documents_count': {'required': True}, - 'transactions_count': {'required': True}, - } - - _attribute_map = { - 'documents_count': {'key': 'documentsCount', 'type': 'int'}, - 'valid_documents_count': {'key': 'validDocumentsCount', 'type': 'int'}, - 'erroneous_documents_count': {'key': 'erroneousDocumentsCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(RequestStatistics, self).__init__(**kwargs) - self.documents_count = kwargs['documents_count'] - self.valid_documents_count = kwargs['valid_documents_count'] - self.erroneous_documents_count = kwargs['erroneous_documents_count'] - self.transactions_count = kwargs['transactions_count'] - - -class SentenceAspect(msrest.serialization.Model): - """SentenceAspect. - - All required parameters must be populated in order to send to Azure. - - :param sentiment: Required. Aspect level sentiment for the aspect in the sentence. Possible - values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1_preview_3.models.TokenSentimentValue - :param confidence_scores: Required. Aspect level sentiment confidence scores for the aspect in - the sentence. - :type confidence_scores: - ~azure.ai.textanalytics.v3_1_preview_3.models.AspectConfidenceScoreLabel - :param offset: Required. The aspect offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the aspect. - :type length: int - :param text: Required. The aspect text detected. - :type text: str - :param relations: Required. The array of either opinion or aspect object which is related to - the aspect. - :type relations: list[~azure.ai.textanalytics.v3_1_preview_3.models.AspectRelation] - """ - - _validation = { - 'sentiment': {'required': True}, - 'confidence_scores': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - 'text': {'required': True}, - 'relations': {'required': True}, - } - - _attribute_map = { - 'sentiment': {'key': 'sentiment', 'type': 'str'}, - 'confidence_scores': {'key': 'confidenceScores', 'type': 'AspectConfidenceScoreLabel'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - 'text': {'key': 'text', 'type': 'str'}, - 'relations': {'key': 'relations', 'type': '[AspectRelation]'}, - } - - def __init__( - self, - **kwargs - ): - super(SentenceAspect, self).__init__(**kwargs) - self.sentiment = kwargs['sentiment'] - self.confidence_scores = kwargs['confidence_scores'] - self.offset = kwargs['offset'] - self.length = kwargs['length'] - self.text = kwargs['text'] - self.relations = kwargs['relations'] - - -class SentenceOpinion(msrest.serialization.Model): - """SentenceOpinion. - - All required parameters must be populated in order to send to Azure. - - :param sentiment: Required. Opinion level sentiment for the aspect in the sentence. Possible - values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1_preview_3.models.TokenSentimentValue - :param confidence_scores: Required. Opinion level sentiment confidence scores for the aspect in - the sentence. - :type confidence_scores: - ~azure.ai.textanalytics.v3_1_preview_3.models.AspectConfidenceScoreLabel - :param offset: Required. The opinion offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the opinion. - :type length: int - :param text: Required. The aspect text detected. - :type text: str - :param is_negated: Required. The indicator representing if the opinion is negated. - :type is_negated: bool - """ - - _validation = { - 'sentiment': {'required': True}, - 'confidence_scores': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - 'text': {'required': True}, - 'is_negated': {'required': True}, - } - - _attribute_map = { - 'sentiment': {'key': 'sentiment', 'type': 'str'}, - 'confidence_scores': {'key': 'confidenceScores', 'type': 'AspectConfidenceScoreLabel'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - 'text': {'key': 'text', 'type': 'str'}, - 'is_negated': {'key': 'isNegated', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(SentenceOpinion, self).__init__(**kwargs) - self.sentiment = kwargs['sentiment'] - self.confidence_scores = kwargs['confidence_scores'] - self.offset = kwargs['offset'] - self.length = kwargs['length'] - self.text = kwargs['text'] - self.is_negated = kwargs['is_negated'] - - -class SentenceSentiment(msrest.serialization.Model): - """SentenceSentiment. - - All required parameters must be populated in order to send to Azure. - - :param text: Required. The sentence text. - :type text: str - :param sentiment: Required. The predicted Sentiment for the sentence. Possible values include: - "positive", "neutral", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1_preview_3.models.SentenceSentimentValue - :param confidence_scores: Required. The sentiment confidence score between 0 and 1 for the - sentence for all classes. - :type confidence_scores: - ~azure.ai.textanalytics.v3_1_preview_3.models.SentimentConfidenceScorePerLabel - :param offset: Required. The sentence offset from the start of the document. - :type offset: int - :param length: Required. The length of the sentence. - :type length: int - :param aspects: The array of aspect object for the sentence. - :type aspects: list[~azure.ai.textanalytics.v3_1_preview_3.models.SentenceAspect] - :param opinions: The array of opinion object for the sentence. - :type opinions: list[~azure.ai.textanalytics.v3_1_preview_3.models.SentenceOpinion] - """ - - _validation = { - 'text': {'required': True}, - 'sentiment': {'required': True}, - 'confidence_scores': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'sentiment': {'key': 'sentiment', 'type': 'str'}, - 'confidence_scores': {'key': 'confidenceScores', 'type': 'SentimentConfidenceScorePerLabel'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - 'aspects': {'key': 'aspects', 'type': '[SentenceAspect]'}, - 'opinions': {'key': 'opinions', 'type': '[SentenceOpinion]'}, - } - - def __init__( - self, - **kwargs - ): - super(SentenceSentiment, self).__init__(**kwargs) - self.text = kwargs['text'] - self.sentiment = kwargs['sentiment'] - self.confidence_scores = kwargs['confidence_scores'] - self.offset = kwargs['offset'] - self.length = kwargs['length'] - self.aspects = kwargs.get('aspects', None) - self.opinions = kwargs.get('opinions', None) - - -class SentimentConfidenceScorePerLabel(msrest.serialization.Model): - """Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative. - - All required parameters must be populated in order to send to Azure. - - :param positive: Required. - :type positive: float - :param neutral: Required. - :type neutral: float - :param negative: Required. - :type negative: float - """ - - _validation = { - 'positive': {'required': True}, - 'neutral': {'required': True}, - 'negative': {'required': True}, - } - - _attribute_map = { - 'positive': {'key': 'positive', 'type': 'float'}, - 'neutral': {'key': 'neutral', 'type': 'float'}, - 'negative': {'key': 'negative', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(SentimentConfidenceScorePerLabel, self).__init__(**kwargs) - self.positive = kwargs['positive'] - self.neutral = kwargs['neutral'] - self.negative = kwargs['negative'] - - -class SentimentResponse(msrest.serialization.Model): - """SentimentResponse. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Sentiment analysis per document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentSentiment] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentSentiment]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SentimentResponse, self).__init__(**kwargs) - self.documents = kwargs['documents'] - self.errors = kwargs['errors'] - self.statistics = kwargs.get('statistics', None) - self.model_version = kwargs['model_version'] - - -class TasksStateTasks(msrest.serialization.Model): - """TasksStateTasks. - - All required parameters must be populated in order to send to Azure. - - :param details: - :type details: ~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasksDetails - :param completed: Required. - :type completed: int - :param failed: Required. - :type failed: int - :param in_progress: Required. - :type in_progress: int - :param total: Required. - :type total: int - :param entity_recognition_tasks: - :type entity_recognition_tasks: - list[~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasksEntityRecognitionTasksItem] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: - list[~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasksEntityRecognitionPiiTasksItem] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: - list[~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasksKeyPhraseExtractionTasksItem] - """ - - _validation = { - 'completed': {'required': True}, - 'failed': {'required': True}, - 'in_progress': {'required': True}, - 'total': {'required': True}, - } - - _attribute_map = { - 'details': {'key': 'details', 'type': 'TasksStateTasksDetails'}, - 'completed': {'key': 'completed', 'type': 'int'}, - 'failed': {'key': 'failed', 'type': 'int'}, - 'in_progress': {'key': 'inProgress', 'type': 'int'}, - 'total': {'key': 'total', 'type': 'int'}, - 'entity_recognition_tasks': {'key': 'entityRecognitionTasks', 'type': '[TasksStateTasksEntityRecognitionTasksItem]'}, - 'entity_recognition_pii_tasks': {'key': 'entityRecognitionPiiTasks', 'type': '[TasksStateTasksEntityRecognitionPiiTasksItem]'}, - 'key_phrase_extraction_tasks': {'key': 'keyPhraseExtractionTasks', 'type': '[TasksStateTasksKeyPhraseExtractionTasksItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(TasksStateTasks, self).__init__(**kwargs) - self.details = kwargs.get('details', None) - self.completed = kwargs['completed'] - self.failed = kwargs['failed'] - self.in_progress = kwargs['in_progress'] - self.total = kwargs['total'] - self.entity_recognition_tasks = kwargs.get('entity_recognition_tasks', None) - self.entity_recognition_pii_tasks = kwargs.get('entity_recognition_pii_tasks', None) - self.key_phrase_extraction_tasks = kwargs.get('key_phrase_extraction_tasks', None) - - -class TaskState(msrest.serialization.Model): - """TaskState. - - All required parameters must be populated in order to send to Azure. - - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param name: - :type name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TaskState, self).__init__(**kwargs) - self.last_update_date_time = kwargs['last_update_date_time'] - self.name = kwargs.get('name', None) - self.status = kwargs['status'] - - -class TasksStateTasksDetails(TaskState): - """TasksStateTasksDetails. - - All required parameters must be populated in order to send to Azure. - - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param name: - :type name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TasksStateTasksDetails, self).__init__(**kwargs) - - -class TasksStateTasksEntityRecognitionPiiTasksItem(TaskState, Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1): - """TasksStateTasksEntityRecognitionPiiTasksItem. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param name: - :type name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'results': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'PiiResult'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TasksStateTasksEntityRecognitionPiiTasksItem, self).__init__(**kwargs) - self.results = kwargs['results'] - self.last_update_date_time = kwargs['last_update_date_time'] - self.name = kwargs.get('name', None) - self.status = kwargs['status'] - - -class TasksStateTasksEntityRecognitionTasksItem(TaskState, Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1): - """TasksStateTasksEntityRecognitionTasksItem. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param name: - :type name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'results': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'EntitiesResult'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TasksStateTasksEntityRecognitionTasksItem, self).__init__(**kwargs) - self.results = kwargs['results'] - self.last_update_date_time = kwargs['last_update_date_time'] - self.name = kwargs.get('name', None) - self.status = kwargs['status'] - - -class TasksStateTasksKeyPhraseExtractionTasksItem(TaskState, Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1): - """TasksStateTasksKeyPhraseExtractionTasksItem. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhraseResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param name: - :type name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'results': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'KeyPhraseResult'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TasksStateTasksKeyPhraseExtractionTasksItem, self).__init__(**kwargs) - self.results = kwargs['results'] - self.last_update_date_time = kwargs['last_update_date_time'] - self.name = kwargs.get('name', None) - self.status = kwargs['status'] - - -class TextAnalyticsError(msrest.serialization.Model): - """TextAnalyticsError. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Error code. Possible values include: "InvalidRequest", - "InvalidArgument", "InternalServerError", "ServiceUnavailable", "NotFound". - :type code: str or ~azure.ai.textanalytics.v3_1_preview_3.models.ErrorCodeValue - :param message: Required. Error message. - :type message: str - :param target: Error target. - :type target: str - :param innererror: Inner error contains more specific information. - :type innererror: ~azure.ai.textanalytics.v3_1_preview_3.models.InnerError - :param details: Details about specific errors that led to this reported error. - :type details: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsError] - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'innererror': {'key': 'innererror', 'type': 'InnerError'}, - 'details': {'key': 'details', 'type': '[TextAnalyticsError]'}, - } - - def __init__( - self, - **kwargs - ): - super(TextAnalyticsError, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - self.target = kwargs.get('target', None) - self.innererror = kwargs.get('innererror', None) - self.details = kwargs.get('details', None) - - -class TextAnalyticsWarning(msrest.serialization.Model): - """TextAnalyticsWarning. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Error code. Possible values include: "LongWordsInDocument", - "DocumentTruncated". - :type code: str or ~azure.ai.textanalytics.v3_1_preview_3.models.WarningCodeValue - :param message: Required. Warning message. - :type message: str - :param target_ref: A JSON pointer reference indicating the target object. - :type target_ref: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target_ref': {'key': 'targetRef', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TextAnalyticsWarning, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - self.target_ref = kwargs.get('target_ref', None) diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/_models_py3.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/_models_py3.py deleted file mode 100644 index 0f8ce3bb049b..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/_models_py3.py +++ /dev/null @@ -1,2660 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._text_analytics_client_enums import * - - -class JobManifest(msrest.serialization.Model): - """JobManifest. - - All required parameters must be populated in order to send to Azure. - - :param tasks: Required. The set of tasks to execute on the input documents. Cannot specify the - same task more than once. - :type tasks: ~azure.ai.textanalytics.v3_1_preview_3.models.JobManifestTasks - """ - - _validation = { - 'tasks': {'required': True}, - } - - _attribute_map = { - 'tasks': {'key': 'tasks', 'type': 'JobManifestTasks'}, - } - - def __init__( - self, - *, - tasks: "JobManifestTasks", - **kwargs - ): - super(JobManifest, self).__init__(**kwargs) - self.tasks = tasks - - -class JobDescriptor(msrest.serialization.Model): - """JobDescriptor. - - :param display_name: Optional display name for the analysis job. - :type display_name: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - **kwargs - ): - super(JobDescriptor, self).__init__(**kwargs) - self.display_name = display_name - - -class AnalyzeBatchInput(JobDescriptor, JobManifest): - """AnalyzeBatchInput. - - All required parameters must be populated in order to send to Azure. - - :param tasks: Required. The set of tasks to execute on the input documents. Cannot specify the - same task more than once. - :type tasks: ~azure.ai.textanalytics.v3_1_preview_3.models.JobManifestTasks - :param display_name: Optional display name for the analysis job. - :type display_name: str - :param analysis_input: Required. Contains a set of input documents to be analyzed by the - service. - :type analysis_input: ~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageBatchInput - """ - - _validation = { - 'tasks': {'required': True}, - 'analysis_input': {'required': True}, - } - - _attribute_map = { - 'tasks': {'key': 'tasks', 'type': 'JobManifestTasks'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'analysis_input': {'key': 'analysisInput', 'type': 'MultiLanguageBatchInput'}, - } - - def __init__( - self, - *, - tasks: "JobManifestTasks", - analysis_input: "MultiLanguageBatchInput", - display_name: Optional[str] = None, - **kwargs - ): - super(AnalyzeBatchInput, self).__init__(display_name=display_name, tasks=tasks, **kwargs) - self.tasks = tasks - self.analysis_input = analysis_input - self.display_name = display_name - self.analysis_input = analysis_input - - -class JobMetadata(msrest.serialization.Model): - """JobMetadata. - - All required parameters must be populated in order to send to Azure. - - :param created_date_time: Required. - :type created_date_time: ~datetime.datetime - :param expiration_date_time: - :type expiration_date_time: ~datetime.datetime - :param job_id: Required. - :type job_id: str - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'created_date_time': {'required': True}, - 'job_id': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - created_date_time: datetime.datetime, - job_id: str, - last_update_date_time: datetime.datetime, - status: Union[str, "State"], - expiration_date_time: Optional[datetime.datetime] = None, - **kwargs - ): - super(JobMetadata, self).__init__(**kwargs) - self.created_date_time = created_date_time - self.expiration_date_time = expiration_date_time - self.job_id = job_id - self.last_update_date_time = last_update_date_time - self.status = status - - -class AnalyzeJobMetadata(JobMetadata): - """AnalyzeJobMetadata. - - All required parameters must be populated in order to send to Azure. - - :param created_date_time: Required. - :type created_date_time: ~datetime.datetime - :param expiration_date_time: - :type expiration_date_time: ~datetime.datetime - :param job_id: Required. - :type job_id: str - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - :param display_name: - :type display_name: str - """ - - _validation = { - 'created_date_time': {'required': True}, - 'job_id': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__( - self, - *, - created_date_time: datetime.datetime, - job_id: str, - last_update_date_time: datetime.datetime, - status: Union[str, "State"], - expiration_date_time: Optional[datetime.datetime] = None, - display_name: Optional[str] = None, - **kwargs - ): - super(AnalyzeJobMetadata, self).__init__(created_date_time=created_date_time, expiration_date_time=expiration_date_time, job_id=job_id, last_update_date_time=last_update_date_time, status=status, **kwargs) - self.display_name = display_name - - -class Pagination(msrest.serialization.Model): - """Pagination. - - :param next_link: - :type next_link: str - """ - - _attribute_map = { - 'next_link': {'key': '@nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(Pagination, self).__init__(**kwargs) - self.next_link = next_link - - -class TasksState(msrest.serialization.Model): - """TasksState. - - All required parameters must be populated in order to send to Azure. - - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasks - """ - - _validation = { - 'tasks': {'required': True}, - } - - _attribute_map = { - 'tasks': {'key': 'tasks', 'type': 'TasksStateTasks'}, - } - - def __init__( - self, - *, - tasks: "TasksStateTasks", - **kwargs - ): - super(TasksState, self).__init__(**kwargs) - self.tasks = tasks - - -class AnalyzeJobState(AnalyzeJobMetadata, TasksState, Pagination): - """AnalyzeJobState. - - All required parameters must be populated in order to send to Azure. - - :param next_link: - :type next_link: str - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasks - :param created_date_time: Required. - :type created_date_time: ~datetime.datetime - :param expiration_date_time: - :type expiration_date_time: ~datetime.datetime - :param job_id: Required. - :type job_id: str - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - :param display_name: - :type display_name: str - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - """ - - _validation = { - 'tasks': {'required': True}, - 'created_date_time': {'required': True}, - 'job_id': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'next_link': {'key': '@nextLink', 'type': 'str'}, - 'tasks': {'key': 'tasks', 'type': 'TasksStateTasks'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[TextAnalyticsError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__( - self, - *, - tasks: "TasksStateTasks", - created_date_time: datetime.datetime, - job_id: str, - last_update_date_time: datetime.datetime, - status: Union[str, "State"], - next_link: Optional[str] = None, - expiration_date_time: Optional[datetime.datetime] = None, - display_name: Optional[str] = None, - errors: Optional[List["TextAnalyticsError"]] = None, - statistics: Optional["RequestStatistics"] = None, - **kwargs - ): - super(AnalyzeJobState, self).__init__(created_date_time=created_date_time, expiration_date_time=expiration_date_time, job_id=job_id, last_update_date_time=last_update_date_time, status=status, display_name=display_name, tasks=tasks, next_link=next_link, **kwargs) - self.next_link = next_link - self.tasks = tasks - self.errors = errors - self.statistics = statistics - self.next_link = next_link - self.created_date_time = created_date_time - self.expiration_date_time = expiration_date_time - self.job_id = job_id - self.last_update_date_time = last_update_date_time - self.status = status - self.display_name = display_name - self.errors = errors - self.statistics = statistics - self.tasks = tasks - self.created_date_time = created_date_time - self.expiration_date_time = expiration_date_time - self.job_id = job_id - self.last_update_date_time = last_update_date_time - self.status = status - self.display_name = display_name - self.errors = errors - self.statistics = statistics - - -class AspectConfidenceScoreLabel(msrest.serialization.Model): - """Represents the confidence scores across all sentiment classes: positive, neutral, negative. - - All required parameters must be populated in order to send to Azure. - - :param positive: Required. - :type positive: float - :param negative: Required. - :type negative: float - """ - - _validation = { - 'positive': {'required': True}, - 'negative': {'required': True}, - } - - _attribute_map = { - 'positive': {'key': 'positive', 'type': 'float'}, - 'negative': {'key': 'negative', 'type': 'float'}, - } - - def __init__( - self, - *, - positive: float, - negative: float, - **kwargs - ): - super(AspectConfidenceScoreLabel, self).__init__(**kwargs) - self.positive = positive - self.negative = negative - - -class AspectRelation(msrest.serialization.Model): - """AspectRelation. - - All required parameters must be populated in order to send to Azure. - - :param relation_type: Required. The type related to the aspect. Possible values include: - "opinion", "aspect". - :type relation_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.AspectRelationType - :param ref: Required. The JSON pointer indicating the linked object. - :type ref: str - """ - - _validation = { - 'relation_type': {'required': True}, - 'ref': {'required': True}, - } - - _attribute_map = { - 'relation_type': {'key': 'relationType', 'type': 'str'}, - 'ref': {'key': 'ref', 'type': 'str'}, - } - - def __init__( - self, - *, - relation_type: Union[str, "AspectRelationType"], - ref: str, - **kwargs - ): - super(AspectRelation, self).__init__(**kwargs) - self.relation_type = relation_type - self.ref = ref - - -class Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1(msrest.serialization.Model): - """Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesResult - """ - - _validation = { - 'results': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'EntitiesResult'}, - } - - def __init__( - self, - *, - results: "EntitiesResult", - **kwargs - ): - super(Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1, self).__init__(**kwargs) - self.results = results - - -class Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1(msrest.serialization.Model): - """Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiResult - """ - - _validation = { - 'results': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'PiiResult'}, - } - - def __init__( - self, - *, - results: "PiiResult", - **kwargs - ): - super(Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1, self).__init__(**kwargs) - self.results = results - - -class Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1(msrest.serialization.Model): - """Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhraseResult - """ - - _validation = { - 'results': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'KeyPhraseResult'}, - } - - def __init__( - self, - *, - results: "KeyPhraseResult", - **kwargs - ): - super(Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1, self).__init__(**kwargs) - self.results = results - - -class DetectedLanguage(msrest.serialization.Model): - """DetectedLanguage. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Long name of a detected language (e.g. English, French). - :type name: str - :param iso6391_name: Required. A two letter representation of the detected language according - to the ISO 639-1 standard (e.g. en, fr). - :type iso6391_name: str - :param confidence_score: Required. A confidence score between 0 and 1. Scores close to 1 - indicate 100% certainty that the identified language is true. - :type confidence_score: float - """ - - _validation = { - 'name': {'required': True}, - 'iso6391_name': {'required': True}, - 'confidence_score': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, - 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, - } - - def __init__( - self, - *, - name: str, - iso6391_name: str, - confidence_score: float, - **kwargs - ): - super(DetectedLanguage, self).__init__(**kwargs) - self.name = name - self.iso6391_name = iso6391_name - self.confidence_score = confidence_score - - -class DocumentEntities(msrest.serialization.Model): - """DocumentEntities. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param entities: Required. Recognized entities in the document. - :type entities: list[~azure.ai.textanalytics.v3_1_preview_3.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'entities': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[Entity]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - *, - id: str, - entities: List["Entity"], - warnings: List["TextAnalyticsWarning"], - statistics: Optional["DocumentStatistics"] = None, - **kwargs - ): - super(DocumentEntities, self).__init__(**kwargs) - self.id = id - self.entities = entities - self.warnings = warnings - self.statistics = statistics - - -class DocumentError(msrest.serialization.Model): - """DocumentError. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Document Id. - :type id: str - :param error: Required. Document Error. - :type error: ~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsError - """ - - _validation = { - 'id': {'required': True}, - 'error': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'TextAnalyticsError'}, - } - - def __init__( - self, - *, - id: str, - error: "TextAnalyticsError", - **kwargs - ): - super(DocumentError, self).__init__(**kwargs) - self.id = id - self.error = error - - -class DocumentHealthcareEntities(msrest.serialization.Model): - """DocumentHealthcareEntities. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param entities: Required. Healthcare entities. - :type entities: list[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareEntity] - :param relations: Required. Healthcare entity relations. - :type relations: list[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareRelation] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'entities': {'required': True}, - 'relations': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[HealthcareEntity]'}, - 'relations': {'key': 'relations', 'type': '[HealthcareRelation]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - *, - id: str, - entities: List["HealthcareEntity"], - relations: List["HealthcareRelation"], - warnings: List["TextAnalyticsWarning"], - statistics: Optional["DocumentStatistics"] = None, - **kwargs - ): - super(DocumentHealthcareEntities, self).__init__(**kwargs) - self.id = id - self.entities = entities - self.relations = relations - self.warnings = warnings - self.statistics = statistics - - -class DocumentKeyPhrases(msrest.serialization.Model): - """DocumentKeyPhrases. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param key_phrases: Required. A list of representative words or phrases. The number of key - phrases returned is proportional to the number of words in the input document. - :type key_phrases: list[str] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'key_phrases': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - *, - id: str, - key_phrases: List[str], - warnings: List["TextAnalyticsWarning"], - statistics: Optional["DocumentStatistics"] = None, - **kwargs - ): - super(DocumentKeyPhrases, self).__init__(**kwargs) - self.id = id - self.key_phrases = key_phrases - self.warnings = warnings - self.statistics = statistics - - -class DocumentLanguage(msrest.serialization.Model): - """DocumentLanguage. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param detected_language: Required. Detected Language. - :type detected_language: ~azure.ai.textanalytics.v3_1_preview_3.models.DetectedLanguage - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'detected_language': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'detected_language': {'key': 'detectedLanguage', 'type': 'DetectedLanguage'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - *, - id: str, - detected_language: "DetectedLanguage", - warnings: List["TextAnalyticsWarning"], - statistics: Optional["DocumentStatistics"] = None, - **kwargs - ): - super(DocumentLanguage, self).__init__(**kwargs) - self.id = id - self.detected_language = detected_language - self.warnings = warnings - self.statistics = statistics - - -class DocumentLinkedEntities(msrest.serialization.Model): - """DocumentLinkedEntities. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param entities: Required. Recognized well-known entities in the document. - :type entities: list[~azure.ai.textanalytics.v3_1_preview_3.models.LinkedEntity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'entities': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[LinkedEntity]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - *, - id: str, - entities: List["LinkedEntity"], - warnings: List["TextAnalyticsWarning"], - statistics: Optional["DocumentStatistics"] = None, - **kwargs - ): - super(DocumentLinkedEntities, self).__init__(**kwargs) - self.id = id - self.entities = entities - self.warnings = warnings - self.statistics = statistics - - -class DocumentSentiment(msrest.serialization.Model): - """DocumentSentiment. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param sentiment: Required. Predicted sentiment for document (Negative, Neutral, Positive, or - Mixed). Possible values include: "positive", "neutral", "negative", "mixed". - :type sentiment: str or ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentSentimentValue - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - :param confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 - for each sentiment class. - :type confidence_scores: - ~azure.ai.textanalytics.v3_1_preview_3.models.SentimentConfidenceScorePerLabel - :param sentences: Required. Sentence level sentiment analysis. - :type sentences: list[~azure.ai.textanalytics.v3_1_preview_3.models.SentenceSentiment] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - """ - - _validation = { - 'id': {'required': True}, - 'sentiment': {'required': True}, - 'confidence_scores': {'required': True}, - 'sentences': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'sentiment': {'key': 'sentiment', 'type': 'str'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - 'confidence_scores': {'key': 'confidenceScores', 'type': 'SentimentConfidenceScorePerLabel'}, - 'sentences': {'key': 'sentences', 'type': '[SentenceSentiment]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - } - - def __init__( - self, - *, - id: str, - sentiment: Union[str, "DocumentSentimentValue"], - confidence_scores: "SentimentConfidenceScorePerLabel", - sentences: List["SentenceSentiment"], - warnings: List["TextAnalyticsWarning"], - statistics: Optional["DocumentStatistics"] = None, - **kwargs - ): - super(DocumentSentiment, self).__init__(**kwargs) - self.id = id - self.sentiment = sentiment - self.statistics = statistics - self.confidence_scores = confidence_scores - self.sentences = sentences - self.warnings = warnings - - -class DocumentStatistics(msrest.serialization.Model): - """if showStats=true was specified in the request this field will contain information about the document payload. - - All required parameters must be populated in order to send to Azure. - - :param characters_count: Required. Number of text elements recognized in the document. - :type characters_count: int - :param transactions_count: Required. Number of transactions for the document. - :type transactions_count: int - """ - - _validation = { - 'characters_count': {'required': True}, - 'transactions_count': {'required': True}, - } - - _attribute_map = { - 'characters_count': {'key': 'charactersCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'int'}, - } - - def __init__( - self, - *, - characters_count: int, - transactions_count: int, - **kwargs - ): - super(DocumentStatistics, self).__init__(**kwargs) - self.characters_count = characters_count - self.transactions_count = transactions_count - - -class EntitiesResult(msrest.serialization.Model): - """EntitiesResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentEntities]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - documents: List["DocumentEntities"], - errors: List["DocumentError"], - model_version: str, - statistics: Optional["RequestStatistics"] = None, - **kwargs - ): - super(EntitiesResult, self).__init__(**kwargs) - self.documents = documents - self.errors = errors - self.statistics = statistics - self.model_version = model_version - - -class EntitiesTask(msrest.serialization.Model): - """EntitiesTask. - - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesTaskParameters - """ - - _attribute_map = { - 'parameters': {'key': 'parameters', 'type': 'EntitiesTaskParameters'}, - } - - def __init__( - self, - *, - parameters: Optional["EntitiesTaskParameters"] = None, - **kwargs - ): - super(EntitiesTask, self).__init__(**kwargs) - self.parameters = parameters - - -class EntitiesTaskParameters(msrest.serialization.Model): - """EntitiesTaskParameters. - - :param model_version: - :type model_version: str - :param string_index_type: Possible values include: "TextElements_v8", "UnicodeCodePoint", - "Utf16CodeUnit". Default value: "TextElements_v8". - :type string_index_type: str or - ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexTypeResponse - """ - - _attribute_map = { - 'model_version': {'key': 'model-version', 'type': 'str'}, - 'string_index_type': {'key': 'stringIndexType', 'type': 'str'}, - } - - def __init__( - self, - *, - model_version: Optional[str] = "latest", - string_index_type: Optional[Union[str, "StringIndexTypeResponse"]] = "TextElements_v8", - **kwargs - ): - super(EntitiesTaskParameters, self).__init__(**kwargs) - self.model_version = model_version - self.string_index_type = string_index_type - - -class Entity(msrest.serialization.Model): - """Entity. - - All required parameters must be populated in order to send to Azure. - - :param text: Required. Entity text as appears in the request. - :type text: str - :param category: Required. Entity type. - :type category: str - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' - values can affect the offset returned. - :type offset: int - :param length: Required. Length for the entity text. Use of different 'stringIndexType' values - can affect the length returned. - :type length: int - :param confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. - :type confidence_score: float - """ - - _validation = { - 'text': {'required': True}, - 'category': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - 'confidence_score': {'required': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'subcategory': {'key': 'subcategory', 'type': 'str'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, - } - - def __init__( - self, - *, - text: str, - category: str, - offset: int, - length: int, - confidence_score: float, - subcategory: Optional[str] = None, - **kwargs - ): - super(Entity, self).__init__(**kwargs) - self.text = text - self.category = category - self.subcategory = subcategory - self.offset = offset - self.length = length - self.confidence_score = confidence_score - - -class EntityLinkingResult(msrest.serialization.Model): - """EntityLinkingResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentLinkedEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentLinkedEntities]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - documents: List["DocumentLinkedEntities"], - errors: List["DocumentError"], - model_version: str, - statistics: Optional["RequestStatistics"] = None, - **kwargs - ): - super(EntityLinkingResult, self).__init__(**kwargs) - self.documents = documents - self.errors = errors - self.statistics = statistics - self.model_version = model_version - - -class ErrorResponse(msrest.serialization.Model): - """ErrorResponse. - - All required parameters must be populated in order to send to Azure. - - :param error: Required. Document Error. - :type error: ~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsError - """ - - _validation = { - 'error': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'TextAnalyticsError'}, - } - - def __init__( - self, - *, - error: "TextAnalyticsError", - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class HealthcareEntity(Entity): - """HealthcareEntity. - - All required parameters must be populated in order to send to Azure. - - :param text: Required. Entity text as appears in the request. - :type text: str - :param category: Required. Entity type. - :type category: str - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' - values can affect the offset returned. - :type offset: int - :param length: Required. Length for the entity text. Use of different 'stringIndexType' values - can affect the length returned. - :type length: int - :param confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. - :type confidence_score: float - :param is_negated: Required. - :type is_negated: bool - :param links: Entity references in known data sources. - :type links: list[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareEntityLink] - """ - - _validation = { - 'text': {'required': True}, - 'category': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - 'confidence_score': {'required': True}, - 'is_negated': {'required': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'subcategory': {'key': 'subcategory', 'type': 'str'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, - 'is_negated': {'key': 'isNegated', 'type': 'bool'}, - 'links': {'key': 'links', 'type': '[HealthcareEntityLink]'}, - } - - def __init__( - self, - *, - text: str, - category: str, - offset: int, - length: int, - confidence_score: float, - is_negated: bool, - subcategory: Optional[str] = None, - links: Optional[List["HealthcareEntityLink"]] = None, - **kwargs - ): - super(HealthcareEntity, self).__init__(text=text, category=category, subcategory=subcategory, offset=offset, length=length, confidence_score=confidence_score, **kwargs) - self.is_negated = is_negated - self.links = links - - -class HealthcareEntityLink(msrest.serialization.Model): - """HealthcareEntityLink. - - All required parameters must be populated in order to send to Azure. - - :param data_source: Required. Entity Catalog. Examples include: UMLS, CHV, MSH, etc. - :type data_source: str - :param id: Required. Entity id in the given source catalog. - :type id: str - """ - - _validation = { - 'data_source': {'required': True}, - 'id': {'required': True}, - } - - _attribute_map = { - 'data_source': {'key': 'dataSource', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - data_source: str, - id: str, - **kwargs - ): - super(HealthcareEntityLink, self).__init__(**kwargs) - self.data_source = data_source - self.id = id - - -class HealthcareJobState(JobMetadata, Pagination): - """HealthcareJobState. - - All required parameters must be populated in order to send to Azure. - - :param next_link: - :type next_link: str - :param created_date_time: Required. - :type created_date_time: ~datetime.datetime - :param expiration_date_time: - :type expiration_date_time: ~datetime.datetime - :param job_id: Required. - :type job_id: str - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - :param results: - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareResult - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsError] - """ - - _validation = { - 'created_date_time': {'required': True}, - 'job_id': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'next_link': {'key': '@nextLink', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'results': {'key': 'results', 'type': 'HealthcareResult'}, - 'errors': {'key': 'errors', 'type': '[TextAnalyticsError]'}, - } - - def __init__( - self, - *, - created_date_time: datetime.datetime, - job_id: str, - last_update_date_time: datetime.datetime, - status: Union[str, "State"], - next_link: Optional[str] = None, - expiration_date_time: Optional[datetime.datetime] = None, - results: Optional["HealthcareResult"] = None, - errors: Optional[List["TextAnalyticsError"]] = None, - **kwargs - ): - super(HealthcareJobState, self).__init__(created_date_time=created_date_time, expiration_date_time=expiration_date_time, job_id=job_id, last_update_date_time=last_update_date_time, status=status, next_link=next_link, **kwargs) - self.next_link = next_link - self.results = results - self.errors = errors - self.created_date_time = created_date_time - self.expiration_date_time = expiration_date_time - self.job_id = job_id - self.last_update_date_time = last_update_date_time - self.status = status - self.results = results - self.errors = errors - - -class HealthcareRelation(msrest.serialization.Model): - """HealthcareRelation. - - All required parameters must be populated in order to send to Azure. - - :param relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or - 'FrequencyOfMedication', etc. - :type relation_type: str - :param bidirectional: Required. If true the relation between the entities is bidirectional, - otherwise directionality is source to target. - :type bidirectional: bool - :param source: Required. Reference link to the source entity. - :type source: str - :param target: Required. Reference link to the target entity. - :type target: str - """ - - _validation = { - 'relation_type': {'required': True}, - 'bidirectional': {'required': True}, - 'source': {'required': True}, - 'target': {'required': True}, - } - - _attribute_map = { - 'relation_type': {'key': 'relationType', 'type': 'str'}, - 'bidirectional': {'key': 'bidirectional', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - *, - relation_type: str, - bidirectional: bool, - source: str, - target: str, - **kwargs - ): - super(HealthcareRelation, self).__init__(**kwargs) - self.relation_type = relation_type - self.bidirectional = bidirectional - self.source = source - self.target = target - - -class HealthcareResult(msrest.serialization.Model): - """HealthcareResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentHealthcareEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentHealthcareEntities]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - documents: List["DocumentHealthcareEntities"], - errors: List["DocumentError"], - model_version: str, - statistics: Optional["RequestStatistics"] = None, - **kwargs - ): - super(HealthcareResult, self).__init__(**kwargs) - self.documents = documents - self.errors = errors - self.statistics = statistics - self.model_version = model_version - - -class InnerError(msrest.serialization.Model): - """InnerError. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Error code. Possible values include: "InvalidParameterValue", - "InvalidRequestBodyFormat", "EmptyRequest", "MissingInputRecords", "InvalidDocument", - "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", - "InvalidCountryHint". - :type code: str or ~azure.ai.textanalytics.v3_1_preview_3.models.InnerErrorCodeValue - :param message: Required. Error message. - :type message: str - :param details: Error details. - :type details: dict[str, str] - :param target: Error target. - :type target: str - :param innererror: Inner error contains more specific information. - :type innererror: ~azure.ai.textanalytics.v3_1_preview_3.models.InnerError - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '{str}'}, - 'target': {'key': 'target', 'type': 'str'}, - 'innererror': {'key': 'innererror', 'type': 'InnerError'}, - } - - def __init__( - self, - *, - code: Union[str, "InnerErrorCodeValue"], - message: str, - details: Optional[Dict[str, str]] = None, - target: Optional[str] = None, - innererror: Optional["InnerError"] = None, - **kwargs - ): - super(InnerError, self).__init__(**kwargs) - self.code = code - self.message = message - self.details = details - self.target = target - self.innererror = innererror - - -class JobManifestTasks(msrest.serialization.Model): - """The set of tasks to execute on the input documents. Cannot specify the same task more than once. - - :param entity_recognition_tasks: - :type entity_recognition_tasks: - list[~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesTask] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_1_preview_3.models.PiiTask] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: - list[~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhrasesTask] - """ - - _attribute_map = { - 'entity_recognition_tasks': {'key': 'entityRecognitionTasks', 'type': '[EntitiesTask]'}, - 'entity_recognition_pii_tasks': {'key': 'entityRecognitionPiiTasks', 'type': '[PiiTask]'}, - 'key_phrase_extraction_tasks': {'key': 'keyPhraseExtractionTasks', 'type': '[KeyPhrasesTask]'}, - } - - def __init__( - self, - *, - entity_recognition_tasks: Optional[List["EntitiesTask"]] = None, - entity_recognition_pii_tasks: Optional[List["PiiTask"]] = None, - key_phrase_extraction_tasks: Optional[List["KeyPhrasesTask"]] = None, - **kwargs - ): - super(JobManifestTasks, self).__init__(**kwargs) - self.entity_recognition_tasks = entity_recognition_tasks - self.entity_recognition_pii_tasks = entity_recognition_pii_tasks - self.key_phrase_extraction_tasks = key_phrase_extraction_tasks - - -class KeyPhraseResult(msrest.serialization.Model): - """KeyPhraseResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentKeyPhrases] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentKeyPhrases]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - documents: List["DocumentKeyPhrases"], - errors: List["DocumentError"], - model_version: str, - statistics: Optional["RequestStatistics"] = None, - **kwargs - ): - super(KeyPhraseResult, self).__init__(**kwargs) - self.documents = documents - self.errors = errors - self.statistics = statistics - self.model_version = model_version - - -class KeyPhrasesTask(msrest.serialization.Model): - """KeyPhrasesTask. - - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhrasesTaskParameters - """ - - _attribute_map = { - 'parameters': {'key': 'parameters', 'type': 'KeyPhrasesTaskParameters'}, - } - - def __init__( - self, - *, - parameters: Optional["KeyPhrasesTaskParameters"] = None, - **kwargs - ): - super(KeyPhrasesTask, self).__init__(**kwargs) - self.parameters = parameters - - -class KeyPhrasesTaskParameters(msrest.serialization.Model): - """KeyPhrasesTaskParameters. - - :param model_version: - :type model_version: str - """ - - _attribute_map = { - 'model_version': {'key': 'model-version', 'type': 'str'}, - } - - def __init__( - self, - *, - model_version: Optional[str] = "latest", - **kwargs - ): - super(KeyPhrasesTaskParameters, self).__init__(**kwargs) - self.model_version = model_version - - -class LanguageBatchInput(msrest.serialization.Model): - """LanguageBatchInput. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.LanguageInput] - """ - - _validation = { - 'documents': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[LanguageInput]'}, - } - - def __init__( - self, - *, - documents: List["LanguageInput"], - **kwargs - ): - super(LanguageBatchInput, self).__init__(**kwargs) - self.documents = documents - - -class LanguageInput(msrest.serialization.Model): - """LanguageInput. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param text: Required. - :type text: str - :param country_hint: - :type country_hint: str - """ - - _validation = { - 'id': {'required': True}, - 'text': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - 'country_hint': {'key': 'countryHint', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - text: str, - country_hint: Optional[str] = None, - **kwargs - ): - super(LanguageInput, self).__init__(**kwargs) - self.id = id - self.text = text - self.country_hint = country_hint - - -class LanguageResult(msrest.serialization.Model): - """LanguageResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentLanguage] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentLanguage]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - documents: List["DocumentLanguage"], - errors: List["DocumentError"], - model_version: str, - statistics: Optional["RequestStatistics"] = None, - **kwargs - ): - super(LanguageResult, self).__init__(**kwargs) - self.documents = documents - self.errors = errors - self.statistics = statistics - self.model_version = model_version - - -class LinkedEntity(msrest.serialization.Model): - """LinkedEntity. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Entity Linking formal name. - :type name: str - :param matches: Required. List of instances this entity appears in the text. - :type matches: list[~azure.ai.textanalytics.v3_1_preview_3.models.Match] - :param language: Required. Language used in the data source. - :type language: str - :param id: Unique identifier of the recognized entity from the data source. - :type id: str - :param url: Required. URL for the entity's page from the data source. - :type url: str - :param data_source: Required. Data source used to extract entity linking, such as Wiki/Bing - etc. - :type data_source: str - :param bing_id: Bing Entity Search API unique identifier of the recognized entity. - :type bing_id: str - """ - - _validation = { - 'name': {'required': True}, - 'matches': {'required': True}, - 'language': {'required': True}, - 'url': {'required': True}, - 'data_source': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'matches': {'key': 'matches', 'type': '[Match]'}, - 'language': {'key': 'language', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - 'data_source': {'key': 'dataSource', 'type': 'str'}, - 'bing_id': {'key': 'bingId', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - matches: List["Match"], - language: str, - url: str, - data_source: str, - id: Optional[str] = None, - bing_id: Optional[str] = None, - **kwargs - ): - super(LinkedEntity, self).__init__(**kwargs) - self.name = name - self.matches = matches - self.language = language - self.id = id - self.url = url - self.data_source = data_source - self.bing_id = bing_id - - -class Match(msrest.serialization.Model): - """Match. - - All required parameters must be populated in order to send to Azure. - - :param confidence_score: Required. If a well-known item is recognized, a decimal number - denoting the confidence level between 0 and 1 will be returned. - :type confidence_score: float - :param text: Required. Entity text as appears in the request. - :type text: str - :param offset: Required. Start position for the entity match text. - :type offset: int - :param length: Required. Length for the entity match text. - :type length: int - """ - - _validation = { - 'confidence_score': {'required': True}, - 'text': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - } - - _attribute_map = { - 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, - 'text': {'key': 'text', 'type': 'str'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - } - - def __init__( - self, - *, - confidence_score: float, - text: str, - offset: int, - length: int, - **kwargs - ): - super(Match, self).__init__(**kwargs) - self.confidence_score = confidence_score - self.text = text - self.offset = offset - self.length = length - - -class MultiLanguageBatchInput(msrest.serialization.Model): - """Contains a set of input documents to be analyzed by the service. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - """ - - _validation = { - 'documents': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, - } - - def __init__( - self, - *, - documents: List["MultiLanguageInput"], - **kwargs - ): - super(MultiLanguageBatchInput, self).__init__(**kwargs) - self.documents = documents - - -class MultiLanguageInput(msrest.serialization.Model): - """Contains an input document to be analyzed by the service. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. A unique, non-empty document identifier. - :type id: str - :param text: Required. The input text to process. - :type text: str - :param language: (Optional) This is the 2 letter ISO 639-1 representation of a language. For - example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as - default. - :type language: str - """ - - _validation = { - 'id': {'required': True}, - 'text': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - text: str, - language: Optional[str] = None, - **kwargs - ): - super(MultiLanguageInput, self).__init__(**kwargs) - self.id = id - self.text = text - self.language = language - - -class PiiDocumentEntities(msrest.serialization.Model): - """PiiDocumentEntities. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param redacted_text: Required. Returns redacted text. - :type redacted_text: str - :param entities: Required. Recognized entities in the document. - :type entities: list[~azure.ai.textanalytics.v3_1_preview_3.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain - information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.DocumentStatistics - """ - - _validation = { - 'id': {'required': True}, - 'redacted_text': {'required': True}, - 'entities': {'required': True}, - 'warnings': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'redacted_text': {'key': 'redactedText', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[Entity]'}, - 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__( - self, - *, - id: str, - redacted_text: str, - entities: List["Entity"], - warnings: List["TextAnalyticsWarning"], - statistics: Optional["DocumentStatistics"] = None, - **kwargs - ): - super(PiiDocumentEntities, self).__init__(**kwargs) - self.id = id - self.redacted_text = redacted_text - self.entities = entities - self.warnings = warnings - self.statistics = statistics - - -class PiiResult(msrest.serialization.Model): - """PiiResult. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Response by document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.PiiDocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[PiiDocumentEntities]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - documents: List["PiiDocumentEntities"], - errors: List["DocumentError"], - model_version: str, - statistics: Optional["RequestStatistics"] = None, - **kwargs - ): - super(PiiResult, self).__init__(**kwargs) - self.documents = documents - self.errors = errors - self.statistics = statistics - self.model_version = model_version - - -class PiiTask(msrest.serialization.Model): - """PiiTask. - - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiTaskParameters - """ - - _attribute_map = { - 'parameters': {'key': 'parameters', 'type': 'PiiTaskParameters'}, - } - - def __init__( - self, - *, - parameters: Optional["PiiTaskParameters"] = None, - **kwargs - ): - super(PiiTask, self).__init__(**kwargs) - self.parameters = parameters - - -class PiiTaskParameters(msrest.serialization.Model): - """PiiTaskParameters. - - :param domain: Possible values include: "phi", "none". Default value: "none". - :type domain: str or ~azure.ai.textanalytics.v3_1_preview_3.models.PiiTaskParametersDomain - :param model_version: - :type model_version: str - :param string_index_type: Possible values include: "TextElements_v8", "UnicodeCodePoint", - "Utf16CodeUnit". Default value: "TextElements_v8". - :type string_index_type: str or - ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexTypeResponse - """ - - _attribute_map = { - 'domain': {'key': 'domain', 'type': 'str'}, - 'model_version': {'key': 'model-version', 'type': 'str'}, - 'string_index_type': {'key': 'stringIndexType', 'type': 'str'}, - } - - def __init__( - self, - *, - domain: Optional[Union[str, "PiiTaskParametersDomain"]] = "none", - model_version: Optional[str] = "latest", - string_index_type: Optional[Union[str, "StringIndexTypeResponse"]] = "TextElements_v8", - **kwargs - ): - super(PiiTaskParameters, self).__init__(**kwargs) - self.domain = domain - self.model_version = model_version - self.string_index_type = string_index_type - - -class RequestStatistics(msrest.serialization.Model): - """if showStats=true was specified in the request this field will contain information about the request payload. - - All required parameters must be populated in order to send to Azure. - - :param documents_count: Required. Number of documents submitted in the request. - :type documents_count: int - :param valid_documents_count: Required. Number of valid documents. This excludes empty, over- - size limit or non-supported languages documents. - :type valid_documents_count: int - :param erroneous_documents_count: Required. Number of invalid documents. This includes empty, - over-size limit or non-supported languages documents. - :type erroneous_documents_count: int - :param transactions_count: Required. Number of transactions for the request. - :type transactions_count: long - """ - - _validation = { - 'documents_count': {'required': True}, - 'valid_documents_count': {'required': True}, - 'erroneous_documents_count': {'required': True}, - 'transactions_count': {'required': True}, - } - - _attribute_map = { - 'documents_count': {'key': 'documentsCount', 'type': 'int'}, - 'valid_documents_count': {'key': 'validDocumentsCount', 'type': 'int'}, - 'erroneous_documents_count': {'key': 'erroneousDocumentsCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'long'}, - } - - def __init__( - self, - *, - documents_count: int, - valid_documents_count: int, - erroneous_documents_count: int, - transactions_count: int, - **kwargs - ): - super(RequestStatistics, self).__init__(**kwargs) - self.documents_count = documents_count - self.valid_documents_count = valid_documents_count - self.erroneous_documents_count = erroneous_documents_count - self.transactions_count = transactions_count - - -class SentenceAspect(msrest.serialization.Model): - """SentenceAspect. - - All required parameters must be populated in order to send to Azure. - - :param sentiment: Required. Aspect level sentiment for the aspect in the sentence. Possible - values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1_preview_3.models.TokenSentimentValue - :param confidence_scores: Required. Aspect level sentiment confidence scores for the aspect in - the sentence. - :type confidence_scores: - ~azure.ai.textanalytics.v3_1_preview_3.models.AspectConfidenceScoreLabel - :param offset: Required. The aspect offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the aspect. - :type length: int - :param text: Required. The aspect text detected. - :type text: str - :param relations: Required. The array of either opinion or aspect object which is related to - the aspect. - :type relations: list[~azure.ai.textanalytics.v3_1_preview_3.models.AspectRelation] - """ - - _validation = { - 'sentiment': {'required': True}, - 'confidence_scores': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - 'text': {'required': True}, - 'relations': {'required': True}, - } - - _attribute_map = { - 'sentiment': {'key': 'sentiment', 'type': 'str'}, - 'confidence_scores': {'key': 'confidenceScores', 'type': 'AspectConfidenceScoreLabel'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - 'text': {'key': 'text', 'type': 'str'}, - 'relations': {'key': 'relations', 'type': '[AspectRelation]'}, - } - - def __init__( - self, - *, - sentiment: Union[str, "TokenSentimentValue"], - confidence_scores: "AspectConfidenceScoreLabel", - offset: int, - length: int, - text: str, - relations: List["AspectRelation"], - **kwargs - ): - super(SentenceAspect, self).__init__(**kwargs) - self.sentiment = sentiment - self.confidence_scores = confidence_scores - self.offset = offset - self.length = length - self.text = text - self.relations = relations - - -class SentenceOpinion(msrest.serialization.Model): - """SentenceOpinion. - - All required parameters must be populated in order to send to Azure. - - :param sentiment: Required. Opinion level sentiment for the aspect in the sentence. Possible - values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1_preview_3.models.TokenSentimentValue - :param confidence_scores: Required. Opinion level sentiment confidence scores for the aspect in - the sentence. - :type confidence_scores: - ~azure.ai.textanalytics.v3_1_preview_3.models.AspectConfidenceScoreLabel - :param offset: Required. The opinion offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the opinion. - :type length: int - :param text: Required. The aspect text detected. - :type text: str - :param is_negated: Required. The indicator representing if the opinion is negated. - :type is_negated: bool - """ - - _validation = { - 'sentiment': {'required': True}, - 'confidence_scores': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - 'text': {'required': True}, - 'is_negated': {'required': True}, - } - - _attribute_map = { - 'sentiment': {'key': 'sentiment', 'type': 'str'}, - 'confidence_scores': {'key': 'confidenceScores', 'type': 'AspectConfidenceScoreLabel'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - 'text': {'key': 'text', 'type': 'str'}, - 'is_negated': {'key': 'isNegated', 'type': 'bool'}, - } - - def __init__( - self, - *, - sentiment: Union[str, "TokenSentimentValue"], - confidence_scores: "AspectConfidenceScoreLabel", - offset: int, - length: int, - text: str, - is_negated: bool, - **kwargs - ): - super(SentenceOpinion, self).__init__(**kwargs) - self.sentiment = sentiment - self.confidence_scores = confidence_scores - self.offset = offset - self.length = length - self.text = text - self.is_negated = is_negated - - -class SentenceSentiment(msrest.serialization.Model): - """SentenceSentiment. - - All required parameters must be populated in order to send to Azure. - - :param text: Required. The sentence text. - :type text: str - :param sentiment: Required. The predicted Sentiment for the sentence. Possible values include: - "positive", "neutral", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1_preview_3.models.SentenceSentimentValue - :param confidence_scores: Required. The sentiment confidence score between 0 and 1 for the - sentence for all classes. - :type confidence_scores: - ~azure.ai.textanalytics.v3_1_preview_3.models.SentimentConfidenceScorePerLabel - :param offset: Required. The sentence offset from the start of the document. - :type offset: int - :param length: Required. The length of the sentence. - :type length: int - :param aspects: The array of aspect object for the sentence. - :type aspects: list[~azure.ai.textanalytics.v3_1_preview_3.models.SentenceAspect] - :param opinions: The array of opinion object for the sentence. - :type opinions: list[~azure.ai.textanalytics.v3_1_preview_3.models.SentenceOpinion] - """ - - _validation = { - 'text': {'required': True}, - 'sentiment': {'required': True}, - 'confidence_scores': {'required': True}, - 'offset': {'required': True}, - 'length': {'required': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'sentiment': {'key': 'sentiment', 'type': 'str'}, - 'confidence_scores': {'key': 'confidenceScores', 'type': 'SentimentConfidenceScorePerLabel'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - 'aspects': {'key': 'aspects', 'type': '[SentenceAspect]'}, - 'opinions': {'key': 'opinions', 'type': '[SentenceOpinion]'}, - } - - def __init__( - self, - *, - text: str, - sentiment: Union[str, "SentenceSentimentValue"], - confidence_scores: "SentimentConfidenceScorePerLabel", - offset: int, - length: int, - aspects: Optional[List["SentenceAspect"]] = None, - opinions: Optional[List["SentenceOpinion"]] = None, - **kwargs - ): - super(SentenceSentiment, self).__init__(**kwargs) - self.text = text - self.sentiment = sentiment - self.confidence_scores = confidence_scores - self.offset = offset - self.length = length - self.aspects = aspects - self.opinions = opinions - - -class SentimentConfidenceScorePerLabel(msrest.serialization.Model): - """Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative. - - All required parameters must be populated in order to send to Azure. - - :param positive: Required. - :type positive: float - :param neutral: Required. - :type neutral: float - :param negative: Required. - :type negative: float - """ - - _validation = { - 'positive': {'required': True}, - 'neutral': {'required': True}, - 'negative': {'required': True}, - } - - _attribute_map = { - 'positive': {'key': 'positive', 'type': 'float'}, - 'neutral': {'key': 'neutral', 'type': 'float'}, - 'negative': {'key': 'negative', 'type': 'float'}, - } - - def __init__( - self, - *, - positive: float, - neutral: float, - negative: float, - **kwargs - ): - super(SentimentConfidenceScorePerLabel, self).__init__(**kwargs) - self.positive = positive - self.neutral = neutral - self.negative = negative - - -class SentimentResponse(msrest.serialization.Model): - """SentimentResponse. - - All required parameters must be populated in order to send to Azure. - - :param documents: Required. Sentiment analysis per document. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentSentiment] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1_preview_3.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain - information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_1_preview_3.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str - """ - - _validation = { - 'documents': {'required': True}, - 'errors': {'required': True}, - 'model_version': {'required': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[DocumentSentiment]'}, - 'errors': {'key': 'errors', 'type': '[DocumentError]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - 'model_version': {'key': 'modelVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - documents: List["DocumentSentiment"], - errors: List["DocumentError"], - model_version: str, - statistics: Optional["RequestStatistics"] = None, - **kwargs - ): - super(SentimentResponse, self).__init__(**kwargs) - self.documents = documents - self.errors = errors - self.statistics = statistics - self.model_version = model_version - - -class TasksStateTasks(msrest.serialization.Model): - """TasksStateTasks. - - All required parameters must be populated in order to send to Azure. - - :param details: - :type details: ~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasksDetails - :param completed: Required. - :type completed: int - :param failed: Required. - :type failed: int - :param in_progress: Required. - :type in_progress: int - :param total: Required. - :type total: int - :param entity_recognition_tasks: - :type entity_recognition_tasks: - list[~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasksEntityRecognitionTasksItem] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: - list[~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasksEntityRecognitionPiiTasksItem] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: - list[~azure.ai.textanalytics.v3_1_preview_3.models.TasksStateTasksKeyPhraseExtractionTasksItem] - """ - - _validation = { - 'completed': {'required': True}, - 'failed': {'required': True}, - 'in_progress': {'required': True}, - 'total': {'required': True}, - } - - _attribute_map = { - 'details': {'key': 'details', 'type': 'TasksStateTasksDetails'}, - 'completed': {'key': 'completed', 'type': 'int'}, - 'failed': {'key': 'failed', 'type': 'int'}, - 'in_progress': {'key': 'inProgress', 'type': 'int'}, - 'total': {'key': 'total', 'type': 'int'}, - 'entity_recognition_tasks': {'key': 'entityRecognitionTasks', 'type': '[TasksStateTasksEntityRecognitionTasksItem]'}, - 'entity_recognition_pii_tasks': {'key': 'entityRecognitionPiiTasks', 'type': '[TasksStateTasksEntityRecognitionPiiTasksItem]'}, - 'key_phrase_extraction_tasks': {'key': 'keyPhraseExtractionTasks', 'type': '[TasksStateTasksKeyPhraseExtractionTasksItem]'}, - } - - def __init__( - self, - *, - completed: int, - failed: int, - in_progress: int, - total: int, - details: Optional["TasksStateTasksDetails"] = None, - entity_recognition_tasks: Optional[List["TasksStateTasksEntityRecognitionTasksItem"]] = None, - entity_recognition_pii_tasks: Optional[List["TasksStateTasksEntityRecognitionPiiTasksItem"]] = None, - key_phrase_extraction_tasks: Optional[List["TasksStateTasksKeyPhraseExtractionTasksItem"]] = None, - **kwargs - ): - super(TasksStateTasks, self).__init__(**kwargs) - self.details = details - self.completed = completed - self.failed = failed - self.in_progress = in_progress - self.total = total - self.entity_recognition_tasks = entity_recognition_tasks - self.entity_recognition_pii_tasks = entity_recognition_pii_tasks - self.key_phrase_extraction_tasks = key_phrase_extraction_tasks - - -class TaskState(msrest.serialization.Model): - """TaskState. - - All required parameters must be populated in order to send to Azure. - - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param name: - :type name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - last_update_date_time: datetime.datetime, - status: Union[str, "State"], - name: Optional[str] = None, - **kwargs - ): - super(TaskState, self).__init__(**kwargs) - self.last_update_date_time = last_update_date_time - self.name = name - self.status = status - - -class TasksStateTasksDetails(TaskState): - """TasksStateTasksDetails. - - All required parameters must be populated in order to send to Azure. - - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param name: - :type name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - last_update_date_time: datetime.datetime, - status: Union[str, "State"], - name: Optional[str] = None, - **kwargs - ): - super(TasksStateTasksDetails, self).__init__(last_update_date_time=last_update_date_time, name=name, status=status, **kwargs) - - -class TasksStateTasksEntityRecognitionPiiTasksItem(TaskState, Components15X8E9LSchemasTasksstatePropertiesTasksPropertiesEntityrecognitionpiitasksItemsAllof1): - """TasksStateTasksEntityRecognitionPiiTasksItem. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param name: - :type name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'results': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'PiiResult'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - results: "PiiResult", - last_update_date_time: datetime.datetime, - status: Union[str, "State"], - name: Optional[str] = None, - **kwargs - ): - super(TasksStateTasksEntityRecognitionPiiTasksItem, self).__init__(last_update_date_time=last_update_date_time, name=name, status=status, results=results, **kwargs) - self.results = results - self.last_update_date_time = last_update_date_time - self.name = name - self.status = status - - -class TasksStateTasksEntityRecognitionTasksItem(TaskState, Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1): - """TasksStateTasksEntityRecognitionTasksItem. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param name: - :type name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'results': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'EntitiesResult'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - results: "EntitiesResult", - last_update_date_time: datetime.datetime, - status: Union[str, "State"], - name: Optional[str] = None, - **kwargs - ): - super(TasksStateTasksEntityRecognitionTasksItem, self).__init__(last_update_date_time=last_update_date_time, name=name, status=status, results=results, **kwargs) - self.results = results - self.last_update_date_time = last_update_date_time - self.name = name - self.status = status - - -class TasksStateTasksKeyPhraseExtractionTasksItem(TaskState, Components1D9IzucSchemasTasksstatePropertiesTasksPropertiesKeyphraseextractiontasksItemsAllof1): - """TasksStateTasksKeyPhraseExtractionTasksItem. - - All required parameters must be populated in order to send to Azure. - - :param results: Required. - :type results: ~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhraseResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param name: - :type name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", - "failed", "rejected", "cancelled", "cancelling", "partiallyCompleted". - :type status: str or ~azure.ai.textanalytics.v3_1_preview_3.models.State - """ - - _validation = { - 'results': {'required': True}, - 'last_update_date_time': {'required': True}, - 'status': {'required': True}, - } - - _attribute_map = { - 'results': {'key': 'results', 'type': 'KeyPhraseResult'}, - 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - results: "KeyPhraseResult", - last_update_date_time: datetime.datetime, - status: Union[str, "State"], - name: Optional[str] = None, - **kwargs - ): - super(TasksStateTasksKeyPhraseExtractionTasksItem, self).__init__(last_update_date_time=last_update_date_time, name=name, status=status, results=results, **kwargs) - self.results = results - self.last_update_date_time = last_update_date_time - self.name = name - self.status = status - - -class TextAnalyticsError(msrest.serialization.Model): - """TextAnalyticsError. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Error code. Possible values include: "InvalidRequest", - "InvalidArgument", "InternalServerError", "ServiceUnavailable", "NotFound". - :type code: str or ~azure.ai.textanalytics.v3_1_preview_3.models.ErrorCodeValue - :param message: Required. Error message. - :type message: str - :param target: Error target. - :type target: str - :param innererror: Inner error contains more specific information. - :type innererror: ~azure.ai.textanalytics.v3_1_preview_3.models.InnerError - :param details: Details about specific errors that led to this reported error. - :type details: list[~azure.ai.textanalytics.v3_1_preview_3.models.TextAnalyticsError] - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'innererror': {'key': 'innererror', 'type': 'InnerError'}, - 'details': {'key': 'details', 'type': '[TextAnalyticsError]'}, - } - - def __init__( - self, - *, - code: Union[str, "ErrorCodeValue"], - message: str, - target: Optional[str] = None, - innererror: Optional["InnerError"] = None, - details: Optional[List["TextAnalyticsError"]] = None, - **kwargs - ): - super(TextAnalyticsError, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.innererror = innererror - self.details = details - - -class TextAnalyticsWarning(msrest.serialization.Model): - """TextAnalyticsWarning. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Error code. Possible values include: "LongWordsInDocument", - "DocumentTruncated". - :type code: str or ~azure.ai.textanalytics.v3_1_preview_3.models.WarningCodeValue - :param message: Required. Warning message. - :type message: str - :param target_ref: A JSON pointer reference indicating the target object. - :type target_ref: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target_ref': {'key': 'targetRef', 'type': 'str'}, - } - - def __init__( - self, - *, - code: Union[str, "WarningCodeValue"], - message: str, - target_ref: Optional[str] = None, - **kwargs - ): - super(TextAnalyticsWarning, self).__init__(**kwargs) - self.code = code - self.message = message - self.target_ref = target_ref diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/_text_analytics_client_enums.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/_text_analytics_client_enums.py deleted file mode 100644 index ec5fdd616595..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/models/_text_analytics_client_enums.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class AspectRelationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type related to the aspect. - """ - - OPINION = "opinion" - ASPECT = "aspect" - -class DocumentSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Predicted sentiment for document (Negative, Neutral, Positive, or Mixed). - """ - - POSITIVE = "positive" - NEUTRAL = "neutral" - NEGATIVE = "negative" - MIXED = "mixed" - -class ErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Error code. - """ - - INVALID_REQUEST = "InvalidRequest" - INVALID_ARGUMENT = "InvalidArgument" - INTERNAL_SERVER_ERROR = "InternalServerError" - SERVICE_UNAVAILABLE = "ServiceUnavailable" - NOT_FOUND = "NotFound" - -class InnerErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Error code. - """ - - INVALID_PARAMETER_VALUE = "InvalidParameterValue" - INVALID_REQUEST_BODY_FORMAT = "InvalidRequestBodyFormat" - EMPTY_REQUEST = "EmptyRequest" - MISSING_INPUT_RECORDS = "MissingInputRecords" - INVALID_DOCUMENT = "InvalidDocument" - MODEL_VERSION_INCORRECT = "ModelVersionIncorrect" - INVALID_DOCUMENT_BATCH = "InvalidDocumentBatch" - UNSUPPORTED_LANGUAGE_CODE = "UnsupportedLanguageCode" - INVALID_COUNTRY_HINT = "InvalidCountryHint" - -class PiiTaskParametersDomain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - PHI = "phi" - NONE = "none" - -class SentenceSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The predicted Sentiment for the sentence. - """ - - POSITIVE = "positive" - NEUTRAL = "neutral" - NEGATIVE = "negative" - -class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - NOT_STARTED = "notStarted" - RUNNING = "running" - SUCCEEDED = "succeeded" - FAILED = "failed" - REJECTED = "rejected" - CANCELLED = "cancelled" - CANCELLING = "cancelling" - PARTIALLY_COMPLETED = "partiallyCompleted" - -class StringIndexType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - #: Returned offset and length values will correspond to TextElements (Graphemes and Grapheme - #: clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is - #: written in .Net Framework or .Net Core and you will be using StringInfo. - TEXT_ELEMENTS_V8 = "TextElements_v8" - #: Returned offset and length values will correspond to Unicode code points. Use this option if - #: your application is written in a language that support Unicode, for example Python. - UNICODE_CODE_POINT = "UnicodeCodePoint" - #: Returned offset and length values will correspond to UTF-16 code units. Use this option if your - #: application is written in a language that support Unicode, for example Java, JavaScript. - UTF16_CODE_UNIT = "Utf16CodeUnit" - -class StringIndexTypeResponse(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - #: Returned offset and length values will correspond to TextElements (Graphemes and Grapheme - #: clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is - #: written in .Net Framework or .Net Core and you will be using StringInfo. - TEXT_ELEMENTS_V8 = "TextElements_v8" - #: Returned offset and length values will correspond to Unicode code points. Use this option if - #: your application is written in a language that support Unicode, for example Python. - UNICODE_CODE_POINT = "UnicodeCodePoint" - #: Returned offset and length values will correspond to UTF-16 code units. Use this option if your - #: application is written in a language that support Unicode, for example Java, JavaScript. - UTF16_CODE_UNIT = "Utf16CodeUnit" - -class TokenSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Aspect level sentiment for the aspect in the sentence. - """ - - POSITIVE = "positive" - MIXED = "mixed" - NEGATIVE = "negative" - -class WarningCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Error code. - """ - - LONG_WORDS_IN_DOCUMENT = "LongWordsInDocument" - DOCUMENT_TRUNCATED = "DocumentTruncated" diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/operations/__init__.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/operations/__init__.py deleted file mode 100644 index 4384511c0346..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/operations/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._text_analytics_client_operations import TextAnalyticsClientOperationsMixin - -__all__ = [ - 'TextAnalyticsClientOperationsMixin', -] diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/operations/_text_analytics_client_operations.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/operations/_text_analytics_client_operations.py deleted file mode 100644 index 4fdad40602c2..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/operations/_text_analytics_client_operations.py +++ /dev/null @@ -1,1076 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -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 -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.polling.base_polling import LROBasePolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class TextAnalyticsClientOperationsMixin(object): - - def _analyze_initial( - self, - body=None, # type: Optional["_models.AnalyzeBatchInput"] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AnalyzeJobState"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AnalyzeJobState"]] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._analyze_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if body is not None: - body_content = self._serialize.body(body, 'AnalyzeBatchInput') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AnalyzeJobState', pipeline_response) - - if response.status_code == 202: - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - _analyze_initial.metadata = {'url': '/analyze'} # type: ignore - - def begin_analyze( - self, - body=None, # type: Optional["_models.AnalyzeBatchInput"] - **kwargs # type: Any - ): - # type: (...) -> AnalyzeBatchActionsLROPoller["_models.AnalyzeJobState"] - """Submit analysis job. - - Submit a collection of text documents for analysis. Specify one or more unique tasks to be - executed. - - :param body: Collection of documents to analyze and tasks to execute. - :type body: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeBatchInput - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AnalyzeBatchActionsLROPollingMethod polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AnalyzeBatchActionsLROPoller that returns either AnalyzeJobState or the result of cls(response) - :rtype: ~...._lro.AnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeJobState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._analyze_initial( - body=body, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AnalyzeJobState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - - if polling is True: polling_method = AnalyzeBatchActionsLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return AnalyzeBatchActionsLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AnalyzeBatchActionsLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_analyze.metadata = {'url': '/analyze'} # type: ignore - - def analyze_status( - self, - job_id, # type: str - show_stats=None, # type: Optional[bool] - top=20, # type: Optional[int] - skip=0, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> "_models.AnalyzeJobState" - """Get analysis status and results. - - Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are - completed, the job will transition to the completed state and results will be available for - each task. - - :param job_id: Job ID for Analyze. - :type job_id: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :param top: (Optional) Set the maximum number of results per task. When both $top and $skip are - specified, $skip is applied first. - :type top: int - :param skip: (Optional) Set the number of elements to offset in the response. When both $top - and $skip are specified, $skip is applied first. - :type skip: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AnalyzeJobState, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeJobState"] - error_map = { - 401: ClientAuthenticationError, - 409: ResourceExistsError, - 404: lambda response: ResourceNotFoundError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - - # Construct URL - url = self.analyze_status.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'jobId': self._serialize.url("job_id", job_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=50, minimum=1) - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('AnalyzeJobState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - analyze_status.metadata = {'url': '/analyze/jobs/{jobId}'} # type: ignore - - def health_status( - self, - job_id, # type: str - top=20, # type: Optional[int] - skip=0, # type: Optional[int] - show_stats=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.HealthcareJobState" - """Get healthcare analysis job status and results. - - Get details of the healthcare prediction job specified by the jobId. - - :param job_id: Job ID. - :type job_id: str - :param top: (Optional) Set the maximum number of results per task. When both $top and $skip are - specified, $skip is applied first. - :type top: int - :param skip: (Optional) Set the number of elements to offset in the response. When both $top - and $skip are specified, $skip is applied first. - :type skip: int - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: HealthcareJobState, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.HealthcareJobState"] - error_map = { - 401: ClientAuthenticationError, - 409: ResourceExistsError, - 404: lambda response: ResourceNotFoundError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - - # Construct URL - url = self.health_status.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'jobId': self._serialize.url("job_id", job_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=50, minimum=1) - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('HealthcareJobState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - health_status.metadata = {'url': '/entities/health/jobs/{jobId}'} # type: ignore - - def _cancel_health_job_initial( - self, - job_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, - 409: ResourceExistsError, - 404: lambda response: ResourceNotFoundError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - - # Construct URL - url = self._cancel_health_job_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'jobId': self._serialize.url("job_id", job_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - - if cls: - return cls(pipeline_response, None, response_headers) - - _cancel_health_job_initial.metadata = {'url': '/entities/health/jobs/{jobId}'} # type: ignore - - def begin_cancel_health_job( - self, - job_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Cancel healthcare prediction job. - - Cancel healthcare prediction job. - - :param job_id: Job ID. - :type job_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the LROBasePolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._cancel_health_job_initial( - job_id=job_id, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'jobId': self._serialize.url("job_id", job_id, 'str'), - } - - if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_cancel_health_job.metadata = {'url': '/entities/health/jobs/{jobId}'} # type: ignore - - def _health_initial( - self, - documents, # type: List["_models.MultiLanguageInput"] - model_version=None, # type: Optional[str] - string_index_type="TextElements_v8", # type: Optional[Union[str, "_models.StringIndexType"]] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.HealthcareJobState"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.HealthcareJobState"]] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._health_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if string_index_type is not None: - query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('HealthcareJobState', pipeline_response) - - if response.status_code == 202: - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - _health_initial.metadata = {'url': '/entities/health/jobs'} # type: ignore - - def begin_health( - self, - documents, # type: List["_models.MultiLanguageInput"] - model_version=None, # type: Optional[str] - string_index_type="TextElements_v8", # type: Optional[Union[str, "_models.StringIndexType"]] - **kwargs # type: Any - ): - # type: (...) -> AnalyzeHealthcareEntitiesLROPoller["_models.HealthcareJobState"] - """Submit healthcare analysis job. - - Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions, - symptoms, etc) and their relations. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param string_index_type: (Optional) Specifies the method used to interpret string offsets. - Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information - see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AnalyzeHealthcareEntitiesLROPollingMethod polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AnalyzeHealthcareEntitiesLROPoller that returns either HealthcareJobState or the result of cls(response) - :rtype: ~...._lro.AnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.HealthcareJobState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.HealthcareJobState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._health_initial( - documents=documents, - model_version=model_version, - string_index_type=string_index_type, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('HealthcareJobState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - - if polling is True: polling_method = AnalyzeHealthcareEntitiesLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return AnalyzeHealthcareEntitiesLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AnalyzeHealthcareEntitiesLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_health.metadata = {'url': '/entities/health/jobs'} # type: ignore - - def entities_recognition_general( - self, - documents, # type: List["_models.MultiLanguageInput"] - model_version=None, # type: Optional[str] - show_stats=None, # type: Optional[bool] - string_index_type="TextElements_v8", # type: Optional[Union[str, "_models.StringIndexType"]] - **kwargs # type: Any - ): - # type: (...) -> "_models.EntitiesResult" - """Named Entity Recognition. - - The API returns a list of general named entities in a given document. For the list of supported - entity types, check :code:`Supported Entity Types in Text - Analytics API`. See the :code:`Supported languages in Text - Analytics API` for the list of enabled languages. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :param string_index_type: (Optional) Specifies the method used to interpret string offsets. - Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information - see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EntitiesResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.EntitiesResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EntitiesResult"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.entities_recognition_general.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - if string_index_type is not None: - query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('EntitiesResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - entities_recognition_general.metadata = {'url': '/entities/recognition/general'} # type: ignore - - def entities_recognition_pii( - self, - documents, # type: List["_models.MultiLanguageInput"] - model_version=None, # type: Optional[str] - show_stats=None, # type: Optional[bool] - domain=None, # type: Optional[str] - string_index_type="TextElements_v8", # type: Optional[Union[str, "_models.StringIndexType"]] - **kwargs # type: Any - ): - # type: (...) -> "_models.PiiResult" - """Entities containing personal information. - - The API returns a list of entities with personal information (\"SSN\", \"Bank Account\" etc) in - the document. For the list of supported entity types, check :code:`Supported Entity Types in Text Analytics API`. See the - :code:`Supported languages in Text Analytics API` for the - list of enabled languages. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :param domain: (Optional) if specified, will set the PII domain to include only a subset of the - entity categories. Possible values include: 'PHI', 'none'. - :type domain: str - :param string_index_type: (Optional) Specifies the method used to interpret string offsets. - Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information - see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PiiResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.PiiResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PiiResult"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.entities_recognition_pii.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - if domain is not None: - query_parameters['domain'] = self._serialize.query("domain", domain, 'str') - if string_index_type is not None: - query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('PiiResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - entities_recognition_pii.metadata = {'url': '/entities/recognition/pii'} # type: ignore - - def entities_linking( - self, - documents, # type: List["_models.MultiLanguageInput"] - model_version=None, # type: Optional[str] - show_stats=None, # type: Optional[bool] - string_index_type="TextElements_v8", # type: Optional[Union[str, "_models.StringIndexType"]] - **kwargs # type: Any - ): - # type: (...) -> "_models.EntityLinkingResult" - """Linked entities from a well-known knowledge base. - - The API returns a list of recognized entities with links to a well-known knowledge base. See - the :code:`Supported languages in Text Analytics API` for - the list of enabled languages. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :param string_index_type: (Optional) Specifies the method used to interpret string offsets. - Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information - see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EntityLinkingResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.EntityLinkingResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EntityLinkingResult"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.entities_linking.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - if string_index_type is not None: - query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('EntityLinkingResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - entities_linking.metadata = {'url': '/entities/linking'} # type: ignore - - def key_phrases( - self, - documents, # type: List["_models.MultiLanguageInput"] - model_version=None, # type: Optional[str] - show_stats=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.KeyPhraseResult" - """Key Phrases. - - The API returns a list of strings denoting the key phrases in the input text. See the :code:`Supported languages in Text Analytics API` for the list of - enabled languages. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: KeyPhraseResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.KeyPhraseResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyPhraseResult"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.key_phrases.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('KeyPhraseResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - key_phrases.metadata = {'url': '/keyPhrases'} # type: ignore - - def languages( - self, - documents, # type: List["_models.LanguageInput"] - model_version=None, # type: Optional[str] - show_stats=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.LanguageResult" - """Detect Language. - - The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 - indicate 100% certainty that the identified language is true. See the :code:`Supported languages in Text Analytics API` for the list of - enabled languages. - - :param documents: - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.LanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LanguageResult, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.LanguageResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LanguageResult"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.LanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.languages.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'LanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('LanguageResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - languages.metadata = {'url': '/languages'} # type: ignore - - def sentiment( - self, - documents, # type: List["_models.MultiLanguageInput"] - model_version=None, # type: Optional[str] - show_stats=None, # type: Optional[bool] - opinion_mining=None, # type: Optional[bool] - string_index_type="TextElements_v8", # type: Optional[Union[str, "_models.StringIndexType"]] - **kwargs # type: Any - ): - # type: (...) -> "_models.SentimentResponse" - """Sentiment. - - The API returns a detailed sentiment analysis for the input text. The analysis is done in - multiple levels of granularity, start from the a document level, down to sentence and key terms - (aspects) and opinions. - - :param documents: The set of documents to process as part of this batch. - :type documents: list[~azure.ai.textanalytics.v3_1_preview_3.models.MultiLanguageInput] - :param model_version: (Optional) This value indicates which model will be used for scoring. If - a model-version is not specified, the API should default to the latest, non-preview version. - :type model_version: str - :param show_stats: (Optional) if set to true, response will contain request and document level - statistics. - :type show_stats: bool - :param opinion_mining: (Optional) if set to true, response will contain input and document - level statistics including aspect-based sentiment analysis results. - :type opinion_mining: bool - :param string_index_type: (Optional) Specifies the method used to interpret string offsets. - Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information - see https://aka.ms/text-analytics-offsets. - :type string_index_type: str or ~azure.ai.textanalytics.v3_1_preview_3.models.StringIndexType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SentimentResponse, or the result of cls(response) - :rtype: ~azure.ai.textanalytics.v3_1_preview_3.models.SentimentResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SentimentResponse"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 400: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.ErrorResponse, response)), - } - error_map.update(kwargs.pop('error_map', {})) - - _input = _models.MultiLanguageBatchInput(documents=documents) - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.sentiment.metadata['url'] # type: ignore - path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if model_version is not None: - query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - if opinion_mining is not None: - query_parameters['opinionMining'] = self._serialize.query("opinion_mining", opinion_mining, 'bool') - if string_index_type is not None: - query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_input, 'MultiLanguageBatchInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('SentimentResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - sentiment.metadata = {'url': '/sentiment'} # type: ignore diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/py.typed b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_3/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/_metadata.json b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/_metadata.json index 8f580ec35dc6..fc703d94a333 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/_metadata.json +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/_metadata.json @@ -10,8 +10,8 @@ "azure_arm": false, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"TextAnalyticsClientConfiguration\"], \"._operations_mixin\": [\"TextAnalyticsClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"TextAnalyticsClientConfiguration\"], \"._operations_mixin\": [\"TextAnalyticsClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"TextAnalyticsClientConfiguration\"], \"._operations_mixin\": [\"TextAnalyticsClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"TextAnalyticsClientConfiguration\"], \"._operations_mixin\": [\"TextAnalyticsClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/_text_analytics_client.py index 8d45331521ef..9cd5abaf1b54 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/_text_analytics_client.py @@ -16,6 +16,7 @@ from typing import Any from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import TextAnalyticsClientConfiguration from .operations import TextAnalyticsClientOperationsMixin @@ -49,6 +50,24 @@ def __init__( self._deserialize = Deserializer(client_models) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/aio/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/aio/_text_analytics_client.py index 1882af8b94d6..d36c0662bb13 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/aio/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/aio/_text_analytics_client.py @@ -9,6 +9,7 @@ from typing import Any, TYPE_CHECKING from azure.core import AsyncPipelineClient +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from msrest import Deserializer, Serializer if TYPE_CHECKING: @@ -46,6 +47,23 @@ def __init__( self._deserialize = Deserializer(client_models) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_lro.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_lro.py index ceb2c66ee5e6..1979ab343d31 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_lro.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_lro.py @@ -97,7 +97,7 @@ def __init__(self, *args, **kwargs): @property def _current_body(self): - from ._generated.v3_1_preview_3.models import JobMetadata + from ._generated.v3_1_preview_4.models import JobMetadata return JobMetadata.deserialize(self._pipeline_response) @property @@ -186,7 +186,7 @@ class AnalyzeBatchActionsLROPollingMethod(TextAnalyticsLROPollingMethod): @property def _current_body(self): - from ._generated.v3_1_preview_3.models import AnalyzeJobMetadata + from ._generated.v3_1_preview_4.models import AnalyzeJobMetadata return AnalyzeJobMetadata.deserialize(self._pipeline_response) @property diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py index 890db922a094..8ed30ec473f0 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py @@ -11,7 +11,7 @@ ) from ._generated.v3_0 import models as _v3_0_models -from ._generated.v3_1_preview_3 import models as _v3_1_preview_3_models +from ._generated.v3_1_preview_4 import models as _latest_preview_models def _get_indices(relation): return [int(s) for s in re.findall(r"\d+", relation)] @@ -73,6 +73,26 @@ class PiiEntityDomainType(str, Enum): """The different domains of PII entities that users can filter by""" PROTECTED_HEALTH_INFORMATION = "phi" # See https://aka.ms/tanerpii for more information. +class HealthcareEntityRelationRoleType(str, Enum): + """Type of roles entities can have in `entity_relations`. There may be roles not covered in this enum""" + ABBREVIATED_TERM = "AbbreviatedTerm" + FULL_TERM = "FullTerm" + DIRECTION = "Direction" + BODY_STRUCTURE = "BodyStructure" + CONDITION = "Condition" + EXAMINATION = "Examination" + TREATMENT = "Treatment" + DOSAGE = "Dosage" + MEDICATION = "Medication" + FORM = "Form" + FREQUENCY = "Frequency" + QUALIFIER = "Qualifier" + RELATION = "Relation" + ROUTE = "Route" + TIME = "Time" + EVENT = "Event" + UNIT = "Unit" + VALUE = "Value" class DetectedLanguage(DictMixin): """DetectedLanguage contains the predicted language found in text, @@ -193,9 +213,15 @@ class AnalyzeHealthcareEntitiesResultItem(DictMixin): :ivar str id: Unique, non-empty document identifier that matches the document id that was passed in with the request. If not specified in the request, an id is assigned for the document. - :ivar entities: Identified Healthcare entities in the document. + :ivar entities: Identified Healthcare entities in the document, i.e. in + the document "The subject took ibuprofen", "ibuprofen" is an identified entity + from the document. :vartype entities: list[~azure.ai.textanalytics.HealthcareEntity] + :ivar entity_relations: Identified Healthcare relations between entities. For example, in the + document "The subject took 100mg of ibuprofen", we would identify the relationship + between the dosage of 100mg and the medication ibuprofen. + :vartype entity_relations: list[~azure.ai.textanalytics.HealthcareRelation] :ivar warnings: Warnings encountered while processing document. Results will still be returned if there are warnings, but they may not be fully accurate. :vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] @@ -210,55 +236,110 @@ class AnalyzeHealthcareEntitiesResultItem(DictMixin): def __init__(self, **kwargs): self.id = kwargs.get("id", None) self.entities = kwargs.get("entities", None) + self.entity_relations = kwargs.get("entity_relations", None) self.warnings = kwargs.get("warnings", []) self.statistics = kwargs.get("statistics", None) self.is_error = False - @staticmethod - def _update_related_entities(entities, relations_result): - relation_dict = {} - for r in relations_result: - _, source_idx = _get_indices(r.source) - _, target_idx = _get_indices(r.target) - - if entities[source_idx] not in relation_dict.keys(): - relation_dict[entities[source_idx]] = {} - - if entities[target_idx] not in relation_dict.keys(): - relation_dict[entities[target_idx]] = {} - - if r.bidirectional: - relation_dict[entities[target_idx]][entities[source_idx]] = r.relation_type - - relation_dict[entities[source_idx]][entities[target_idx]] = r.relation_type - - for entity in entities: - if entity in relation_dict.keys(): - entity.related_entities.update(relation_dict[entity]) @classmethod def _from_generated(cls, healthcare_result): entities = [HealthcareEntity._from_generated(e) for e in healthcare_result.entities] # pylint: disable=protected-access - if healthcare_result.relations: - cls._update_related_entities(entities, healthcare_result.relations) + relations = [HealthcareRelation._from_generated(r, entities) for r in healthcare_result.relations] # pylint: disable=protected-access return cls( id=healthcare_result.id, entities=entities, + entity_relations=relations, warnings=healthcare_result.warnings, - statistics=healthcare_result.statistics + statistics=healthcare_result.statistics, ) def __repr__(self): - return "AnalyzeHealthcareEntitiesResultItem(id={}, entities={}, warnings={}, statistics={}, \ - is_error={})".format( + return "AnalyzeHealthcareEntitiesResultItem(id={}, entities={}, entity_relations={}, warnings={}, "\ + "statistics={}, is_error={})".format( self.id, - self.entities, - self.warnings, - self.statistics, + repr(self.entities), + repr(self.entity_relations), + repr(self.warnings), + repr(self.statistics), self.is_error )[:1024] +class HealthcareRelation(DictMixin): + """HealthcareRelation is a result object which represents a relation detected in a document. + + Every HealthcareRelation is an entity graph of a certain relation type, + where all entities are connected and have specific roles within the relation context. + + :ivar relation_type: The type of relation, i.e. the relationship between "100mg" and + "ibuprofen" in the document "The subject took 100 mg of ibuprofen" is "DosageOfMedication". + :vartype relation_type: str or ~azure.ai.textanalytics.HealthcareEntityRelationType + :ivar roles: The roles present in this relation. I.e., in the document + "The subject took 100 mg of ibuprofen", the present roles are "Dosage" and "Medication". + :vartype roles: list[~azure.ai.textanalytics.HealthcareRelationRole] + """ + + def __init__(self, **kwargs): + self.relation_type = kwargs.get("relation_type") + self.roles = kwargs.get("roles") + + @classmethod + def _from_generated(cls, healthcare_relation_result, entities): + roles = [ + HealthcareRelationRole._from_generated(r, entities) # pylint: disable=protected-access + for r in healthcare_relation_result.entities + ] + return cls( + relation_type=healthcare_relation_result.relation_type, + roles=roles, + ) + + def __repr__(self): + return "HealthcareRelation(relation_type={}, roles={})".format( + self.relation_type, + repr(self.roles), + )[:1024] + +class HealthcareRelationRole(DictMixin): + """A model representing a role in a relation. + + For example, in "The subject took 100 mg of ibuprofen", + "100 mg" is a dosage entity fulfilling the role "Dosage" + in the extracted relation "DosageofMedication". + + :ivar name: The role of the entity in the relationship. I.e., in the relation + "The subject took 100 mg of ibuprofen", the dosage entity "100 mg" has role + "Dosage". + :vartype name: str or ~azure.ai.textanalytics.HealthcareEntityRelationRoleType + :ivar entity: The entity that is present in the relationship. For example, in + "The subject took 100 mg of ibuprofen", this property holds the dosage entity + of "100 mg". + :vartype entity: ~azure.ai.textanalytics.HealthcareEntity + """ + + def __init__(self, **kwargs): + self.name = kwargs.get("name") + self.entity = kwargs.get("entity") + + @staticmethod + def _get_entity(healthcare_role_result, entities): + nums = _get_indices(healthcare_role_result.ref) + entity_index = nums[1] # first num parsed from index is document #, second is entity index + return entities[entity_index] + + @classmethod + def _from_generated(cls, healthcare_role_result, entities): + return cls( + name=healthcare_role_result.role, + entity=HealthcareRelationRole._get_entity(healthcare_role_result, entities) + ) + + def __repr__(self): + return "HealthcareRelationRole(name={}, entity={})".format( + self.name, repr(self.entity) + ) + class DetectLanguageResult(DictMixin): """DetectLanguageResult is a result object which contains @@ -421,10 +502,6 @@ class HealthcareEntity(DictMixin): :ivar int offset: The entity text offset from the start of the document. This value depends on the value of the `string_index_type` parameter specified in the original request, which is UnicodeCodePoints by default. - :ivar related_entities: Other healthcare entities that are related to this - specific entity. It is represented as a dict, mapping all of the related entities - to how they are related - :vartype related_entities: dict[~azure.ai.textanalytics.HealthcareEntity, str] :ivar float confidence_score: Confidence score between 0 and 1 of the extracted entity. :ivar data_sources: A collection of entity references in known data sources. @@ -439,7 +516,6 @@ def __init__(self, **kwargs): self.offset = kwargs.get("offset", None) self.confidence_score = kwargs.get("confidence_score", None) self.data_sources = kwargs.get("data_sources", []) - self.related_entities = {} @classmethod def _from_generated(cls, healthcare_entity): @@ -460,7 +536,7 @@ def __hash__(self): def __repr__(self): return "HealthcareEntity(text={}, category={}, subcategory={}, length={}, offset={}, confidence_score={}, "\ - "data_sources={}, related_entities={})".format( + "data_sources={})".format( self.text, self.category, self.subcategory, @@ -468,7 +544,6 @@ def __repr__(self): self.offset, self.confidence_score, repr(self.data_sources), - repr(self.related_entities) )[:1024] @@ -1311,8 +1386,8 @@ def __repr__(self, **kwargs): .format(self.model_version, self.string_index_type)[:1024] def to_generated(self): - return _v3_1_preview_3_models.EntitiesTask( - parameters=_v3_1_preview_3_models.EntitiesTaskParameters( + return _latest_preview_models.EntitiesTask( + parameters=_latest_preview_models.EntitiesTaskParameters( model_version=self.model_version, string_index_type=self.string_index_type ) @@ -1353,8 +1428,8 @@ def __repr__(self, **kwargs): .format(self.model_version, self.domain_filter, self.string_index_type)[:1024] def to_generated(self): - return _v3_1_preview_3_models.PiiTask( - parameters=_v3_1_preview_3_models.PiiTaskParameters( + return _latest_preview_models.PiiTask( + parameters=_latest_preview_models.PiiTaskParameters( model_version=self.model_version, domain=self.domain_filter, string_index_type=self.string_index_type @@ -1382,8 +1457,8 @@ def __repr__(self, **kwargs): .format(self.model_version)[:1024] def to_generated(self): - return _v3_1_preview_3_models.KeyPhrasesTask( - parameters=_v3_1_preview_3_models.KeyPhrasesTaskParameters( + return _latest_preview_models.KeyPhrasesTask( + parameters=_latest_preview_models.KeyPhrasesTaskParameters( model_version=self.model_version ) ) diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_request_handlers.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_request_handlers.py index 2e02bfc49d30..4b9cfe2a80d9 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_request_handlers.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_request_handlers.py @@ -80,7 +80,7 @@ def _check_string_index_type_arg(string_index_type_arg, api_version, string_inde if api_version == "v3.0": if string_index_type_arg is not None: raise ValueError( - "'string_index_type' is only available for API version v3.1-preview and up" + "'string_index_type' is only available for API version V3_1_PREVIEW and up" ) else: diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py index 5ee09d08fff6..2a3c82dbcfeb 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py @@ -318,5 +318,5 @@ def analyze_paged_result(doc_id_order, task_order, analyze_status_callback, _, o ) def _get_deserialize(): - from ._generated.v3_1_preview_3 import TextAnalyticsClient + from ._generated.v3_1_preview_4 import TextAnalyticsClient return TextAnalyticsClient("dummy", "dummy")._deserialize # pylint: disable=protected-access diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py index b478de60043f..e0e78b513568 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py @@ -348,7 +348,7 @@ def recognize_pii_entities( # type: ignore except ValueError as error: if "API version v3.0 does not have operation 'entities_recognition_pii'" in str(error): raise ValueError( - "'recognize_pii_entities' endpoint is only available for API version v3.1-preview and up" + "'recognize_pii_entities' endpoint is only available for API version V3_1_PREVIEW and up" ) raise error except HttpResponseError as error: @@ -437,7 +437,7 @@ def recognize_linked_entities( # type: ignore def _healthcare_result_callback(self, doc_id_order, raw_response, _, headers, show_stats=False): healthcare_result = self._deserialize( - self._client.models(api_version="v3.1-preview.3").HealthcareJobState, + self._client.models(api_version="v3.1-preview.4").HealthcareJobState, raw_response ) return healthcare_paged_result( @@ -457,14 +457,15 @@ def begin_analyze_healthcare_entities( # type: ignore ): # type: (...) -> LROPoller[ItemPaged[AnalyzeHealthcareEntitiesResultItem]] """Analyze healthcare entities and identify relationships between these entities in a batch of documents. - NOTE: this endpoint is currently in gated preview, meaning your subscription needs to be allow-listed - for you to use this endpoint. More information about that here: - https://aka.ms/text-analytics-health-request-access - Entities are associated with references that can be found in existing knowledge bases, such as UMLS, CHV, MSH, etc. - Relations are comprised of a pair of entities and a directional relationship. + We also extract the relations found between entities, for example in "The subject took 100 mg of ibuprofen", + we would extract the relationship between the "100 mg" dosage and the "ibuprofen" medication. + + NOTE: this endpoint is currently in gated preview, meaning your subscription needs to be allow-listed + for you to use this endpoint. More information about that here: + https://aka.ms/text-analytics-health-request-access :param documents: The set of documents to process as part of this batch. If you wish to specify the ID and language on a per-item basis you must @@ -534,7 +535,7 @@ def begin_analyze_healthcare_entities( # type: ignore if "API version v3.0 does not have operation 'begin_health'" in str(error): raise ValueError( "'begin_analyze_healthcare_entities' method is only available for API version \ - v3.1-preview.3 and up." + V3_1_PREVIEW and up." ) raise error @@ -714,7 +715,7 @@ def analyze_sentiment( # type: ignore def _analyze_result_callback(self, doc_id_order, task_order, raw_response, _, headers, show_stats=False): analyze_result = self._deserialize( - self._client.models(api_version="v3.1-preview.3").AnalyzeJobState, # pylint: disable=protected-access + self._client.models(api_version="v3.1-preview.4").AnalyzeJobState, # pylint: disable=protected-access raw_response ) return analyze_paged_result( @@ -781,7 +782,7 @@ def begin_analyze_batch_actions( # type: ignore display_name = kwargs.pop("display_name", None) language_arg = kwargs.pop("language", None) language = language_arg if language_arg is not None else self._default_language - docs = self._client.models(api_version="v3.1-preview.3").MultiLanguageBatchInput( + docs = self._client.models(api_version="v3.1-preview.4").MultiLanguageBatchInput( documents=_validate_input(documents, "language", language) ) show_stats = kwargs.pop("show_stats", False) @@ -792,7 +793,7 @@ def begin_analyze_batch_actions( # type: ignore task_order = [_determine_action_type(action) for action in actions] try: - analyze_tasks = self._client.models(api_version='v3.1-preview.3').JobManifestTasks( + analyze_tasks = self._client.models(api_version='v3.1-preview.4').JobManifestTasks( entity_recognition_tasks=[ t.to_generated() for t in [a for a in actions if _determine_action_type(a) == AnalyzeBatchActionsType.RECOGNIZE_ENTITIES] @@ -806,7 +807,7 @@ def begin_analyze_batch_actions( # type: ignore [a for a in actions if _determine_action_type(a) == AnalyzeBatchActionsType.EXTRACT_KEY_PHRASES] ] ) - analyze_body = self._client.models(api_version='v3.1-preview.3').AnalyzeBatchInput( + analyze_body = self._client.models(api_version='v3.1-preview.4').AnalyzeBatchInput( display_name=display_name, tasks=analyze_tasks, analysis_input=docs @@ -829,7 +830,7 @@ def begin_analyze_batch_actions( # type: ignore except ValueError as error: if "API version v3.0 does not have operation 'begin_analyze'" in str(error): raise ValueError( - "'begin_analyze_batch_actions' endpoint is only available for API version v3.1-preview.3" + "'begin_analyze_batch_actions' endpoint is only available for API version V3_1_PREVIEW and up" ) raise error diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py index eba1acb4cd27..6ca75b406253 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py @@ -345,7 +345,7 @@ async def recognize_pii_entities( # type: ignore except ValueError as error: if "API version v3.0 does not have operation 'entities_recognition_pii'" in str(error): raise ValueError( - "'recognize_pii_entities' endpoint is only available for API version v3.1-preview and up" + "'recognize_pii_entities' endpoint is only available for API version V3_1_PREVIEW and up" ) raise error except HttpResponseError as error: @@ -595,7 +595,7 @@ async def analyze_sentiment( # type: ignore def _healthcare_result_callback(self, doc_id_order, raw_response, _, headers, show_stats=False): healthcare_result = self._deserialize( - self._client.models(api_version="v3.1-preview.3").HealthcareJobState, + self._client.models(api_version="v3.1-preview.4").HealthcareJobState, raw_response ) return healthcare_paged_result( @@ -615,14 +615,15 @@ async def begin_analyze_healthcare_entities( # type: ignore ): # type: (...) -> AsyncLROPoller[AsyncItemPaged[AnalyzeHealthcareEntitiesResultItem]] """Analyze healthcare entities and identify relationships between these entities in a batch of documents. - NOTE: this endpoint is currently in gated preview, meaning your subscription needs to be allow-listed - for you to use this endpoint. More information about that here: - https://aka.ms/text-analytics-health-request-access - Entities are associated with references that can be found in existing knowledge bases, such as UMLS, CHV, MSH, etc. - Relations are comprised of a pair of entities and a directional relationship. + We also extract the relations found between entities, for example in "The subject took 100 mg of ibuprofen", + we would extract the relationship between the "100 mg" dosage and the "ibuprofen" medication. + + NOTE: this endpoint is currently in gated preview, meaning your subscription needs to be allow-listed + for you to use this endpoint. More information about that here: + https://aka.ms/text-analytics-health-request-access :param documents: The set of documents to process as part of this batch. If you wish to specify the ID and language on a per-item basis you must @@ -690,7 +691,7 @@ async def begin_analyze_healthcare_entities( # type: ignore except ValueError as error: if "API version v3.0 does not have operation 'begin_health'" in str(error): raise ValueError( - "'begin_analyze_healthcare_entities' endpoint is only available for API version v3.1-preview and up" + "'begin_analyze_healthcare_entities' endpoint is only available for API version V3_1_PREVIEW and up" ) raise error @@ -699,7 +700,7 @@ async def begin_analyze_healthcare_entities( # type: ignore def _analyze_result_callback(self, doc_id_order, task_order, raw_response, _, headers, show_stats=False): analyze_result = self._deserialize( - self._client.models(api_version="v3.1-preview.3").AnalyzeJobState, + self._client.models(api_version="v3.1-preview.4").AnalyzeJobState, raw_response ) return analyze_paged_result( @@ -766,7 +767,7 @@ async def begin_analyze_batch_actions( # type: ignore display_name = kwargs.pop("display_name", None) language_arg = kwargs.pop("language", None) language = language_arg if language_arg is not None else self._default_language - docs = self._client.models(api_version="v3.1-preview.3").MultiLanguageBatchInput( + docs = self._client.models(api_version="v3.1-preview.4").MultiLanguageBatchInput( documents=_validate_input(documents, "language", language) ) show_stats = kwargs.pop("show_stats", False) @@ -777,7 +778,7 @@ async def begin_analyze_batch_actions( # type: ignore task_order = [_determine_action_type(action) for action in actions] try: - analyze_tasks = self._client.models(api_version='v3.1-preview.3').JobManifestTasks( + analyze_tasks = self._client.models(api_version='v3.1-preview.4').JobManifestTasks( entity_recognition_tasks=[ t.to_generated() for t in [a for a in actions if _determine_action_type(a) == AnalyzeBatchActionsType.RECOGNIZE_ENTITIES] @@ -791,7 +792,7 @@ async def begin_analyze_batch_actions( # type: ignore [a for a in actions if _determine_action_type(a) == AnalyzeBatchActionsType.EXTRACT_KEY_PHRASES] ] ) - analyze_body = self._client.models(api_version='v3.1-preview.3').AnalyzeBatchInput( + analyze_body = self._client.models(api_version='v3.1-preview.4').AnalyzeBatchInput( display_name=display_name, tasks=analyze_tasks, analysis_input=docs @@ -814,7 +815,7 @@ async def begin_analyze_batch_actions( # type: ignore except ValueError as error: if "API version v3.0 does not have operation 'begin_analyze'" in str(error): raise ValueError( - "'begin_analyze_batch_actions' endpoint is only available for API version v3.1-preview and up" + "'begin_analyze_batch_actions' endpoint is only available for API version V3_1_PREVIEW and up" ) raise error diff --git a/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_analyze_healthcare_entities_async.py b/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_analyze_healthcare_entities_async.py index 66852a29d2b5..356c5c15cdb8 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_analyze_healthcare_entities_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_analyze_healthcare_entities_async.py @@ -42,15 +42,14 @@ async def analyze_healthcare_entities_async(self): "so we can catalog how much inventory we have" ) print( - "We start out with a list of prescription documents. " - "To simplify matters, we will assume all dosages are in units of mg." + "We start out with a list of prescription documents." ) # [START analyze_healthcare_entities_async] - import re + import os from azure.core.credentials import AzureKeyCredential + from azure.ai.textanalytics import HealthcareEntityRelationType from azure.ai.textanalytics.aio import TextAnalyticsClient - from collections import defaultdict endpoint = os.environ["AZURE_TEXT_ANALYTICS_ENDPOINT"] key = os.environ["AZURE_TEXT_ANALYTICS_KEY"] @@ -75,43 +74,63 @@ async def analyze_healthcare_entities_async(self): result = await poller.result() docs = [doc async for doc in result if not doc.is_error] - print( - "In order to find the total dosage for every mentioned medication, " - "let's create a dict, mapping medication name -> total dosage. " - ) - - medication_to_dosage = defaultdict(int) - - print( - "We will start off by extracting all of the dosage entities." - ) - - dosage_entities = [ - entity - for doc in docs - for entity in doc.entities - if entity.category == "Dosage" - ] - - print( - "Now we traverse the related entities of each dosage entity. " - "We are looking for entities that are related by 'DosageOfMedication'. " - "After that, we're done!" - ) - for dosage in dosage_entities: - dosage_value = int(re.findall(r"\d+", dosage.text)[0]) # we find the numbers in the dosage - for related_entity, relation_type in dosage.related_entities.items(): - if relation_type == "DosageOfMedication": - medication_to_dosage[related_entity.text] += dosage_value - - [ - print("We have fulfilled '{}' total mg of '{}'".format( - dosage, medication - )) - for medication, dosage in medication_to_dosage.items() - ] + print("Let's first visualize the outputted healthcare result:") + for idx, doc in enumerate(docs): + for entity in doc.entities: + print("Entity: {}".format(entity.text)) + print("...Category: {}".format(entity.category)) + print("...Subcategory: {}".format(entity.subcategory)) + print("...Offset: {}".format(entity.offset)) + print("...Confidence score: {}".format(entity.confidence_score)) + if entity.data_sources is not None: + print("...Data Sources:") + for data_source in entity.data_sources: + print("......Entity ID: {}".format(data_source.entity_id)) + print("......Name: {}".format(data_source.name)) + for relation in doc.entity_relations: + print("Relation of type: {} has the following roles".format(relation.relation_type)) + for role in relation.roles: + print("...Role '{}' with entity '{}'".format(role.name, role.entity.text)) + print("------------------------------------------") + + print("Now, let's get all of medication dosage relations from the documents") + dosage_of_medication_relations = [ + entity_relation + for doc in docs + for entity_relation in doc.entity_relations if entity_relation.relation_type == HealthcareEntityRelationType.DOSAGE_OF_MEDICATION + ] # [END analyze_healthcare_entities_async] + print( + "Now, I will create a dictionary of medication to total dosage. " + "I will use a regex to extract the dosage amount. For simplicity sake, I will assume " + "all dosages are represented with numbers and have mg unit." + ) + import re + from collections import defaultdict + + medication_to_dosage = defaultdict(int) + + for relation in dosage_of_medication_relations: + # The DosageOfMedication relation should only contain the dosage and medication roles + + dosage_role = next(filter(lambda x: x.name == "Attribute", relation.roles)) + medication_role = next(filter(lambda x: x.name == "Entity", relation.roles)) + + try: + dosage_value = int(re.findall(r"\d+", dosage_role.entity.text)[0]) # we find the numbers in the dosage + medication_to_dosage[medication_role.entity.text] += dosage_value + except StopIteration: + # Error handling for if there's no dosage in numbers. + pass + + [ + print("We have fulfilled '{}' total mg of '{}'".format( + dosage, medication + )) + for medication, dosage in medication_to_dosage.items() + ] + async def main(): sample = AnalyzeHealthcareEntitiesSampleAsync() await sample.analyze_healthcare_entities_async() diff --git a/sdk/textanalytics/azure-ai-textanalytics/samples/sample_analyze_healthcare_entities.py b/sdk/textanalytics/azure-ai-textanalytics/samples/sample_analyze_healthcare_entities.py index 5ab7e7216058..16ce9e639036 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/samples/sample_analyze_healthcare_entities.py +++ b/sdk/textanalytics/azure-ai-textanalytics/samples/sample_analyze_healthcare_entities.py @@ -29,8 +29,6 @@ """ -import os - class AnalyzeHealthcareEntitiesSample(object): @@ -41,15 +39,13 @@ def analyze_healthcare_entities(self): "so we can catalog how much inventory we have" ) print( - "We start out with a list of prescription documents. " - "To simplify matters, we will assume all dosages are in units of mg." + "We start out with a list of prescription documents." ) # [START analyze_healthcare_entities] - import re + import os from azure.core.credentials import AzureKeyCredential - from azure.ai.textanalytics import TextAnalyticsClient - from collections import defaultdict + from azure.ai.textanalytics import TextAnalyticsClient, HealthcareEntityRelationType endpoint = os.environ["AZURE_TEXT_ANALYTICS_ENDPOINT"] key = os.environ["AZURE_TEXT_ANALYTICS_KEY"] @@ -74,34 +70,55 @@ def analyze_healthcare_entities(self): docs = [doc for doc in result if not doc.is_error] + print("Let's first visualize the outputted healthcare result:") + for idx, doc in enumerate(docs): + for entity in doc.entities: + print("Entity: {}".format(entity.text)) + print("...Category: {}".format(entity.category)) + print("...Subcategory: {}".format(entity.subcategory)) + print("...Offset: {}".format(entity.offset)) + print("...Confidence score: {}".format(entity.confidence_score)) + if entity.data_sources is not None: + print("...Data Sources:") + for data_source in entity.data_sources: + print("......Entity ID: {}".format(data_source.entity_id)) + print("......Name: {}".format(data_source.name)) + for relation in doc.entity_relations: + print("Relation of type: {} has the following roles".format(relation.relation_type)) + for role in relation.roles: + print("...Role '{}' with entity '{}'".format(role.name, role.entity.text)) + print("------------------------------------------") + + print("Now, let's get all of medication dosage relations from the documents") + dosage_of_medication_relations = [ + entity_relation + for doc in docs + for entity_relation in doc.entity_relations if entity_relation.relation_type == HealthcareEntityRelationType.DOSAGE_OF_MEDICATION + ] + # [END analyze_healthcare_entities] + print( - "In order to find the total dosage for every mentioned medication, " - "let's create a dict, mapping medication name -> total dosage. " + "Now, I will create a dictionary of medication to total dosage. " + "I will use a regex to extract the dosage amount. For simplicity sake, I will assume " + "all dosages are represented with numbers and have mg unit." ) + import re + from collections import defaultdict medication_to_dosage = defaultdict(int) - print( - "We will start off by extracting all of the dosage entities." - ) + for relation in dosage_of_medication_relations: + # The DosageOfMedication relation should only contain the dosage and medication roles - dosage_entities = [ - entity - for doc in docs - for entity in doc.entities - if entity.category == "Dosage" - ] + dosage_role = next(filter(lambda x: x.name == "Attribute", relation.roles)) + medication_role = next(filter(lambda x: x.name == "Entity", relation.roles)) - print( - "Now we traverse the related entities of each dosage entity. " - "We are looking for entities that are related by 'DosageOfMedication'. " - "After that, we're done!" - ) - for dosage in dosage_entities: - dosage_value = int(re.findall(r"\d+", dosage.text)[0]) # we find the numbers in the dosage - for related_entity, relation_type in dosage.related_entities.items(): - if relation_type == "DosageOfMedication": - medication_to_dosage[related_entity.text] += dosage_value + try: + dosage_value = int(re.findall(r"\d+", dosage_role.entity.text)[0]) # we find the numbers in the dosage + medication_to_dosage[medication_role.entity.text] += dosage_value + except StopIteration: + # Error handling for if there's no dosage in numbers. + pass [ print("We have fulfilled '{}' total mg of '{}'".format( @@ -109,7 +126,7 @@ def analyze_healthcare_entities(self): )) for medication, dosage in medication_to_dosage.items() ] - # [END analyze_healthcare_entities] + if __name__ == "__main__": sample = AnalyzeHealthcareEntitiesSample() diff --git a/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md b/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md new file mode 100644 index 000000000000..c222831115f2 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md @@ -0,0 +1,90 @@ +# Text Analytics for Python + +To generate this file, simply type + +``` +autorest swagger/README.md +``` + +We automatically hardcode in that this is `python` and `multiapi`. + +## Basic + +```yaml +license-header: MICROSOFT_MIT_NO_VERSION +add-credential: true +payload-flattening-threshold: 2 +package-name: azure-ai-textanalytics +clear-output-folder: true +credential-scopes: https://cognitiveservices.azure.com/.default +no-namespace-folders: true +python: true +multiapi: true +``` + +## Multiapi Batch Execution + +```yaml $(multiapi) +batch: + - tag: release_3_0 + - tag: release_3_1_preview.4 + - multiapiscript: true +``` + +## Multiapiscript + +``` yaml $(multiapiscript) +output-folder: ../azure/ai/textanalytics/_generated/ +default-api: v3_0 +clear-output-folder: false +perform-load: false +``` + +## Release 3.0 + +These settings apply only when `--tag=release_3_0` is specified on the command line. + +``` yaml $(tag) == 'release_3_0' +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json +namespace: azure.ai.textanalytics.v3_0 +output-folder: ../azure/ai/textanalytics/_generated/v3_0 +``` + +## Release 3.1-Preview.4 + +These settings apply only when `--tag=release_3_1_preview.4` is specified on the command line. + +```yaml $(tag) == 'release_3_1_preview.4' +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.4/TextAnalytics.json +namespace: azure.ai.textanalytics.v3_1_preview_4 +output-folder: ../azure/ai/textanalytics/_generated/v3_1_preview_4 +``` + +### Override Analyze's pager and poller + +``` yaml +directive: + - from: swagger-document + where: '$.paths["/analyze"].post' + transform: > + $["responses"]["200"] = {"description": "dummy schema", "schema": {"$ref": "#/definitions/AnalyzeJobState"}}; + $["x-python-custom-poller-sync"] = "...._lro.AnalyzeBatchActionsLROPoller"; + $["x-python-custom-poller-async"] = "....._async_lro.AsyncAnalyzeBatchActionsLROPoller"; + $["x-python-custom-default-polling-method-sync"] = "...._lro.AnalyzeBatchActionsLROPollingMethod"; + $["x-python-custom-default-polling-method-async"] = "....._async_lro.AsyncAnalyzeBatchActionsLROPollingMethod"; +``` + + +### Override Healthcare's pager and poller + +``` yaml +directive: + - from: swagger-document + where: '$.paths["/entities/health/jobs"].post' + transform: > + $["responses"]["200"] = {"description": "dummy schema", "schema": {"$ref": "#/definitions/HealthcareJobState"}}; + $["x-python-custom-poller-sync"] = "...._lro.AnalyzeHealthcareEntitiesLROPoller"; + $["x-python-custom-poller-async"] = "....._async_lro.AnalyzeHealthcareEntitiesAsyncLROPoller"; + $["x-python-custom-default-polling-method-sync"] = "...._lro.AnalyzeHealthcareEntitiesLROPollingMethod"; + $["x-python-custom-default-polling-method-async"] = "....._async_lro.AnalyzeHealthcareEntitiesAsyncLROPollingMethod"; +``` diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_bad_model_version_error.yaml index c7094b25eb1c..8aaabaf583d1 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_bad_model_version_error.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_bad_model_version_error.yaml @@ -16,17 +16,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?model-version=bad&stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?model-version=bad&stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - 2b9cfa0d-8b35-4443-8c7b-7d6d26542c23 + - 1fa4f218-7e3a-4859-99b8-4a3037a62ba1 date: - - Tue, 23 Feb 2021 17:16:26 GMT + - Mon, 01 Mar 2021 19:49:30 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/4d7454fe-2e04-418f-bc0d-ebaa8d48cc90 + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/17a52037-56f8-4055-8a6e-d0d9cc507e4c strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -34,7 +34,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '80' + - '110' status: code: 202 message: Accepted @@ -50,19 +50,53 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/4d7454fe-2e04-418f-bc0d-ebaa8d48cc90 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/17a52037-56f8-4055-8a6e-d0d9cc507e4c response: body: - string: '{"jobId":"4d7454fe-2e04-418f-bc0d-ebaa8d48cc90","lastUpdateDateTime":"2021-02-23T17:16:28Z","createdDateTime":"2021-02-23T17:16:27Z","expirationDateTime":"2021-02-24T17:16:27Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"17a52037-56f8-4055-8a6e-d0d9cc507e4c","lastUpdateDateTime":"2021-03-01T19:49:34Z","createdDateTime":"2021-03-01T19:49:31Z","expirationDateTime":"2021-03-02T19:49:31Z","status":"running","errors":[]}' + headers: + apim-request-id: + - 8d4d744b-557e-4199-b301-f21a9714f46a + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Mar 2021 19:49:36 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '11' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/17a52037-56f8-4055-8a6e-d0d9cc507e4c + response: + body: + string: '{"jobId":"17a52037-56f8-4055-8a6e-d0d9cc507e4c","lastUpdateDateTime":"2021-03-01T19:49:39Z","createdDateTime":"2021-03-01T19:49:31Z","expirationDateTime":"2021-03-02T19:49:31Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid language code. Supported languages: en"}}}],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - 62643ba2-c88a-4eda-b2f6-94d9ffd3ab8a + - 0bd148d7-71f0-45d7-838a-d3130ab93294 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:16:32 GMT + - Mon, 01 Mar 2021 19:49:41 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -70,7 +104,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '28' + - '33' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_bidirectional_relation_type.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_bidirectional_relation_type.yaml deleted file mode 100644 index 30541cc41bb6..000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_bidirectional_relation_type.yaml +++ /dev/null @@ -1,180 +0,0 @@ -interactions: -- request: - body: '{"documents": [{"id": "0", "text": "The patient was diagnosed with Parkinsons - Disease (PD)", "language": "en"}]}' - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '112' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) - method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint - response: - body: - string: '' - headers: - apim-request-id: - - b31d399d-73ba-4ce1-8729-699883e9cfe8 - date: - - Tue, 23 Feb 2021 17:10:34 GMT - operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/9907f2a9-8ec5-40da-8c5c-a9c86053f2f7 - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '299' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) - method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/9907f2a9-8ec5-40da-8c5c-a9c86053f2f7 - response: - body: - string: '{"jobId":"9907f2a9-8ec5-40da-8c5c-a9c86053f2f7","lastUpdateDateTime":"2021-02-23T17:10:34Z","createdDateTime":"2021-02-23T17:10:34Z","expirationDateTime":"2021-02-24T17:10:34Z","status":"notStarted","errors":[]}' - headers: - apim-request-id: - - 1d3ac6d0-cf83-40a6-a396-83146787cb7d - content-type: - - application/json; charset=utf-8 - date: - - Tue, 23 Feb 2021 17:10:39 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '8' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) - method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/9907f2a9-8ec5-40da-8c5c-a9c86053f2f7 - response: - body: - string: '{"jobId":"9907f2a9-8ec5-40da-8c5c-a9c86053f2f7","lastUpdateDateTime":"2021-02-23T17:10:34Z","createdDateTime":"2021-02-23T17:10:34Z","expirationDateTime":"2021-02-24T17:10:34Z","status":"notStarted","errors":[]}' - headers: - apim-request-id: - - 85965b31-3f0b-4cfb-96ac-4155795089af - content-type: - - application/json; charset=utf-8 - date: - - Tue, 23 Feb 2021 17:10:44 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '6' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) - method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/9907f2a9-8ec5-40da-8c5c-a9c86053f2f7 - response: - body: - string: '{"jobId":"9907f2a9-8ec5-40da-8c5c-a9c86053f2f7","lastUpdateDateTime":"2021-02-23T17:10:45Z","createdDateTime":"2021-02-23T17:10:34Z","expirationDateTime":"2021-02-24T17:10:34Z","status":"running","errors":[]}' - headers: - apim-request-id: - - d1b4faf6-7b6d-4b63-bbb6-527de47cdcf6 - content-type: - - application/json; charset=utf-8 - date: - - Tue, 23 Feb 2021 17:10:49 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '7' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) - method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/9907f2a9-8ec5-40da-8c5c-a9c86053f2f7 - response: - body: - string: '{"jobId":"9907f2a9-8ec5-40da-8c5c-a9c86053f2f7","lastUpdateDateTime":"2021-02-23T17:10:50Z","createdDateTime":"2021-02-23T17:10:34Z","expirationDateTime":"2021-02-24T17:10:34Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":31,"length":18,"text":"Parkinsons - Disease","category":"Diagnosis","confidenceScore":1.0,"isNegated":false,"links":[{"dataSource":"UMLS","id":"C0030567"},{"dataSource":"AOD","id":"0000006203"},{"dataSource":"BI","id":"BI00554"},{"dataSource":"CCPSS","id":"1018057"},{"dataSource":"CCS","id":"6.2.1"},{"dataSource":"CCSR_10","id":"NVS004"},{"dataSource":"CHV","id":"0000009319"},{"dataSource":"COSTAR","id":"559"},{"dataSource":"CSP","id":"2057-3689"},{"dataSource":"CST","id":"EXTRAPYR - SYND"},{"dataSource":"ICD10","id":"G20"},{"dataSource":"ICD10AM","id":"G20"},{"dataSource":"ICD10CM","id":"G20"},{"dataSource":"ICD9CM","id":"332.0"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU004748"},{"dataSource":"ICPC2P","id":"N87001"},{"dataSource":"LCH_NW","id":"sh85098115"},{"dataSource":"LNC","id":"MTHU020807"},{"dataSource":"MDR","id":"10061536"},{"dataSource":"MEDCIN","id":"32004"},{"dataSource":"MEDLINEPLUS","id":"85"},{"dataSource":"MSH","id":"D010300"},{"dataSource":"NANDA-I","id":"03003"},{"dataSource":"NCI","id":"C26845"},{"dataSource":"NCI_CELLOSAURUS","id":"C26845"},{"dataSource":"NCI_CPTAC","id":"C26845"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000044140"},{"dataSource":"OMIM","id":"516000"},{"dataSource":"PSY","id":"36720"},{"dataSource":"QMR","id":"R0121461"},{"dataSource":"RAM","id":"DX353"},{"dataSource":"RCD","id":"F12.."},{"dataSource":"SNM","id":"D-8450"},{"dataSource":"SNMI","id":"DA-21012"},{"dataSource":"SNOMEDCT_US","id":"49049000"},{"dataSource":"WHO","id":"0106"}]},{"offset":51,"length":2,"text":"PD","category":"Diagnosis","confidenceScore":1.0,"isNegated":false,"links":[{"dataSource":"UMLS","id":"C0030567"},{"dataSource":"AOD","id":"0000006203"},{"dataSource":"BI","id":"BI00554"},{"dataSource":"CCPSS","id":"1018057"},{"dataSource":"CCS","id":"6.2.1"},{"dataSource":"CCSR_10","id":"NVS004"},{"dataSource":"CHV","id":"0000009319"},{"dataSource":"COSTAR","id":"559"},{"dataSource":"CSP","id":"2057-3689"},{"dataSource":"CST","id":"EXTRAPYR - SYND"},{"dataSource":"ICD10","id":"G20"},{"dataSource":"ICD10AM","id":"G20"},{"dataSource":"ICD10CM","id":"G20"},{"dataSource":"ICD9CM","id":"332.0"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU004748"},{"dataSource":"ICPC2P","id":"N87001"},{"dataSource":"LCH_NW","id":"sh85098115"},{"dataSource":"LNC","id":"MTHU020807"},{"dataSource":"MDR","id":"10061536"},{"dataSource":"MEDCIN","id":"32004"},{"dataSource":"MEDLINEPLUS","id":"85"},{"dataSource":"MSH","id":"D010300"},{"dataSource":"NANDA-I","id":"03003"},{"dataSource":"NCI","id":"C26845"},{"dataSource":"NCI_CELLOSAURUS","id":"C26845"},{"dataSource":"NCI_CPTAC","id":"C26845"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000044140"},{"dataSource":"OMIM","id":"516000"},{"dataSource":"PSY","id":"36720"},{"dataSource":"QMR","id":"R0121461"},{"dataSource":"RAM","id":"DX353"},{"dataSource":"RCD","id":"F12.."},{"dataSource":"SNM","id":"D-8450"},{"dataSource":"SNMI","id":"DA-21012"},{"dataSource":"SNOMEDCT_US","id":"49049000"},{"dataSource":"WHO","id":"0106"}]}],"relations":[{"relationType":"Abbreviation","bidirectional":true,"source":"#/results/documents/0/entities/0","target":"#/results/documents/0/entities/1"}],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' - headers: - apim-request-id: - - a79453c0-28a3-4f8d-95e0-c171c4a445e3 - content-type: - - application/json; charset=utf-8 - date: - - Tue, 23 Feb 2021 17:10:54 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '196' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_cancellation.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_cancellation.yaml index 71a7e9b2db09..5317af6c5b74 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_cancellation.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_cancellation.yaml @@ -21,17 +21,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - 6f895b66-20aa-40be-861e-5215b9b21faa + - fac8a894-080c-421a-a57f-77f68f8bff7b date: - - Tue, 23 Feb 2021 17:11:18 GMT + - Mon, 01 Mar 2021 19:49:33 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/49f56938-477a-4042-b488-789d6f482324 + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/89062eee-7c37-4d62-8e05-78c5cd0f4fc3 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -39,7 +39,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '754' + - '202' status: code: 202 message: Accepted @@ -55,17 +55,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/49f56938-477a-4042-b488-789d6f482324 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/89062eee-7c37-4d62-8e05-78c5cd0f4fc3 response: body: - string: '{"jobId":"49f56938-477a-4042-b488-789d6f482324","lastUpdateDateTime":"2021-02-23T17:11:20Z","createdDateTime":"2021-02-23T17:11:17Z","expirationDateTime":"2021-02-24T17:11:17Z","status":"running","errors":[]}' + string: '{"jobId":"89062eee-7c37-4d62-8e05-78c5cd0f4fc3","lastUpdateDateTime":"2021-03-01T19:49:34Z","createdDateTime":"2021-03-01T19:49:33Z","expirationDateTime":"2021-03-02T19:49:33Z","status":"notStarted","errors":[]}' headers: apim-request-id: - - dbe3823a-199b-43d3-a038-14acb24e4f34 + - 519da5fd-36e9-4dd8-a97d-3b382792948e content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:11:23 GMT + - Mon, 01 Mar 2021 19:49:38 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -89,27 +89,27 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/49f56938-477a-4042-b488-789d6f482324 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/89062eee-7c37-4d62-8e05-78c5cd0f4fc3 response: body: - string: '{"jobId":"49f56938-477a-4042-b488-789d6f482324","lastUpdateDateTime":"2021-02-23T17:11:25Z","createdDateTime":"2021-02-23T17:11:17Z","expirationDateTime":"2021-02-24T17:11:17Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"1","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"2","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"3","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"4","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"5","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"6","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"7","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"8","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"9","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"89062eee-7c37-4d62-8e05-78c5cd0f4fc3","lastUpdateDateTime":"2021-03-01T19:49:40Z","createdDateTime":"2021-03-01T19:49:33Z","expirationDateTime":"2021-03-02T19:49:33Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"1","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"2","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"3","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"4","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"5","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"6","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"7","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"8","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"9","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - 3bfa4b64-5133-435c-a772-c73171344199 + - 0011b220-18fb-45ad-9870-c4bb1a75536e content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:11:28 GMT + - Mon, 01 Mar 2021 19:49:44 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -117,7 +117,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '117' + - '97' status: code: 200 message: OK @@ -133,27 +133,27 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/49f56938-477a-4042-b488-789d6f482324 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/89062eee-7c37-4d62-8e05-78c5cd0f4fc3 response: body: - string: '{"jobId":"49f56938-477a-4042-b488-789d6f482324","lastUpdateDateTime":"2021-02-23T17:11:25Z","createdDateTime":"2021-02-23T17:11:17Z","expirationDateTime":"2021-02-24T17:11:17Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"1","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"2","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"3","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"4","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"5","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"6","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"7","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"8","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]},{"id":"9","entities":[{"offset":0,"length":11,"text":"hello - world","category":"SymptomOrSign","confidenceScore":0.57,"isNegated":false}],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"89062eee-7c37-4d62-8e05-78c5cd0f4fc3","lastUpdateDateTime":"2021-03-01T19:49:40Z","createdDateTime":"2021-03-01T19:49:33Z","expirationDateTime":"2021-03-02T19:49:33Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"1","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"2","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"3","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"4","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"5","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"6","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"7","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"8","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]},{"id":"9","entities":[{"offset":0,"length":11,"text":"hello + world","category":"SymptomOrSign","confidenceScore":0.57}],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - b556969b-fe82-4a67-9602-54a71224fb3e + - 58c61a1a-cd95-4a87-b61b-569b281fc04c content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:11:28 GMT + - Mon, 01 Mar 2021 19:49:44 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -161,7 +161,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '104' + - '89' status: code: 200 message: OK @@ -179,18 +179,18 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: DELETE - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/49f56938-477a-4042-b488-789d6f482324 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/89062eee-7c37-4d62-8e05-78c5cd0f4fc3 response: body: string: '{"error":{"code":"InvalidRequest","message":"Failed to cancel job with - job id 49f56938-477a-4042-b488-789d6f482324 as its already completed."}}' + job id 89062eee-7c37-4d62-8e05-78c5cd0f4fc3 as its already completed."}}' headers: apim-request-id: - - 8201b31e-d687-4a76-b3fb-e41866ba3f90 + - 7ae72599-1692-4c74-a19c-31aa7fb822de content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:11:28 GMT + - Mon, 01 Mar 2021 19:49:44 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -198,7 +198,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '101' + - '8' status: code: 400 message: Bad Request diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_default_string_index_type_is_UnicodeCodePoint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_default_string_index_type_is_UnicodeCodePoint.yaml index d29d12fd7b93..ca5bb9f456a8 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_default_string_index_type_is_UnicodeCodePoint.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_default_string_index_type_is_UnicodeCodePoint.yaml @@ -15,17 +15,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - a2187771-5234-4f05-9817-406be9ce4e06 + - 45eacdf3-6d75-4a0b-92c4-3cf3a0c8305c date: - - Tue, 23 Feb 2021 17:13:03 GMT + - Mon, 01 Mar 2021 19:49:32 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/9d649086-7c27-486f-839d-272e6e7518b7 + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/6c35f8d1-fed8-4276-bcff-1589b2abfba6 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -33,7 +33,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '153' + - '395' status: code: 202 message: Accepted @@ -49,17 +49,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/9d649086-7c27-486f-839d-272e6e7518b7 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/6c35f8d1-fed8-4276-bcff-1589b2abfba6 response: body: - string: '{"jobId":"9d649086-7c27-486f-839d-272e6e7518b7","lastUpdateDateTime":"2021-02-23T17:13:06Z","createdDateTime":"2021-02-23T17:13:03Z","expirationDateTime":"2021-02-24T17:13:03Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"6c35f8d1-fed8-4276-bcff-1589b2abfba6","lastUpdateDateTime":"2021-03-01T19:49:34Z","createdDateTime":"2021-03-01T19:49:32Z","expirationDateTime":"2021-03-02T19:49:32Z","status":"running","errors":[]}' headers: apim-request-id: - - 2ed463cf-a7c6-4a92-865d-705658bd1273 + - ec99cd97-53b2-4a05-9818-18e6d0a97271 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:13:08 GMT + - Mon, 01 Mar 2021 19:49:38 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -67,7 +67,41 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '27' + - '6' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/6c35f8d1-fed8-4276-bcff-1589b2abfba6 + response: + body: + string: '{"jobId":"6c35f8d1-fed8-4276-bcff-1589b2abfba6","lastUpdateDateTime":"2021-03-01T19:49:39Z","createdDateTime":"2021-03-01T19:49:32Z","expirationDateTime":"2021-03-02T19:49:32Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + headers: + apim-request-id: + - c3392aa3-f4bc-4f75-8a17-016805dd3661 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Mar 2021 19:49:42 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '30' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_document_attribute_error_no_result_attribute.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_document_attribute_error_no_result_attribute.yaml index 5a8ae32cdcd7..2457275bc444 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_document_attribute_error_no_result_attribute.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_document_attribute_error_no_result_attribute.yaml @@ -15,17 +15,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - 162dd39b-d0e2-4c93-8c92-22e29dbc609d + - 0b3050fc-edc9-49e4-b163-9cf6d2bd2883 date: - - Tue, 23 Feb 2021 17:06:55 GMT + - Mon, 01 Mar 2021 19:49:31 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/67f822ae-c86d-427f-90d5-e0752eea6ab3 + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/ba50b079-ad21-49c9-a6ed-59ad7d5d9a39 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -33,7 +33,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '122' + - '123' status: code: 202 message: Accepted @@ -49,19 +49,19 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/67f822ae-c86d-427f-90d5-e0752eea6ab3 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/ba50b079-ad21-49c9-a6ed-59ad7d5d9a39 response: body: - string: '{"jobId":"67f822ae-c86d-427f-90d5-e0752eea6ab3","lastUpdateDateTime":"2021-02-23T17:06:58Z","createdDateTime":"2021-02-23T17:06:55Z","expirationDateTime":"2021-02-24T17:06:55Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"ba50b079-ad21-49c9-a6ed-59ad7d5d9a39","lastUpdateDateTime":"2021-03-01T19:49:34Z","createdDateTime":"2021-03-01T19:49:32Z","expirationDateTime":"2021-03-02T19:49:32Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}}],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - 7d908504-e5dc-4fec-b2e0-9ef8c52670b0 + - 24a6567e-e2ec-4596-b56e-20d54af95254 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:07:00 GMT + - Mon, 01 Mar 2021 19:49:36 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -69,7 +69,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '96' + - '32' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_document_errors.yaml index c93e3eb13ecf..7afeafa743f0 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_document_errors.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_document_errors.yaml @@ -18,17 +18,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - 577f7490-1b75-4fad-88d6-163259d7cae7 + - e42f44d2-e413-4fdb-88f4-c0f81ad04cfc date: - - Tue, 23 Feb 2021 17:13:33 GMT + - Mon, 01 Mar 2021 19:49:32 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/34a9fe11-47c3-4939-98f7-c411b610d2d0 + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/c572da83-cb37-4f21-91f4-c0f8ef400134 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -36,7 +36,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '364' + - '110' status: code: 202 message: Accepted @@ -52,10 +52,44 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/34a9fe11-47c3-4939-98f7-c411b610d2d0 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/c572da83-cb37-4f21-91f4-c0f8ef400134 response: body: - string: '{"jobId":"34a9fe11-47c3-4939-98f7-c411b610d2d0","lastUpdateDateTime":"2021-02-23T17:13:36Z","createdDateTime":"2021-02-23T17:13:33Z","expirationDateTime":"2021-02-24T17:13:33Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"c572da83-cb37-4f21-91f4-c0f8ef400134","lastUpdateDateTime":"2021-03-01T19:49:33Z","createdDateTime":"2021-03-01T19:49:33Z","expirationDateTime":"2021-03-02T19:49:33Z","status":"notStarted","errors":[]}' + headers: + apim-request-id: + - e95bb8ff-6986-424d-91f2-3560345834f2 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Mar 2021 19:49:37 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '6' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/c572da83-cb37-4f21-91f4-c0f8ef400134 + response: + body: + string: '{"jobId":"c572da83-cb37-4f21-91f4-c0f8ef400134","lastUpdateDateTime":"2021-03-01T19:49:39Z","createdDateTime":"2021-03-01T19:49:33Z","expirationDateTime":"2021-03-02T19:49:33Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid @@ -66,11 +100,11 @@ interactions: see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - 7b094d6d-cd8a-4d0e-9c1a-abe3b43e6148 + - b00829de-bfc0-4be0-9ccd-e1aa0fc19171 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:13:39 GMT + - Mon, 01 Mar 2021 19:49:42 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -78,7 +112,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '59' + - '42' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_duplicate_ids_error.yaml index 40a139eec281..b7132dc0f447 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_duplicate_ids_error.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_duplicate_ids_error.yaml @@ -16,18 +16,18 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request contains duplicated Ids. Make sure each document has a unique Id."}}}' headers: apim-request-id: - - d03940af-a907-4382-9f41-71dd98e2b75d + - eaedbaa3-f4cc-4fd3-9c16-e2957bb3ef55 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:16:32 GMT + - Mon, 01 Mar 2021 19:49:41 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -35,7 +35,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '5' + - '4' status: code: 400 message: Bad Request diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_explicit_set_string_index_type.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_explicit_set_string_index_type.yaml index 7f9c1d6a1b2d..85e94c1f3355 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_explicit_set_string_index_type.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_explicit_set_string_index_type.yaml @@ -15,17 +15,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=TextElements_v8 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=TextElements_v8 response: body: string: '' headers: apim-request-id: - - dbca7d5c-308e-40b3-a419-04a0ec56a18e + - a28758cb-0702-49fa-ab39-23420fa9c6b2 date: - - Tue, 23 Feb 2021 17:10:55 GMT + - Mon, 01 Mar 2021 19:49:42 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/f79bde93-4941-4ae5-a019-60f2a18978cf + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/4bf6c182-ede8-41a7-9036-baeb0a1cdd07 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -33,7 +33,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '92' + - '110' status: code: 202 message: Accepted @@ -49,17 +49,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/f79bde93-4941-4ae5-a019-60f2a18978cf + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/4bf6c182-ede8-41a7-9036-baeb0a1cdd07 response: body: - string: '{"jobId":"f79bde93-4941-4ae5-a019-60f2a18978cf","lastUpdateDateTime":"2021-02-23T17:10:56Z","createdDateTime":"2021-02-23T17:10:56Z","expirationDateTime":"2021-02-24T17:10:56Z","status":"notStarted","errors":[]}' + string: '{"jobId":"4bf6c182-ede8-41a7-9036-baeb0a1cdd07","lastUpdateDateTime":"2021-03-01T19:49:44Z","createdDateTime":"2021-03-01T19:49:42Z","expirationDateTime":"2021-03-02T19:49:42Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - df05aebc-9ef0-497b-a848-c92ec4a3c8de + - 8b5f1bc3-1b9b-419c-ac4c-295b765b3556 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:11:00 GMT + - Mon, 01 Mar 2021 19:49:47 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -67,41 +67,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '38' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) - method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/f79bde93-4941-4ae5-a019-60f2a18978cf - response: - body: - string: '{"jobId":"f79bde93-4941-4ae5-a019-60f2a18978cf","lastUpdateDateTime":"2021-02-23T17:11:03Z","createdDateTime":"2021-02-23T17:10:56Z","expirationDateTime":"2021-02-24T17:10:56Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' - headers: - apim-request-id: - - 380a696a-8ff4-448d-8dcd-6e0c6d425f54 - content-type: - - application/json; charset=utf-8 - date: - - Tue, 23 Feb 2021 17:11:05 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '66' + - '27' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_input_with_some_errors.yaml index a379c51b0cb8..51a859a27084 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_input_with_some_errors.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_input_with_some_errors.yaml @@ -18,17 +18,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - 9fe5658d-9a1b-4bfa-97c6-6b7d7e30bf59 + - a33e7204-6351-4a23-b5f2-85adabec5411 date: - - Tue, 23 Feb 2021 17:11:29 GMT + - Mon, 01 Mar 2021 19:49:45 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/a5bf4589-a7d1-4800-9b98-a07f28edf719 + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/1c30a66e-2444-4c13-a74a-f6db32aa3125 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -36,7 +36,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '109' + - '119' status: code: 202 message: Accepted @@ -52,22 +52,22 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/a5bf4589-a7d1-4800-9b98-a07f28edf719 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/1c30a66e-2444-4c13-a74a-f6db32aa3125 response: body: - string: '{"jobId":"a5bf4589-a7d1-4800-9b98-a07f28edf719","lastUpdateDateTime":"2021-02-23T17:11:31Z","createdDateTime":"2021-02-23T17:11:29Z","expirationDateTime":"2021-02-24T17:11:29Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"3","entities":[{"offset":11,"length":5,"text":"100mg","category":"Dosage","confidenceScore":0.98,"isNegated":false},{"offset":17,"length":9,"text":"ibuprofen","category":"MedicationName","confidenceScore":1.0,"isNegated":false,"links":[{"dataSource":"UMLS","id":"C0020740"},{"dataSource":"AOD","id":"0000019879"},{"dataSource":"ATC","id":"M01AE01"},{"dataSource":"CCPSS","id":"0046165"},{"dataSource":"CHV","id":"0000006519"},{"dataSource":"CSP","id":"2270-2077"},{"dataSource":"DRUGBANK","id":"DB01050"},{"dataSource":"GS","id":"1611"},{"dataSource":"LCH_NW","id":"sh97005926"},{"dataSource":"LNC","id":"LP16165-0"},{"dataSource":"MEDCIN","id":"40458"},{"dataSource":"MMSL","id":"d00015"},{"dataSource":"MSH","id":"D007052"},{"dataSource":"MTHSPL","id":"WK2XYI10QM"},{"dataSource":"NCI","id":"C561"},{"dataSource":"NCI_CTRP","id":"C561"},{"dataSource":"NCI_DCP","id":"00803"},{"dataSource":"NCI_DTP","id":"NSC0256857"},{"dataSource":"NCI_FDA","id":"WK2XYI10QM"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000613511"},{"dataSource":"NDDF","id":"002377"},{"dataSource":"PDQ","id":"CDR0000040475"},{"dataSource":"RCD","id":"x02MO"},{"dataSource":"RXNORM","id":"5640"},{"dataSource":"SNM","id":"E-7772"},{"dataSource":"SNMI","id":"C-603C0"},{"dataSource":"SNOMEDCT_US","id":"387207008"},{"dataSource":"USP","id":"m39860"},{"dataSource":"USPMG","id":"MTHU000060"},{"dataSource":"VANDF","id":"4017840"}]},{"offset":34,"length":11,"text":"twice - daily","category":"Frequency","confidenceScore":1.0,"isNegated":false}],"relations":[{"relationType":"DosageOfMedication","bidirectional":false,"source":"#/results/documents/0/entities/0","target":"#/results/documents/0/entities/1"},{"relationType":"FrequencyOfMedication","bidirectional":false,"source":"#/results/documents/0/entities/2","target":"#/results/documents/0/entities/1"}],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"1c30a66e-2444-4c13-a74a-f6db32aa3125","lastUpdateDateTime":"2021-03-01T19:49:50Z","createdDateTime":"2021-03-01T19:49:45Z","expirationDateTime":"2021-03-02T19:49:45Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"3","entities":[{"offset":11,"length":5,"text":"100mg","category":"Dosage","confidenceScore":0.98},{"offset":17,"length":9,"text":"ibuprofen","category":"MedicationName","confidenceScore":1.0,"links":[{"dataSource":"UMLS","id":"C0020740"},{"dataSource":"AOD","id":"0000019879"},{"dataSource":"ATC","id":"M01AE01"},{"dataSource":"CCPSS","id":"0046165"},{"dataSource":"CHV","id":"0000006519"},{"dataSource":"CSP","id":"2270-2077"},{"dataSource":"DRUGBANK","id":"DB01050"},{"dataSource":"GS","id":"1611"},{"dataSource":"LCH_NW","id":"sh97005926"},{"dataSource":"LNC","id":"LP16165-0"},{"dataSource":"MEDCIN","id":"40458"},{"dataSource":"MMSL","id":"d00015"},{"dataSource":"MSH","id":"D007052"},{"dataSource":"MTHSPL","id":"WK2XYI10QM"},{"dataSource":"NCI","id":"C561"},{"dataSource":"NCI_CTRP","id":"C561"},{"dataSource":"NCI_DCP","id":"00803"},{"dataSource":"NCI_DTP","id":"NSC0256857"},{"dataSource":"NCI_FDA","id":"WK2XYI10QM"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000613511"},{"dataSource":"NDDF","id":"002377"},{"dataSource":"PDQ","id":"CDR0000040475"},{"dataSource":"RCD","id":"x02MO"},{"dataSource":"RXNORM","id":"5640"},{"dataSource":"SNM","id":"E-7772"},{"dataSource":"SNMI","id":"C-603C0"},{"dataSource":"SNOMEDCT_US","id":"387207008"},{"dataSource":"USP","id":"m39860"},{"dataSource":"USPMG","id":"MTHU000060"},{"dataSource":"VANDF","id":"4017840"}]},{"offset":34,"length":11,"text":"twice + daily","category":"Frequency","confidenceScore":1.0}],"relations":[{"relationType":"DosageOfMedication","entities":[{"ref":"#/results/documents/0/entities/0","role":"Attribute"},{"ref":"#/results/documents/0/entities/1","role":"Entity"}]},{"relationType":"FrequencyOfMedication","entities":[{"ref":"#/results/documents/0/entities/1","role":"Entity"},{"ref":"#/results/documents/0/entities/2","role":"Attribute"}]}],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid language code. Supported languages: en"}}}],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - ccb9fa1c-7473-43bf-a938-46d298803bde + - c0c36961-9dbd-4cb5-a05c-59223fefeef6 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:11:34 GMT + - Mon, 01 Mar 2021 19:49:49 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -75,7 +75,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '66' + - '43' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_invalid_language_hint_docs.yaml index 97ae37e8c62e..505347c5db21 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_invalid_language_hint_docs.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_invalid_language_hint_docs.yaml @@ -16,17 +16,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - c1b2509c-7c40-425d-96d3-ca153a4595d2 + - ad31f8ac-d832-4825-ba0d-dc44dabf0a6e date: - - Tue, 23 Feb 2021 17:13:08 GMT + - Mon, 01 Mar 2021 19:49:43 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/2c77d7b3-24a8-4631-b99c-6bd14b2c4e5d + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/d8dbd9e5-b538-4ab4-a82e-240cd6418838 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -34,7 +34,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '230' + - '91' status: code: 202 message: Accepted @@ -50,19 +50,53 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/2c77d7b3-24a8-4631-b99c-6bd14b2c4e5d + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/d8dbd9e5-b538-4ab4-a82e-240cd6418838 response: body: - string: '{"jobId":"2c77d7b3-24a8-4631-b99c-6bd14b2c4e5d","lastUpdateDateTime":"2021-02-23T17:13:11Z","createdDateTime":"2021-02-23T17:13:09Z","expirationDateTime":"2021-02-24T17:13:09Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"d8dbd9e5-b538-4ab4-a82e-240cd6418838","lastUpdateDateTime":"2021-03-01T19:49:44Z","createdDateTime":"2021-03-01T19:49:43Z","expirationDateTime":"2021-03-02T19:49:43Z","status":"running","errors":[]}' + headers: + apim-request-id: + - 847d2558-e952-41ca-89a2-612315a4e9d6 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Mar 2021 19:49:49 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '6' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/d8dbd9e5-b538-4ab4-a82e-240cd6418838 + response: + body: + string: '{"jobId":"d8dbd9e5-b538-4ab4-a82e-240cd6418838","lastUpdateDateTime":"2021-03-01T19:49:49Z","createdDateTime":"2021-03-01T19:49:43Z","expirationDateTime":"2021-03-02T19:49:43Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid language code. Supported languages: en"}}}],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - 295445b3-b048-4ce6-962c-0f84f25f0ac3 + - f5ca99e7-94b2-4d5b-988c-f71a5c1ae71f content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:13:14 GMT + - Mon, 01 Mar 2021 19:49:54 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -70,7 +104,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '118' + - '91' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_invalid_language_hint_method.yaml index 9af1b2e0cc83..5d3953f0a048 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_invalid_language_hint_method.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_invalid_language_hint_method.yaml @@ -16,17 +16,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - a6abe2fa-2dbc-4712-a402-b34dcaad90db + - 38f786ac-4224-4f4a-b0fa-dd10c31040c4 date: - - Tue, 23 Feb 2021 17:07:00 GMT + - Mon, 01 Mar 2021 19:49:37 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/01cf0ea9-e89b-4842-9d0d-3a1713455b2d + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/a188ecdf-87df-4428-b18a-59b4cc2bb18c strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -34,7 +34,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '197' + - '128' status: code: 202 message: Accepted @@ -50,19 +50,19 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/01cf0ea9-e89b-4842-9d0d-3a1713455b2d + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/a188ecdf-87df-4428-b18a-59b4cc2bb18c response: body: - string: '{"jobId":"01cf0ea9-e89b-4842-9d0d-3a1713455b2d","lastUpdateDateTime":"2021-02-23T17:07:03Z","createdDateTime":"2021-02-23T17:07:01Z","expirationDateTime":"2021-02-24T17:07:01Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"a188ecdf-87df-4428-b18a-59b4cc2bb18c","lastUpdateDateTime":"2021-03-01T19:49:39Z","createdDateTime":"2021-03-01T19:49:37Z","expirationDateTime":"2021-03-02T19:49:37Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid language code. Supported languages: en"}}}],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - fd130f2d-434f-4493-bc4b-630615110e1e + - c69f6409-b807-4bdb-b51b-2f640e3d08d9 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:07:06 GMT + - Mon, 01 Mar 2021 19:49:42 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -70,7 +70,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '31' + - '32' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_out_of_order_ids.yaml index 0a8d39ac9fba..ec2595d38903 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_out_of_order_ids.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_out_of_order_ids.yaml @@ -18,17 +18,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - a9e1ff38-cb21-4cc4-9cfa-8b385c109b7b + - ca616c54-d06e-4102-9aa2-9becc4357bbf date: - - Tue, 23 Feb 2021 18:57:11 GMT + - Mon, 01 Mar 2021 19:49:43 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/8ccfeb2e-9d54-48b0-9061-91dd73043c39 + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/d8f3c0c8-e8f8-4647-a22f-19113e1b9b3c strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -36,7 +36,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '764' + - '191' status: code: 202 message: Accepted @@ -52,53 +52,19 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/8ccfeb2e-9d54-48b0-9061-91dd73043c39 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/d8f3c0c8-e8f8-4647-a22f-19113e1b9b3c response: body: - string: '{"jobId":"8ccfeb2e-9d54-48b0-9061-91dd73043c39","lastUpdateDateTime":"2021-02-23T18:57:15Z","createdDateTime":"2021-02-23T18:57:11Z","expirationDateTime":"2021-02-24T18:57:11Z","status":"running","errors":[]}' - headers: - apim-request-id: - - 39875fdd-67ae-4d99-bbcb-59d1e017aeaf - content-type: - - application/json; charset=utf-8 - date: - - Tue, 23 Feb 2021 18:57:16 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '172' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) - method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/8ccfeb2e-9d54-48b0-9061-91dd73043c39 - response: - body: - string: '{"jobId":"8ccfeb2e-9d54-48b0-9061-91dd73043c39","lastUpdateDateTime":"2021-02-23T18:57:21Z","createdDateTime":"2021-02-23T18:57:11Z","expirationDateTime":"2021-02-24T18:57:11Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"56","entities":[],"relations":[],"warnings":[]},{"id":"0","entities":[],"relations":[],"warnings":[]},{"id":"19","entities":[],"relations":[],"warnings":[]},{"id":"1","entities":[],"relations":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"d8f3c0c8-e8f8-4647-a22f-19113e1b9b3c","lastUpdateDateTime":"2021-03-01T19:49:45Z","createdDateTime":"2021-03-01T19:49:43Z","expirationDateTime":"2021-03-02T19:49:43Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"56","entities":[],"relations":[],"warnings":[]},{"id":"0","entities":[],"relations":[],"warnings":[]},{"id":"19","entities":[],"relations":[],"warnings":[]},{"id":"1","entities":[],"relations":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}}],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - 4a679f07-fcf6-4e3e-9394-dff1248624ca + - 9e00b281-93a0-4add-b304-c352618a5144 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 18:57:22 GMT + - Mon, 01 Mar 2021 19:49:48 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -106,7 +72,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '267' + - '64' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_pass_cls.yaml index bd3f97be599a..da819c504386 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_pass_cls.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_pass_cls.yaml @@ -16,17 +16,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - d5acaf7b-d1fb-4b9e-b157-3bab883df839 + - 4e689706-4e88-4c29-813b-097ce878a8e6 date: - - Tue, 23 Feb 2021 17:11:06 GMT + - Mon, 01 Mar 2021 19:49:42 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/bd7b6be9-48c9-4593-9a69-7724743715cf + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/ff608e44-6583-4f19-ba9e-4fc3bdfef7d4 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -34,7 +34,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '77' + - '99' status: code: 202 message: Accepted @@ -50,18 +50,18 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/bd7b6be9-48c9-4593-9a69-7724743715cf + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/ff608e44-6583-4f19-ba9e-4fc3bdfef7d4 response: body: - string: '{"jobId":"bd7b6be9-48c9-4593-9a69-7724743715cf","lastUpdateDateTime":"2021-02-23T17:11:08Z","createdDateTime":"2021-02-23T17:11:06Z","expirationDateTime":"2021-02-24T17:11:06Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":5,"length":11,"text":"passing - cls","category":"Diagnosis","confidenceScore":0.93,"isNegated":false}],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"ff608e44-6583-4f19-ba9e-4fc3bdfef7d4","lastUpdateDateTime":"2021-03-01T19:49:44Z","createdDateTime":"2021-03-01T19:49:42Z","expirationDateTime":"2021-03-02T19:49:42Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":5,"length":11,"text":"passing + cls","category":"Diagnosis","confidenceScore":0.93}],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - fdd02924-a0ad-4944-a00f-b0f5bd5f2c47 + - a6cac610-faec-455d-bc07-42a8030eeb6f content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:11:11 GMT + - Mon, 01 Mar 2021 19:49:47 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -69,7 +69,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '33' + - '31' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_passing_only_string.yaml index 24732057dd15..b7134e42cdc7 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_passing_only_string.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_passing_only_string.yaml @@ -18,17 +18,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - fc0d4281-f23e-4e79-abc7-834e9212b699 + - 5ed9e5b6-8a76-48ae-90b0-8fc829f0980f date: - - Tue, 23 Feb 2021 17:11:35 GMT + - Mon, 01 Mar 2021 19:49:47 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/82551125-8ffc-4b84-b1e9-b30ddc65e98c + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/4ef2080f-80e8-476b-95c3-2cb94e4a619e strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -36,7 +36,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '173' + - '129' status: code: 202 message: Accepted @@ -52,21 +52,55 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/82551125-8ffc-4b84-b1e9-b30ddc65e98c + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/4ef2080f-80e8-476b-95c3-2cb94e4a619e response: body: - string: '{"jobId":"82551125-8ffc-4b84-b1e9-b30ddc65e98c","lastUpdateDateTime":"2021-02-23T17:11:35Z","createdDateTime":"2021-02-23T17:11:35Z","expirationDateTime":"2021-02-24T17:11:35Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":29,"length":19,"text":"high - blood pressure","category":"Diagnosis","confidenceScore":1.0,"isNegated":true,"links":[{"dataSource":"UMLS","id":"C0020538"},{"dataSource":"AOD","id":"0000023317"},{"dataSource":"BI","id":"BI00001"},{"dataSource":"CCPSS","id":"1017493"},{"dataSource":"CCS","id":"7.1"},{"dataSource":"CHV","id":"0000015800"},{"dataSource":"COSTAR","id":"397"},{"dataSource":"CSP","id":"0571-5243"},{"dataSource":"CST","id":"HYPERTENS"},{"dataSource":"DXP","id":"U002034"},{"dataSource":"HPO","id":"HP:0000822"},{"dataSource":"ICD10","id":"I10-I15.9"},{"dataSource":"ICD10AM","id":"I10-I15.9"},{"dataSource":"ICD10CM","id":"I10"},{"dataSource":"ICD9CM","id":"997.91"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU035456"},{"dataSource":"ICPC2P","id":"K85004"},{"dataSource":"LCH","id":"U002317"},{"dataSource":"LCH_NW","id":"sh85063723"},{"dataSource":"LNC","id":"LA14293-7"},{"dataSource":"MDR","id":"10020772"},{"dataSource":"MEDCIN","id":"33288"},{"dataSource":"MEDLINEPLUS","id":"34"},{"dataSource":"MSH","id":"D006973"},{"dataSource":"MTH","id":"005"},{"dataSource":"MTHICD9","id":"997.91"},{"dataSource":"NANDA-I","id":"00905"},{"dataSource":"NCI","id":"C3117"},{"dataSource":"NCI_CPTAC","id":"C3117"},{"dataSource":"NCI_CTCAE","id":"E13785"},{"dataSource":"NCI_CTRP","id":"C3117"},{"dataSource":"NCI_FDA","id":"1908"},{"dataSource":"NCI_GDC","id":"C3117"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000458091"},{"dataSource":"NCI_NICHD","id":"C3117"},{"dataSource":"NOC","id":"060808"},{"dataSource":"OMIM","id":"MTHU002068"},{"dataSource":"PCDS","id":"PRB_11000.06"},{"dataSource":"PDQ","id":"CDR0000686951"},{"dataSource":"PSY","id":"23830"},{"dataSource":"RCD","id":"XE0Ub"},{"dataSource":"SNM","id":"F-70700"},{"dataSource":"SNMI","id":"D3-02000"},{"dataSource":"SNOMEDCT_US","id":"38341003"},{"dataSource":"WHO","id":"0210"}]}],"relations":[],"warnings":[]},{"id":"1","entities":[{"offset":11,"length":5,"text":"100mg","category":"Dosage","confidenceScore":0.98,"isNegated":false},{"offset":17,"length":9,"text":"ibuprofen","category":"MedicationName","confidenceScore":1.0,"isNegated":false,"links":[{"dataSource":"UMLS","id":"C0020740"},{"dataSource":"AOD","id":"0000019879"},{"dataSource":"ATC","id":"M01AE01"},{"dataSource":"CCPSS","id":"0046165"},{"dataSource":"CHV","id":"0000006519"},{"dataSource":"CSP","id":"2270-2077"},{"dataSource":"DRUGBANK","id":"DB01050"},{"dataSource":"GS","id":"1611"},{"dataSource":"LCH_NW","id":"sh97005926"},{"dataSource":"LNC","id":"LP16165-0"},{"dataSource":"MEDCIN","id":"40458"},{"dataSource":"MMSL","id":"d00015"},{"dataSource":"MSH","id":"D007052"},{"dataSource":"MTHSPL","id":"WK2XYI10QM"},{"dataSource":"NCI","id":"C561"},{"dataSource":"NCI_CTRP","id":"C561"},{"dataSource":"NCI_DCP","id":"00803"},{"dataSource":"NCI_DTP","id":"NSC0256857"},{"dataSource":"NCI_FDA","id":"WK2XYI10QM"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000613511"},{"dataSource":"NDDF","id":"002377"},{"dataSource":"PDQ","id":"CDR0000040475"},{"dataSource":"RCD","id":"x02MO"},{"dataSource":"RXNORM","id":"5640"},{"dataSource":"SNM","id":"E-7772"},{"dataSource":"SNMI","id":"C-603C0"},{"dataSource":"SNOMEDCT_US","id":"387207008"},{"dataSource":"USP","id":"m39860"},{"dataSource":"USPMG","id":"MTHU000060"},{"dataSource":"VANDF","id":"4017840"}]},{"offset":34,"length":11,"text":"twice - daily","category":"Frequency","confidenceScore":1.0,"isNegated":false}],"relations":[{"relationType":"DosageOfMedication","bidirectional":false,"source":"#/results/documents/1/entities/0","target":"#/results/documents/1/entities/1"},{"relationType":"FrequencyOfMedication","bidirectional":false,"source":"#/results/documents/1/entities/2","target":"#/results/documents/1/entities/1"}],"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"4ef2080f-80e8-476b-95c3-2cb94e4a619e","lastUpdateDateTime":"2021-03-01T19:49:48Z","createdDateTime":"2021-03-01T19:49:48Z","expirationDateTime":"2021-03-02T19:49:48Z","status":"notStarted","errors":[]}' + headers: + apim-request-id: + - d2991024-4914-4041-9bc2-05f6eb2188ea + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Mar 2021 19:49:52 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '9' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/4ef2080f-80e8-476b-95c3-2cb94e4a619e + response: + body: + string: '{"jobId":"4ef2080f-80e8-476b-95c3-2cb94e4a619e","lastUpdateDateTime":"2021-03-01T19:49:55Z","createdDateTime":"2021-03-01T19:49:48Z","expirationDateTime":"2021-03-02T19:49:48Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":29,"length":19,"text":"high + blood pressure","category":"Diagnosis","confidenceScore":1.0,"assertion":{"certainty":"negative"},"links":[{"dataSource":"UMLS","id":"C0020538"},{"dataSource":"AOD","id":"0000023317"},{"dataSource":"BI","id":"BI00001"},{"dataSource":"CCPSS","id":"1017493"},{"dataSource":"CCS","id":"7.1"},{"dataSource":"CHV","id":"0000015800"},{"dataSource":"COSTAR","id":"397"},{"dataSource":"CSP","id":"0571-5243"},{"dataSource":"CST","id":"HYPERTENS"},{"dataSource":"DXP","id":"U002034"},{"dataSource":"HPO","id":"HP:0000822"},{"dataSource":"ICD10","id":"I10-I15.9"},{"dataSource":"ICD10AM","id":"I10-I15.9"},{"dataSource":"ICD10CM","id":"I10"},{"dataSource":"ICD9CM","id":"997.91"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU035456"},{"dataSource":"ICPC2P","id":"K85004"},{"dataSource":"LCH","id":"U002317"},{"dataSource":"LCH_NW","id":"sh85063723"},{"dataSource":"LNC","id":"LA14293-7"},{"dataSource":"MDR","id":"10020772"},{"dataSource":"MEDCIN","id":"33288"},{"dataSource":"MEDLINEPLUS","id":"34"},{"dataSource":"MSH","id":"D006973"},{"dataSource":"MTH","id":"005"},{"dataSource":"MTHICD9","id":"997.91"},{"dataSource":"NANDA-I","id":"00905"},{"dataSource":"NCI","id":"C3117"},{"dataSource":"NCI_CPTAC","id":"C3117"},{"dataSource":"NCI_CTCAE","id":"E13785"},{"dataSource":"NCI_CTRP","id":"C3117"},{"dataSource":"NCI_FDA","id":"1908"},{"dataSource":"NCI_GDC","id":"C3117"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000458091"},{"dataSource":"NCI_NICHD","id":"C3117"},{"dataSource":"NOC","id":"060808"},{"dataSource":"OMIM","id":"MTHU002068"},{"dataSource":"PCDS","id":"PRB_11000.06"},{"dataSource":"PDQ","id":"CDR0000686951"},{"dataSource":"PSY","id":"23830"},{"dataSource":"RCD","id":"XE0Ub"},{"dataSource":"SNM","id":"F-70700"},{"dataSource":"SNMI","id":"D3-02000"},{"dataSource":"SNOMEDCT_US","id":"38341003"},{"dataSource":"WHO","id":"0210"}]}],"relations":[],"warnings":[]},{"id":"1","entities":[{"offset":11,"length":5,"text":"100mg","category":"Dosage","confidenceScore":0.98},{"offset":17,"length":9,"text":"ibuprofen","category":"MedicationName","confidenceScore":1.0,"links":[{"dataSource":"UMLS","id":"C0020740"},{"dataSource":"AOD","id":"0000019879"},{"dataSource":"ATC","id":"M01AE01"},{"dataSource":"CCPSS","id":"0046165"},{"dataSource":"CHV","id":"0000006519"},{"dataSource":"CSP","id":"2270-2077"},{"dataSource":"DRUGBANK","id":"DB01050"},{"dataSource":"GS","id":"1611"},{"dataSource":"LCH_NW","id":"sh97005926"},{"dataSource":"LNC","id":"LP16165-0"},{"dataSource":"MEDCIN","id":"40458"},{"dataSource":"MMSL","id":"d00015"},{"dataSource":"MSH","id":"D007052"},{"dataSource":"MTHSPL","id":"WK2XYI10QM"},{"dataSource":"NCI","id":"C561"},{"dataSource":"NCI_CTRP","id":"C561"},{"dataSource":"NCI_DCP","id":"00803"},{"dataSource":"NCI_DTP","id":"NSC0256857"},{"dataSource":"NCI_FDA","id":"WK2XYI10QM"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000613511"},{"dataSource":"NDDF","id":"002377"},{"dataSource":"PDQ","id":"CDR0000040475"},{"dataSource":"RCD","id":"x02MO"},{"dataSource":"RXNORM","id":"5640"},{"dataSource":"SNM","id":"E-7772"},{"dataSource":"SNMI","id":"C-603C0"},{"dataSource":"SNOMEDCT_US","id":"387207008"},{"dataSource":"USP","id":"m39860"},{"dataSource":"USPMG","id":"MTHU000060"},{"dataSource":"VANDF","id":"4017840"}]},{"offset":34,"length":11,"text":"twice + daily","category":"Frequency","confidenceScore":1.0}],"relations":[{"relationType":"DosageOfMedication","entities":[{"ref":"#/results/documents/1/entities/0","role":"Attribute"},{"ref":"#/results/documents/1/entities/1","role":"Entity"}]},{"relationType":"FrequencyOfMedication","entities":[{"ref":"#/results/documents/1/entities/1","role":"Entity"},{"ref":"#/results/documents/1/entities/2","role":"Attribute"}]}],"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}}],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - 5abb1e34-7ff2-4eb7-b55b-a74a18e5d6ba + - d8ef7f39-25a2-4ae8-b160-2c2cd7bac9ef content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:11:40 GMT + - Mon, 01 Mar 2021 19:49:57 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -74,7 +108,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '46' + - '56' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_payload_too_large.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_payload_too_large.yaml index 7706cde1c77a..700315b7b636 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_payload_too_large.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_payload_too_large.yaml @@ -8515,18 +8515,18 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Request Payload sent is too large to be processed. Limit request size to: 524288"}}}' headers: apim-request-id: - - 374fd1db-906b-4b3f-a792-dcd5247650c5 + - 7ccbb876-ba42-4578-b2c3-27341b5b1ad6 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:13:15 GMT + - Mon, 01 Mar 2021 19:49:48 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -8534,7 +8534,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '20' + - '22' status: code: 413 message: Payload Too Large diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_bidirectional_relation_type.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_relations.yaml similarity index 55% rename from sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_bidirectional_relation_type.yaml rename to sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_relations.yaml index 2da57f9e5d10..317cbfc4dd81 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_bidirectional_relation_type.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_relations.yaml @@ -5,6 +5,10 @@ interactions: headers: Accept: - application/json, text/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive Content-Length: - '112' Content-Type: @@ -12,45 +16,63 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: daa508db-e406-4746-932b-f167a50e8183 - date: Tue, 23 Feb 2021 17:13:16 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/7f29a825-fb35-4385-9a24-11e47fb7e875 - strict-transport-security: max-age=31536000; includeSubDomains; preload - transfer-encoding: chunked - x-content-type-options: nosniff - x-envoy-upstream-service-time: '125' + apim-request-id: + - ffbf35f5-ec93-4688-9e23-bd081cf93d1b + date: + - Tue, 02 Mar 2021 16:02:33 GMT + operation-location: + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/3e2ec56c-74ad-4c14-93c2-935c941551d8 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '344' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/7f29a825-fb35-4385-9a24-11e47fb7e875 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/3e2ec56c-74ad-4c14-93c2-935c941551d8 response: body: - string: '{"jobId":"7f29a825-fb35-4385-9a24-11e47fb7e875","lastUpdateDateTime":"2021-02-23T17:13:18Z","createdDateTime":"2021-02-23T17:13:16Z","expirationDateTime":"2021-02-24T17:13:16Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":31,"length":18,"text":"Parkinsons - Disease","category":"Diagnosis","confidenceScore":1.0,"isNegated":false,"links":[{"dataSource":"UMLS","id":"C0030567"},{"dataSource":"AOD","id":"0000006203"},{"dataSource":"BI","id":"BI00554"},{"dataSource":"CCPSS","id":"1018057"},{"dataSource":"CCS","id":"6.2.1"},{"dataSource":"CCSR_10","id":"NVS004"},{"dataSource":"CHV","id":"0000009319"},{"dataSource":"COSTAR","id":"559"},{"dataSource":"CSP","id":"2057-3689"},{"dataSource":"CST","id":"EXTRAPYR - SYND"},{"dataSource":"ICD10","id":"G20"},{"dataSource":"ICD10AM","id":"G20"},{"dataSource":"ICD10CM","id":"G20"},{"dataSource":"ICD9CM","id":"332.0"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU004748"},{"dataSource":"ICPC2P","id":"N87001"},{"dataSource":"LCH_NW","id":"sh85098115"},{"dataSource":"LNC","id":"MTHU020807"},{"dataSource":"MDR","id":"10061536"},{"dataSource":"MEDCIN","id":"32004"},{"dataSource":"MEDLINEPLUS","id":"85"},{"dataSource":"MSH","id":"D010300"},{"dataSource":"NANDA-I","id":"03003"},{"dataSource":"NCI","id":"C26845"},{"dataSource":"NCI_CELLOSAURUS","id":"C26845"},{"dataSource":"NCI_CPTAC","id":"C26845"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000044140"},{"dataSource":"OMIM","id":"516000"},{"dataSource":"PSY","id":"36720"},{"dataSource":"QMR","id":"R0121461"},{"dataSource":"RAM","id":"DX353"},{"dataSource":"RCD","id":"F12.."},{"dataSource":"SNM","id":"D-8450"},{"dataSource":"SNMI","id":"DA-21012"},{"dataSource":"SNOMEDCT_US","id":"49049000"},{"dataSource":"WHO","id":"0106"}]},{"offset":51,"length":2,"text":"PD","category":"Diagnosis","confidenceScore":1.0,"isNegated":false,"links":[{"dataSource":"UMLS","id":"C0030567"},{"dataSource":"AOD","id":"0000006203"},{"dataSource":"BI","id":"BI00554"},{"dataSource":"CCPSS","id":"1018057"},{"dataSource":"CCS","id":"6.2.1"},{"dataSource":"CCSR_10","id":"NVS004"},{"dataSource":"CHV","id":"0000009319"},{"dataSource":"COSTAR","id":"559"},{"dataSource":"CSP","id":"2057-3689"},{"dataSource":"CST","id":"EXTRAPYR - SYND"},{"dataSource":"ICD10","id":"G20"},{"dataSource":"ICD10AM","id":"G20"},{"dataSource":"ICD10CM","id":"G20"},{"dataSource":"ICD9CM","id":"332.0"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU004748"},{"dataSource":"ICPC2P","id":"N87001"},{"dataSource":"LCH_NW","id":"sh85098115"},{"dataSource":"LNC","id":"MTHU020807"},{"dataSource":"MDR","id":"10061536"},{"dataSource":"MEDCIN","id":"32004"},{"dataSource":"MEDLINEPLUS","id":"85"},{"dataSource":"MSH","id":"D010300"},{"dataSource":"NANDA-I","id":"03003"},{"dataSource":"NCI","id":"C26845"},{"dataSource":"NCI_CELLOSAURUS","id":"C26845"},{"dataSource":"NCI_CPTAC","id":"C26845"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000044140"},{"dataSource":"OMIM","id":"516000"},{"dataSource":"PSY","id":"36720"},{"dataSource":"QMR","id":"R0121461"},{"dataSource":"RAM","id":"DX353"},{"dataSource":"RCD","id":"F12.."},{"dataSource":"SNM","id":"D-8450"},{"dataSource":"SNMI","id":"DA-21012"},{"dataSource":"SNOMEDCT_US","id":"49049000"},{"dataSource":"WHO","id":"0106"}]}],"relations":[{"relationType":"Abbreviation","bidirectional":true,"source":"#/results/documents/0/entities/0","target":"#/results/documents/0/entities/1"}],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"3e2ec56c-74ad-4c14-93c2-935c941551d8","lastUpdateDateTime":"2021-03-02T16:02:36Z","createdDateTime":"2021-03-02T16:02:33Z","expirationDateTime":"2021-03-03T16:02:33Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":31,"length":18,"text":"Parkinsons + Disease","category":"Diagnosis","confidenceScore":1.0,"links":[{"dataSource":"UMLS","id":"C0030567"},{"dataSource":"AOD","id":"0000006203"},{"dataSource":"BI","id":"BI00554"},{"dataSource":"CCPSS","id":"1018057"},{"dataSource":"CCS","id":"6.2.1"},{"dataSource":"CCSR_10","id":"NVS004"},{"dataSource":"CHV","id":"0000009319"},{"dataSource":"COSTAR","id":"559"},{"dataSource":"CSP","id":"2057-3689"},{"dataSource":"CST","id":"EXTRAPYR + SYND"},{"dataSource":"ICD10","id":"G20"},{"dataSource":"ICD10AM","id":"G20"},{"dataSource":"ICD10CM","id":"G20"},{"dataSource":"ICD9CM","id":"332.0"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU004748"},{"dataSource":"ICPC2P","id":"N87001"},{"dataSource":"LCH_NW","id":"sh85098115"},{"dataSource":"LNC","id":"MTHU020807"},{"dataSource":"MDR","id":"10061536"},{"dataSource":"MEDCIN","id":"32004"},{"dataSource":"MEDLINEPLUS","id":"85"},{"dataSource":"MSH","id":"D010300"},{"dataSource":"NANDA-I","id":"03003"},{"dataSource":"NCI","id":"C26845"},{"dataSource":"NCI_CELLOSAURUS","id":"C26845"},{"dataSource":"NCI_CPTAC","id":"C26845"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000044140"},{"dataSource":"OMIM","id":"516000"},{"dataSource":"PSY","id":"36720"},{"dataSource":"QMR","id":"R0121461"},{"dataSource":"RAM","id":"DX353"},{"dataSource":"RCD","id":"F12.."},{"dataSource":"SNM","id":"D-8450"},{"dataSource":"SNMI","id":"DA-21012"},{"dataSource":"SNOMEDCT_US","id":"49049000"},{"dataSource":"WHO","id":"0106"}]},{"offset":51,"length":2,"text":"PD","category":"Diagnosis","confidenceScore":1.0,"links":[{"dataSource":"UMLS","id":"C0030567"},{"dataSource":"AOD","id":"0000006203"},{"dataSource":"BI","id":"BI00554"},{"dataSource":"CCPSS","id":"1018057"},{"dataSource":"CCS","id":"6.2.1"},{"dataSource":"CCSR_10","id":"NVS004"},{"dataSource":"CHV","id":"0000009319"},{"dataSource":"COSTAR","id":"559"},{"dataSource":"CSP","id":"2057-3689"},{"dataSource":"CST","id":"EXTRAPYR + SYND"},{"dataSource":"ICD10","id":"G20"},{"dataSource":"ICD10AM","id":"G20"},{"dataSource":"ICD10CM","id":"G20"},{"dataSource":"ICD9CM","id":"332.0"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU004748"},{"dataSource":"ICPC2P","id":"N87001"},{"dataSource":"LCH_NW","id":"sh85098115"},{"dataSource":"LNC","id":"MTHU020807"},{"dataSource":"MDR","id":"10061536"},{"dataSource":"MEDCIN","id":"32004"},{"dataSource":"MEDLINEPLUS","id":"85"},{"dataSource":"MSH","id":"D010300"},{"dataSource":"NANDA-I","id":"03003"},{"dataSource":"NCI","id":"C26845"},{"dataSource":"NCI_CELLOSAURUS","id":"C26845"},{"dataSource":"NCI_CPTAC","id":"C26845"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000044140"},{"dataSource":"OMIM","id":"516000"},{"dataSource":"PSY","id":"36720"},{"dataSource":"QMR","id":"R0121461"},{"dataSource":"RAM","id":"DX353"},{"dataSource":"RCD","id":"F12.."},{"dataSource":"SNM","id":"D-8450"},{"dataSource":"SNMI","id":"DA-21012"},{"dataSource":"SNOMEDCT_US","id":"49049000"},{"dataSource":"WHO","id":"0106"}]}],"relations":[{"relationType":"Abbreviation","entities":[{"ref":"#/results/documents/0/entities/0","role":"FullTerm"},{"ref":"#/results/documents/0/entities/1","role":"AbbreviatedTerm"}]}],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: ddaf8bac-c610-4836-bcc3-c9c094d614f2 - content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:13:21 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - transfer-encoding: chunked - x-content-type-options: nosniff - x-envoy-upstream-service-time: '35' + apim-request-id: + - 4341e029-5117-4724-bbbc-677e2cd8df9c + content-type: + - application/json; charset=utf-8 + date: + - Tue, 02 Mar 2021 16:02:39 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '125' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/7f29a825-fb35-4385-9a24-11e47fb7e875 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_show_stats_and_model_version.yaml index 6b2014d72760..bbfa27d57c98 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_show_stats_and_model_version.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_show_stats_and_model_version.yaml @@ -18,17 +18,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?model-version=2021-01-11&stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?model-version=2021-01-11&stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - a206f9b1-d37b-48de-a97b-eff96cbadad9 + - 3850c0c1-14ec-415d-bc83-3f69b2a53635 date: - - Tue, 23 Feb 2021 17:19:23 GMT + - Mon, 01 Mar 2021 19:49:49 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/5065dca0-e8c8-449d-8d12-6a170fd85751 + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/cb17929e-fcd3-41d3-b60b-6d5311051ed5 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -36,7 +36,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '187' + - '195' status: code: 202 message: Accepted @@ -52,19 +52,19 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/5065dca0-e8c8-449d-8d12-6a170fd85751?showStats=True + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/cb17929e-fcd3-41d3-b60b-6d5311051ed5?showStats=True response: body: - string: '{"jobId":"5065dca0-e8c8-449d-8d12-6a170fd85751","lastUpdateDateTime":"2021-02-23T17:19:26Z","createdDateTime":"2021-02-23T17:19:23Z","expirationDateTime":"2021-02-24T17:19:23Z","status":"succeeded","errors":[],"results":{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"0","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"19","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"1","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"cb17929e-fcd3-41d3-b60b-6d5311051ed5","lastUpdateDateTime":"2021-03-01T19:49:50Z","createdDateTime":"2021-03-01T19:49:49Z","expirationDateTime":"2021-03-02T19:49:49Z","status":"succeeded","errors":[],"results":{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"0","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"19","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"1","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}}],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - 9dfbf400-5618-4247-8861-26bf8f580e24 + - cba1b3fe-d434-467c-b775-bd49c070d851 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:19:29 GMT + - Mon, 01 Mar 2021 19:49:54 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -72,7 +72,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '98' + - '62' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_too_many_documents.yaml index da96802b9455..3517ba59b790 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_too_many_documents.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_too_many_documents.yaml @@ -23,18 +23,18 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch request contains too many records. Max 10 records are permitted."}}}' headers: apim-request-id: - - b9b7d844-7b60-4773-b8f3-f48355265f12 + - 2d56c1ec-c87c-417e-aaf5-e7a7dcd1798a content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:13:39 GMT + - Mon, 01 Mar 2021 19:49:43 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -42,7 +42,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '3' + - '4' status: code: 400 message: Bad Request diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_user_agent.yaml index 38a9d8460079..cf8f45358d18 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_user_agent.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_user_agent.yaml @@ -16,17 +16,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - d43cc930-c3e8-4319-9e85-6c4d49297cba + - 45e3f56c-8d95-46ac-9c94-c38e37590a25 date: - - Tue, 23 Feb 2021 17:16:44 GMT + - Mon, 01 Mar 2021 19:49:44 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/5a291783-cebb-4cd5-8a0f-ab61f278ed95 + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/3b2a43e0-ac94-4311-b0cc-332a70e2b9c1 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -34,7 +34,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '237' + - '98' status: code: 202 message: Accepted @@ -50,17 +50,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/5a291783-cebb-4cd5-8a0f-ab61f278ed95 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/3b2a43e0-ac94-4311-b0cc-332a70e2b9c1 response: body: - string: '{"jobId":"5a291783-cebb-4cd5-8a0f-ab61f278ed95","lastUpdateDateTime":"2021-02-23T17:16:46Z","createdDateTime":"2021-02-23T17:16:44Z","expirationDateTime":"2021-02-24T17:16:44Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"1","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"3b2a43e0-ac94-4311-b0cc-332a70e2b9c1","lastUpdateDateTime":"2021-03-01T19:49:44Z","createdDateTime":"2021-03-01T19:49:44Z","expirationDateTime":"2021-03-02T19:49:44Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"1","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - d47139da-03a3-4430-aaf6-7a14d5492f79 + - 0faf87df-041f-45c7-8898-32457f65cfc5 content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:16:48 GMT + - Mon, 01 Mar 2021 19:49:49 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -68,7 +68,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '48' + - '29' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_whole_batch_language_hint_and_dict_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_whole_batch_language_hint_and_dict_input.yaml index 978d3af152a4..9433f2b38a68 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_whole_batch_language_hint_and_dict_input.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare.test_whole_batch_language_hint_and_dict_input.yaml @@ -18,17 +18,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: apim-request-id: - - 9fa8561f-f3a7-4097-b33b-234190825349 + - 5093485d-cdb3-404a-9b9e-3451063e3664 date: - - Tue, 23 Feb 2021 17:11:12 GMT + - Mon, 01 Mar 2021 19:49:54 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/6387d5a2-97d5-4ee9-9ed1-179b56a9510e + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/7b6910c7-4c1b-4bb8-b481-9413b2594b98 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -36,7 +36,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '139' + - '186' status: code: 202 message: Accepted @@ -52,17 +52,17 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/6387d5a2-97d5-4ee9-9ed1-179b56a9510e + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/7b6910c7-4c1b-4bb8-b481-9413b2594b98 response: body: - string: '{"jobId":"6387d5a2-97d5-4ee9-9ed1-179b56a9510e","lastUpdateDateTime":"2021-02-23T17:11:13Z","createdDateTime":"2021-02-23T17:11:12Z","expirationDateTime":"2021-02-24T17:11:12Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"1","entities":[],"relations":[],"warnings":[]},{"id":"2","entities":[],"relations":[],"warnings":[]},{"id":"3","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"7b6910c7-4c1b-4bb8-b481-9413b2594b98","lastUpdateDateTime":"2021-03-01T19:49:55Z","createdDateTime":"2021-03-01T19:49:54Z","expirationDateTime":"2021-03-02T19:49:54Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"1","entities":[],"relations":[],"warnings":[]},{"id":"2","entities":[],"relations":[],"warnings":[]},{"id":"3","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' headers: apim-request-id: - - 669a2544-8dfa-4aca-a1de-a4bf03ef92de + - c39445d3-1299-4bb8-ac21-ff14acc6ecbc content-type: - application/json; charset=utf-8 date: - - Tue, 23 Feb 2021 17:11:17 GMT + - Mon, 01 Mar 2021 19:49:59 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -70,7 +70,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '133' + - '43' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_bad_model_version_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_bad_model_version_error.yaml index 896a6dc340f2..1fb23cb06859 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_bad_model_version_error.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_bad_model_version_error.yaml @@ -12,44 +12,66 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?model-version=bad&stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?model-version=bad&stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: c3432a0c-75d4-451b-a8fb-e6051ce92b4b - date: Tue, 23 Feb 2021 17:11:41 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/7a3a8b0d-5d27-4b5b-8cc9-fb4e964dec3a + apim-request-id: ff942512-3db1-4824-b2ef-8eaaaa46d278 + date: Mon, 01 Mar 2021 19:55:07 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/6cd54834-3d1a-4c58-a1c4-b20ceacd96fe strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '140' + x-envoy-upstream-service-time: '434' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?model-version=bad&stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?model-version=bad&stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/7a3a8b0d-5d27-4b5b-8cc9-fb4e964dec3a + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/6cd54834-3d1a-4c58-a1c4-b20ceacd96fe response: body: - string: '{"jobId":"7a3a8b0d-5d27-4b5b-8cc9-fb4e964dec3a","lastUpdateDateTime":"2021-02-23T17:11:43Z","createdDateTime":"2021-02-23T17:11:41Z","expirationDateTime":"2021-02-24T17:11:41Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"6cd54834-3d1a-4c58-a1c4-b20ceacd96fe","lastUpdateDateTime":"2021-03-01T19:55:08Z","createdDateTime":"2021-03-01T19:55:07Z","expirationDateTime":"2021-03-02T19:55:07Z","status":"notStarted","errors":[]}' + headers: + apim-request-id: 0be4c4d8-fd21-4c9b-8b9e-9cc3967fdfbc + content-type: application/json; charset=utf-8 + date: Mon, 01 Mar 2021 19:55:12 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '7' + status: + code: 200 + message: OK + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/6cd54834-3d1a-4c58-a1c4-b20ceacd96fe +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/6cd54834-3d1a-4c58-a1c4-b20ceacd96fe + response: + body: + string: '{"jobId":"6cd54834-3d1a-4c58-a1c4-b20ceacd96fe","lastUpdateDateTime":"2021-03-01T19:55:15Z","createdDateTime":"2021-03-01T19:55:07Z","expirationDateTime":"2021-03-02T19:55:07Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid language code. Supported languages: en"}}}],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: aa50a5cd-a8d6-4728-b46f-0235a93006c7 + apim-request-id: 0df672f8-a574-4398-9697-98987a263974 content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:11:45 GMT + date: Mon, 01 Mar 2021 19:55:17 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '31' + x-envoy-upstream-service-time: '112' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/7a3a8b0d-5d27-4b5b-8cc9-fb4e964dec3a + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/6cd54834-3d1a-4c58-a1c4-b20ceacd96fe version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_cancellation.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_cancellation.yaml index 15a437d3c879..37637b2b0f41 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_cancellation.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_cancellation.yaml @@ -17,36 +17,36 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: 7b357d6b-c749-4dde-80a8-7719ceb621b6 - date: Tue, 23 Feb 2021 17:07:12 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/2d4d23ee-11e7-408a-b8fa-38cf3e0a0134 + apim-request-id: a7fedbd4-82d6-408c-890c-a119f1562044 + date: Mon, 01 Mar 2021 19:55:08 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/856058b4-6aef-423d-8ad0-3fb146f5e2eb strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '192' + x-envoy-upstream-service-time: '323' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/2d4d23ee-11e7-408a-b8fa-38cf3e0a0134 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/856058b4-6aef-423d-8ad0-3fb146f5e2eb response: body: - string: '{"jobId":"2d4d23ee-11e7-408a-b8fa-38cf3e0a0134","lastUpdateDateTime":"2021-02-23T17:07:13Z","createdDateTime":"2021-02-23T17:07:12Z","expirationDateTime":"2021-02-24T17:07:12Z","status":"notStarted","errors":[]}' + string: '{"jobId":"856058b4-6aef-423d-8ad0-3fb146f5e2eb","lastUpdateDateTime":"2021-03-01T19:55:09Z","createdDateTime":"2021-03-01T19:55:08Z","expirationDateTime":"2021-03-02T19:55:08Z","status":"notStarted","errors":[]}' headers: - apim-request-id: f573fccf-6eb1-49b3-a67a-70d379406148 + apim-request-id: 668e8cd4-4179-40ad-852e-ea11eedc5e11 content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:07:12 GMT + date: Mon, 01 Mar 2021 19:55:08 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff @@ -54,7 +54,7 @@ interactions: status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/2d4d23ee-11e7-408a-b8fa-38cf3e0a0134 + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/856058b4-6aef-423d-8ad0-3fb146f5e2eb - request: body: null headers: @@ -63,20 +63,20 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: DELETE - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/2d4d23ee-11e7-408a-b8fa-38cf3e0a0134 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/856058b4-6aef-423d-8ad0-3fb146f5e2eb response: body: string: '' headers: - apim-request-id: 09caee90-748d-4a1e-b26c-52b9eafe82b4 - date: Tue, 23 Feb 2021 17:07:12 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/2d4d23ee-11e7-408a-b8fa-38cf3e0a0134 + apim-request-id: e395d977-7a51-47d4-accd-95da9fd51f7d + date: Mon, 01 Mar 2021 19:55:08 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/856058b4-6aef-423d-8ad0-3fb146f5e2eb strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '32' + x-envoy-upstream-service-time: '12' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs/2d4d23ee-11e7-408a-b8fa-38cf3e0a0134 + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs/856058b4-6aef-423d-8ad0-3fb146f5e2eb version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_default_string_index_type_is_UnicodeCodePoint.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_default_string_index_type_is_UnicodeCodePoint.yaml index 0ba24ef66a32..d02539f184a6 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_default_string_index_type_is_UnicodeCodePoint.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_default_string_index_type_is_UnicodeCodePoint.yaml @@ -11,42 +11,64 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: b1144bee-4de4-47d3-8cab-1b6cfbf25657 - date: Tue, 23 Feb 2021 17:13:39 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/7ee5747e-a54a-4b5b-8eb6-f04b060254de + apim-request-id: f7878833-98d0-4cb2-928e-0412fd10ad88 + date: Mon, 01 Mar 2021 19:55:07 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/f575293f-770d-40ee-a53e-b86c922c1211 strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '86' + x-envoy-upstream-service-time: '78' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/7ee5747e-a54a-4b5b-8eb6-f04b060254de + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/f575293f-770d-40ee-a53e-b86c922c1211 response: body: - string: '{"jobId":"7ee5747e-a54a-4b5b-8eb6-f04b060254de","lastUpdateDateTime":"2021-02-23T17:13:41Z","createdDateTime":"2021-02-23T17:13:40Z","expirationDateTime":"2021-02-24T17:13:40Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"f575293f-770d-40ee-a53e-b86c922c1211","lastUpdateDateTime":"2021-03-01T19:55:08Z","createdDateTime":"2021-03-01T19:55:08Z","expirationDateTime":"2021-03-02T19:55:08Z","status":"notStarted","errors":[]}' headers: - apim-request-id: aaa30765-fd74-453d-8a46-f79ac55b6c88 + apim-request-id: a2c8d105-2943-4139-8d83-751ab1da2017 content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:13:45 GMT + date: Mon, 01 Mar 2021 19:55:13 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '62' + x-envoy-upstream-service-time: '11' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/7ee5747e-a54a-4b5b-8eb6-f04b060254de + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/f575293f-770d-40ee-a53e-b86c922c1211 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/f575293f-770d-40ee-a53e-b86c922c1211 + response: + body: + string: '{"jobId":"f575293f-770d-40ee-a53e-b86c922c1211","lastUpdateDateTime":"2021-03-01T19:55:15Z","createdDateTime":"2021-03-01T19:55:08Z","expirationDateTime":"2021-03-02T19:55:08Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + headers: + apim-request-id: dc15de7b-1119-4231-885d-c9273bd8b643 + content-type: application/json; charset=utf-8 + date: Mon, 01 Mar 2021 19:55:18 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '29' + status: + code: 200 + message: OK + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/f575293f-770d-40ee-a53e-b86c922c1211 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_document_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_document_errors.yaml index cccaae7f42c3..8a231d806556 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_document_errors.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_document_errors.yaml @@ -14,32 +14,54 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: c4a6582e-9a5d-47c0-b750-fc1c50569c42 - date: Tue, 23 Feb 2021 17:16:50 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fc71be39-017b-4e5a-aa86-5d553b346f28 + apim-request-id: 20380efd-51e7-4088-8fda-f62e8b4c2866 + date: Mon, 01 Mar 2021 19:55:08 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/ff7b3007-597a-4e05-982b-ffad35985dd5 strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '204' + x-envoy-upstream-service-time: '136' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fc71be39-017b-4e5a-aa86-5d553b346f28 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/ff7b3007-597a-4e05-982b-ffad35985dd5 response: body: - string: '{"jobId":"fc71be39-017b-4e5a-aa86-5d553b346f28","lastUpdateDateTime":"2021-02-23T17:16:51Z","createdDateTime":"2021-02-23T17:16:49Z","expirationDateTime":"2021-02-24T17:16:49Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"ff7b3007-597a-4e05-982b-ffad35985dd5","lastUpdateDateTime":"2021-03-01T19:55:08Z","createdDateTime":"2021-03-01T19:55:08Z","expirationDateTime":"2021-03-02T19:55:08Z","status":"notStarted","errors":[]}' + headers: + apim-request-id: 593d392e-4b55-463a-9904-d76083271f38 + content-type: application/json; charset=utf-8 + date: Mon, 01 Mar 2021 19:55:13 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '6' + status: + code: 200 + message: OK + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/ff7b3007-597a-4e05-982b-ffad35985dd5 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/ff7b3007-597a-4e05-982b-ffad35985dd5 + response: + body: + string: '{"jobId":"ff7b3007-597a-4e05-982b-ffad35985dd5","lastUpdateDateTime":"2021-03-01T19:55:15Z","createdDateTime":"2021-03-01T19:55:08Z","expirationDateTime":"2021-03-02T19:55:08Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid @@ -49,9 +71,9 @@ interactions: size to: 5120 text elements. For additional details on the data limitations see https://aka.ms/text-analytics-data-limits"}}}],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: 5f2a86ec-a78d-4210-983f-519dc238ad09 + apim-request-id: 753e2912-e650-4ede-916c-332eb040f45a content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:16:54 GMT + date: Mon, 01 Mar 2021 19:55:18 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff @@ -59,5 +81,5 @@ interactions: status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fc71be39-017b-4e5a-aa86-5d553b346f28 + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/ff7b3007-597a-4e05-982b-ffad35985dd5 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_duplicate_ids_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_duplicate_ids_error.yaml index a9ff7fc0b913..59538e91b3fc 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_duplicate_ids_error.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_duplicate_ids_error.yaml @@ -12,21 +12,21 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Request contains duplicated Ids. Make sure each document has a unique Id."}}}' headers: - apim-request-id: 1131b480-a252-499b-9243-ee753b15185d + apim-request-id: d53a87f9-428a-49f0-9e39-212673ba8424 content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:11:17 GMT + date: Mon, 01 Mar 2021 19:55:07 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '4' + x-envoy-upstream-service-time: '5' status: code: 400 message: Bad Request - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_explicit_set_string_index_type.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_explicit_set_string_index_type.yaml index 48358a6f2c77..efcf8e424eb0 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_explicit_set_string_index_type.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_explicit_set_string_index_type.yaml @@ -11,42 +11,64 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=TextElements_v8 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=TextElements_v8 response: body: string: '' headers: - apim-request-id: 66647d38-ac22-40a1-997f-07e5818d3c4e - date: Tue, 23 Feb 2021 17:11:46 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/c26df8f2-809b-4460-a646-968127bca478 + apim-request-id: 1690322a-4869-4499-ba8e-a5598223a830 + date: Mon, 01 Mar 2021 19:55:18 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/4ce366b6-942d-4705-a813-b6bddf668dd7 strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '105' + x-envoy-upstream-service-time: '82' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=TextElements_v8 + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=TextElements_v8 - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/c26df8f2-809b-4460-a646-968127bca478 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/4ce366b6-942d-4705-a813-b6bddf668dd7 response: body: - string: '{"jobId":"c26df8f2-809b-4460-a646-968127bca478","lastUpdateDateTime":"2021-02-23T17:11:48Z","createdDateTime":"2021-02-23T17:11:46Z","expirationDateTime":"2021-02-24T17:11:46Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"4ce366b6-942d-4705-a813-b6bddf668dd7","lastUpdateDateTime":"2021-03-01T19:55:20Z","createdDateTime":"2021-03-01T19:55:18Z","expirationDateTime":"2021-03-02T19:55:18Z","status":"running","errors":[]}' headers: - apim-request-id: 9eb4abae-2bde-491d-8949-38d13b907102 + apim-request-id: 0402d463-2210-442f-8dab-a31666aaf94b content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:11:51 GMT + date: Mon, 01 Mar 2021 19:55:23 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '49' + x-envoy-upstream-service-time: '7' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/c26df8f2-809b-4460-a646-968127bca478 + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/4ce366b6-942d-4705-a813-b6bddf668dd7 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/4ce366b6-942d-4705-a813-b6bddf668dd7 + response: + body: + string: '{"jobId":"4ce366b6-942d-4705-a813-b6bddf668dd7","lastUpdateDateTime":"2021-03-01T19:55:25Z","createdDateTime":"2021-03-01T19:55:18Z","expirationDateTime":"2021-03-02T19:55:18Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + headers: + apim-request-id: 7c42c579-5cab-455e-bb99-e335c7f6e2aa + content-type: application/json; charset=utf-8 + date: Mon, 01 Mar 2021 19:55:28 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '29' + status: + code: 200 + message: OK + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/4ce366b6-942d-4705-a813-b6bddf668dd7 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_input_with_some_errors.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_input_with_some_errors.yaml index afeeda5a3031..82e4e25294e9 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_input_with_some_errors.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_input_with_some_errors.yaml @@ -14,47 +14,69 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: cee0274e-7612-4e91-819c-97ac1b043137 - date: Tue, 23 Feb 2021 17:13:22 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fa7b38ab-53c5-4813-ba7c-94d3398e7956 + apim-request-id: a8538fb6-0afc-46ba-9283-0d1eaa85c0b7 + date: Mon, 01 Mar 2021 19:55:13 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/1d42f16b-7594-4e31-9e4c-d6cbd6979808 strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '145' + x-envoy-upstream-service-time: '226' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fa7b38ab-53c5-4813-ba7c-94d3398e7956 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/1d42f16b-7594-4e31-9e4c-d6cbd6979808 response: body: - string: '{"jobId":"fa7b38ab-53c5-4813-ba7c-94d3398e7956","lastUpdateDateTime":"2021-02-23T17:13:23Z","createdDateTime":"2021-02-23T17:13:22Z","expirationDateTime":"2021-02-24T17:13:22Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"3","entities":[{"offset":11,"length":5,"text":"100mg","category":"Dosage","confidenceScore":0.98,"isNegated":false},{"offset":17,"length":9,"text":"ibuprofen","category":"MedicationName","confidenceScore":1.0,"isNegated":false,"links":[{"dataSource":"UMLS","id":"C0020740"},{"dataSource":"AOD","id":"0000019879"},{"dataSource":"ATC","id":"M01AE01"},{"dataSource":"CCPSS","id":"0046165"},{"dataSource":"CHV","id":"0000006519"},{"dataSource":"CSP","id":"2270-2077"},{"dataSource":"DRUGBANK","id":"DB01050"},{"dataSource":"GS","id":"1611"},{"dataSource":"LCH_NW","id":"sh97005926"},{"dataSource":"LNC","id":"LP16165-0"},{"dataSource":"MEDCIN","id":"40458"},{"dataSource":"MMSL","id":"d00015"},{"dataSource":"MSH","id":"D007052"},{"dataSource":"MTHSPL","id":"WK2XYI10QM"},{"dataSource":"NCI","id":"C561"},{"dataSource":"NCI_CTRP","id":"C561"},{"dataSource":"NCI_DCP","id":"00803"},{"dataSource":"NCI_DTP","id":"NSC0256857"},{"dataSource":"NCI_FDA","id":"WK2XYI10QM"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000613511"},{"dataSource":"NDDF","id":"002377"},{"dataSource":"PDQ","id":"CDR0000040475"},{"dataSource":"RCD","id":"x02MO"},{"dataSource":"RXNORM","id":"5640"},{"dataSource":"SNM","id":"E-7772"},{"dataSource":"SNMI","id":"C-603C0"},{"dataSource":"SNOMEDCT_US","id":"387207008"},{"dataSource":"USP","id":"m39860"},{"dataSource":"USPMG","id":"MTHU000060"},{"dataSource":"VANDF","id":"4017840"}]},{"offset":34,"length":11,"text":"twice - daily","category":"Frequency","confidenceScore":1.0,"isNegated":false}],"relations":[{"relationType":"DosageOfMedication","bidirectional":false,"source":"#/results/documents/0/entities/0","target":"#/results/documents/0/entities/1"},{"relationType":"FrequencyOfMedication","bidirectional":false,"source":"#/results/documents/0/entities/2","target":"#/results/documents/0/entities/1"}],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"1d42f16b-7594-4e31-9e4c-d6cbd6979808","lastUpdateDateTime":"2021-03-01T19:55:15Z","createdDateTime":"2021-03-01T19:55:14Z","expirationDateTime":"2021-03-02T19:55:14Z","status":"running","errors":[]}' + headers: + apim-request-id: ae256583-a0a8-4e85-94bc-b350eb86f836 + content-type: application/json; charset=utf-8 + date: Mon, 01 Mar 2021 19:55:19 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '7' + status: + code: 200 + message: OK + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/1d42f16b-7594-4e31-9e4c-d6cbd6979808 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/1d42f16b-7594-4e31-9e4c-d6cbd6979808 + response: + body: + string: '{"jobId":"1d42f16b-7594-4e31-9e4c-d6cbd6979808","lastUpdateDateTime":"2021-03-01T19:55:20Z","createdDateTime":"2021-03-01T19:55:14Z","expirationDateTime":"2021-03-02T19:55:14Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"3","entities":[{"offset":11,"length":5,"text":"100mg","category":"Dosage","confidenceScore":0.98},{"offset":17,"length":9,"text":"ibuprofen","category":"MedicationName","confidenceScore":1.0,"links":[{"dataSource":"UMLS","id":"C0020740"},{"dataSource":"AOD","id":"0000019879"},{"dataSource":"ATC","id":"M01AE01"},{"dataSource":"CCPSS","id":"0046165"},{"dataSource":"CHV","id":"0000006519"},{"dataSource":"CSP","id":"2270-2077"},{"dataSource":"DRUGBANK","id":"DB01050"},{"dataSource":"GS","id":"1611"},{"dataSource":"LCH_NW","id":"sh97005926"},{"dataSource":"LNC","id":"LP16165-0"},{"dataSource":"MEDCIN","id":"40458"},{"dataSource":"MMSL","id":"d00015"},{"dataSource":"MSH","id":"D007052"},{"dataSource":"MTHSPL","id":"WK2XYI10QM"},{"dataSource":"NCI","id":"C561"},{"dataSource":"NCI_CTRP","id":"C561"},{"dataSource":"NCI_DCP","id":"00803"},{"dataSource":"NCI_DTP","id":"NSC0256857"},{"dataSource":"NCI_FDA","id":"WK2XYI10QM"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000613511"},{"dataSource":"NDDF","id":"002377"},{"dataSource":"PDQ","id":"CDR0000040475"},{"dataSource":"RCD","id":"x02MO"},{"dataSource":"RXNORM","id":"5640"},{"dataSource":"SNM","id":"E-7772"},{"dataSource":"SNMI","id":"C-603C0"},{"dataSource":"SNOMEDCT_US","id":"387207008"},{"dataSource":"USP","id":"m39860"},{"dataSource":"USPMG","id":"MTHU000060"},{"dataSource":"VANDF","id":"4017840"}]},{"offset":34,"length":11,"text":"twice + daily","category":"Frequency","confidenceScore":1.0}],"relations":[{"relationType":"DosageOfMedication","entities":[{"ref":"#/results/documents/0/entities/0","role":"Attribute"},{"ref":"#/results/documents/0/entities/1","role":"Entity"}]},{"relationType":"FrequencyOfMedication","entities":[{"ref":"#/results/documents/0/entities/1","role":"Entity"},{"ref":"#/results/documents/0/entities/2","role":"Attribute"}]}],"warnings":[]}],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}},{"id":"2","error":{"code":"InvalidArgument","message":"Invalid Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid language code. Supported languages: en"}}}],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: 78e1c53f-c501-4e79-899f-653d268a722b + apim-request-id: 9ed9a475-c5b0-4bb3-ae02-c824a94d4d6c content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:13:26 GMT + date: Mon, 01 Mar 2021 19:55:23 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '52' + x-envoy-upstream-service-time: '175' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fa7b38ab-53c5-4813-ba7c-94d3398e7956 + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/1d42f16b-7594-4e31-9e4c-d6cbd6979808 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_invalid_language_hint_docs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_invalid_language_hint_docs.yaml index 8ec463868c2f..c85ef96635bb 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_invalid_language_hint_docs.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_invalid_language_hint_docs.yaml @@ -12,66 +12,44 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: f558441c-82cb-4df8-8330-71cbfb4f1592 - date: Tue, 23 Feb 2021 17:07:12 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/af524448-cc51-4789-b8d3-6dbfa9d0e451 + apim-request-id: 6fb777da-38f0-4d69-bb54-adc719a7ba9f + date: Mon, 01 Mar 2021 19:55:09 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/25622281-b164-49b0-bc70-7ee9acd01168 strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '99' + x-envoy-upstream-service-time: '191' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/af524448-cc51-4789-b8d3-6dbfa9d0e451 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/25622281-b164-49b0-bc70-7ee9acd01168 response: body: - string: '{"jobId":"af524448-cc51-4789-b8d3-6dbfa9d0e451","lastUpdateDateTime":"2021-02-23T17:07:15Z","createdDateTime":"2021-02-23T17:07:13Z","expirationDateTime":"2021-02-24T17:07:13Z","status":"running","errors":[]}' - headers: - apim-request-id: bafab375-8339-4b63-a9fa-09e2e0864375 - content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:07:18 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - transfer-encoding: chunked - x-content-type-options: nosniff - x-envoy-upstream-service-time: '8' - status: - code: 200 - message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/af524448-cc51-4789-b8d3-6dbfa9d0e451 -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) - method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/af524448-cc51-4789-b8d3-6dbfa9d0e451 - response: - body: - string: '{"jobId":"af524448-cc51-4789-b8d3-6dbfa9d0e451","lastUpdateDateTime":"2021-02-23T17:07:20Z","createdDateTime":"2021-02-23T17:07:13Z","expirationDateTime":"2021-02-24T17:07:13Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"25622281-b164-49b0-bc70-7ee9acd01168","lastUpdateDateTime":"2021-03-01T19:55:10Z","createdDateTime":"2021-03-01T19:55:09Z","expirationDateTime":"2021-03-02T19:55:09Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"1","error":{"code":"InvalidArgument","message":"Invalid Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid language code. Supported languages: en"}}}],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: 3922588a-441a-4546-96a5-f01a5febf756 + apim-request-id: 396a22f6-ce5d-4bf5-86c0-6e96d53379cd content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:07:23 GMT + date: Mon, 01 Mar 2021 19:55:15 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '32' + x-envoy-upstream-service-time: '98' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/af524448-cc51-4789-b8d3-6dbfa9d0e451 + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/25622281-b164-49b0-bc70-7ee9acd01168 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_invalid_language_hint_method.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_invalid_language_hint_method.yaml index 760e0ef96f89..8193686d81f0 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_invalid_language_hint_method.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_invalid_language_hint_method.yaml @@ -12,88 +12,44 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: 1ebf3475-44ca-4eea-b732-fbb7eeb403e2 - date: Tue, 23 Feb 2021 17:13:45 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fc7a3ee7-f590-44b9-9343-23aa11364ea8 + apim-request-id: 97ac3a09-afa6-43c2-8677-b61235acc794 + date: Mon, 01 Mar 2021 19:55:19 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/7afcfe55-b5ae-4526-9777-1f5e3f34edd6 strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '130' + x-envoy-upstream-service-time: '112' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fc7a3ee7-f590-44b9-9343-23aa11364ea8 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/7afcfe55-b5ae-4526-9777-1f5e3f34edd6 response: body: - string: '{"jobId":"fc7a3ee7-f590-44b9-9343-23aa11364ea8","lastUpdateDateTime":"2021-02-23T17:13:45Z","createdDateTime":"2021-02-23T17:13:45Z","expirationDateTime":"2021-02-24T17:13:45Z","status":"notStarted","errors":[]}' - headers: - apim-request-id: 5506c9ba-f79c-42de-a57e-2342f2167f4a - content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:13:51 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - transfer-encoding: chunked - x-content-type-options: nosniff - x-envoy-upstream-service-time: '7' - status: - code: 200 - message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fc7a3ee7-f590-44b9-9343-23aa11364ea8 -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) - method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fc7a3ee7-f590-44b9-9343-23aa11364ea8 - response: - body: - string: '{"jobId":"fc7a3ee7-f590-44b9-9343-23aa11364ea8","lastUpdateDateTime":"2021-02-23T17:13:51Z","createdDateTime":"2021-02-23T17:13:45Z","expirationDateTime":"2021-02-24T17:13:45Z","status":"running","errors":[]}' - headers: - apim-request-id: 19d1cb40-eeff-4478-94eb-840d9f1b804d - content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:13:55 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - transfer-encoding: chunked - x-content-type-options: nosniff - x-envoy-upstream-service-time: '5' - status: - code: 200 - message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fc7a3ee7-f590-44b9-9343-23aa11364ea8 -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) - method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fc7a3ee7-f590-44b9-9343-23aa11364ea8 - response: - body: - string: '{"jobId":"fc7a3ee7-f590-44b9-9343-23aa11364ea8","lastUpdateDateTime":"2021-02-23T17:13:56Z","createdDateTime":"2021-02-23T17:13:45Z","expirationDateTime":"2021-02-24T17:13:45Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"7afcfe55-b5ae-4526-9777-1f5e3f34edd6","lastUpdateDateTime":"2021-03-01T19:55:20Z","createdDateTime":"2021-03-01T19:55:19Z","expirationDateTime":"2021-03-02T19:55:19Z","status":"succeeded","errors":[],"results":{"documents":[],"errors":[{"id":"0","error":{"code":"InvalidArgument","message":"Invalid Language Code.","innererror":{"code":"UnsupportedLanguageCode","message":"Invalid language code. Supported languages: en"}}}],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: 1cbd48f6-0cb8-413f-a328-d9ca3a2bf70e + apim-request-id: 76b06196-473e-4203-b2a8-773b9cc49c0c content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:14:01 GMT + date: Mon, 01 Mar 2021 19:55:23 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '31' + x-envoy-upstream-service-time: '30' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/fc7a3ee7-f590-44b9-9343-23aa11364ea8 + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/7afcfe55-b5ae-4526-9777-1f5e3f34edd6 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_out_of_order_ids.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_out_of_order_ids.yaml index 374a05d79054..d75dd8f2f673 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_out_of_order_ids.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_out_of_order_ids.yaml @@ -19,13 +19,13 @@ interactions: body: string: '' headers: - apim-request-id: 4796e8a5-c37c-4138-ba0b-49f045ded220 - date: Tue, 23 Feb 2021 18:57:52 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/2d880e75-e584-4c90-ad78-690775810276 + apim-request-id: e6a6004d-a882-40b7-a1a0-a765c7ffc48e + date: Mon, 01 Mar 2021 19:55:07 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/64846a89-afcd-40e8-9bc2-23e1a899c0f9 strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '340' + x-envoy-upstream-service-time: '451' status: code: 202 message: Accepted @@ -36,22 +36,44 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/2d880e75-e584-4c90-ad78-690775810276 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/64846a89-afcd-40e8-9bc2-23e1a899c0f9 response: body: - string: '{"jobId":"2d880e75-e584-4c90-ad78-690775810276","lastUpdateDateTime":"2021-02-23T18:57:55Z","createdDateTime":"2021-02-23T18:57:52Z","expirationDateTime":"2021-02-24T18:57:52Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"56","entities":[],"relations":[],"warnings":[]},{"id":"0","entities":[],"relations":[],"warnings":[]},{"id":"19","entities":[],"relations":[],"warnings":[]},{"id":"1","entities":[],"relations":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"64846a89-afcd-40e8-9bc2-23e1a899c0f9","lastUpdateDateTime":"2021-03-01T19:55:08Z","createdDateTime":"2021-03-01T19:55:08Z","expirationDateTime":"2021-03-02T19:55:08Z","status":"notStarted","errors":[]}' + headers: + apim-request-id: c7011af7-a67a-4f14-9c72-cdd3a75b4f17 + content-type: application/json; charset=utf-8 + date: Mon, 01 Mar 2021 19:55:12 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '6' + status: + code: 200 + message: OK + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/64846a89-afcd-40e8-9bc2-23e1a899c0f9 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/64846a89-afcd-40e8-9bc2-23e1a899c0f9 + response: + body: + string: '{"jobId":"64846a89-afcd-40e8-9bc2-23e1a899c0f9","lastUpdateDateTime":"2021-03-01T19:55:15Z","createdDateTime":"2021-03-01T19:55:08Z","expirationDateTime":"2021-03-02T19:55:08Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"56","entities":[],"relations":[],"warnings":[]},{"id":"0","entities":[],"relations":[],"warnings":[]},{"id":"19","entities":[],"relations":[],"warnings":[]},{"id":"1","entities":[],"relations":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}}],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: bfd2ade3-8f25-4ea4-8ca9-2662ec953a8c + apim-request-id: 415cb370-9f6b-4ae5-b9e2-df73080ec8dc content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 18:57:59 GMT + date: Mon, 01 Mar 2021 19:55:17 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '2176' + x-envoy-upstream-service-time: '61' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/2d880e75-e584-4c90-ad78-690775810276 + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/64846a89-afcd-40e8-9bc2-23e1a899c0f9 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_pass_cls.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_pass_cls.yaml index 7809d097613a..69c36f1a6261 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_pass_cls.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_pass_cls.yaml @@ -12,37 +12,37 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: 0823d9e6-ef6d-45dd-bbf1-fb06a806f348 - date: Tue, 23 Feb 2021 17:11:51 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/e4db5537-a72b-46f5-be74-5c9d0ac17cd3 + apim-request-id: ee39b68a-478a-486e-8466-f0e6b5135cb1 + date: Mon, 01 Mar 2021 19:55:19 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/964176b1-75e3-47f6-b82c-1213c732056b strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '99' + x-envoy-upstream-service-time: '114' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/e4db5537-a72b-46f5-be74-5c9d0ac17cd3 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/964176b1-75e3-47f6-b82c-1213c732056b response: body: - string: '{"jobId":"e4db5537-a72b-46f5-be74-5c9d0ac17cd3","lastUpdateDateTime":"2021-02-23T17:11:53Z","createdDateTime":"2021-02-23T17:11:52Z","expirationDateTime":"2021-02-24T17:11:52Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":5,"length":11,"text":"passing - cls","category":"Diagnosis","confidenceScore":0.93,"isNegated":false}],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"964176b1-75e3-47f6-b82c-1213c732056b","lastUpdateDateTime":"2021-03-01T19:55:20Z","createdDateTime":"2021-03-01T19:55:19Z","expirationDateTime":"2021-03-02T19:55:19Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":5,"length":11,"text":"passing + cls","category":"Diagnosis","confidenceScore":0.93}],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: b012b13e-9522-4884-a0f4-70460974cb22 + apim-request-id: e86fafb5-09d6-4bf5-8efb-b996af786b51 content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:11:56 GMT + date: Mon, 01 Mar 2021 19:55:24 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff @@ -50,5 +50,5 @@ interactions: status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/e4db5537-a72b-46f5-be74-5c9d0ac17cd3 + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/964176b1-75e3-47f6-b82c-1213c732056b version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_passing_only_string.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_passing_only_string.yaml index b24bbba8eb3e..a9f54ccd9bef 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_passing_only_string.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_passing_only_string.yaml @@ -14,40 +14,40 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: 21e1eac9-e980-431f-adac-f1960391e2e4 - date: Tue, 23 Feb 2021 17:13:27 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/ef7efc7f-dc28-4ee0-932b-f2368dfead0c + apim-request-id: 6de8a2f4-60bb-4e64-b354-6bcccfeb8d27 + date: Mon, 01 Mar 2021 19:55:14 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/e35dc7d2-a539-4751-a334-b05681b6b607 strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '122' + x-envoy-upstream-service-time: '94' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/ef7efc7f-dc28-4ee0-932b-f2368dfead0c + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/e35dc7d2-a539-4751-a334-b05681b6b607 response: body: - string: '{"jobId":"ef7efc7f-dc28-4ee0-932b-f2368dfead0c","lastUpdateDateTime":"2021-02-23T17:13:28Z","createdDateTime":"2021-02-23T17:13:28Z","expirationDateTime":"2021-02-24T17:13:28Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":29,"length":19,"text":"high - blood pressure","category":"Diagnosis","confidenceScore":1.0,"isNegated":true,"links":[{"dataSource":"UMLS","id":"C0020538"},{"dataSource":"AOD","id":"0000023317"},{"dataSource":"BI","id":"BI00001"},{"dataSource":"CCPSS","id":"1017493"},{"dataSource":"CCS","id":"7.1"},{"dataSource":"CHV","id":"0000015800"},{"dataSource":"COSTAR","id":"397"},{"dataSource":"CSP","id":"0571-5243"},{"dataSource":"CST","id":"HYPERTENS"},{"dataSource":"DXP","id":"U002034"},{"dataSource":"HPO","id":"HP:0000822"},{"dataSource":"ICD10","id":"I10-I15.9"},{"dataSource":"ICD10AM","id":"I10-I15.9"},{"dataSource":"ICD10CM","id":"I10"},{"dataSource":"ICD9CM","id":"997.91"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU035456"},{"dataSource":"ICPC2P","id":"K85004"},{"dataSource":"LCH","id":"U002317"},{"dataSource":"LCH_NW","id":"sh85063723"},{"dataSource":"LNC","id":"LA14293-7"},{"dataSource":"MDR","id":"10020772"},{"dataSource":"MEDCIN","id":"33288"},{"dataSource":"MEDLINEPLUS","id":"34"},{"dataSource":"MSH","id":"D006973"},{"dataSource":"MTH","id":"005"},{"dataSource":"MTHICD9","id":"997.91"},{"dataSource":"NANDA-I","id":"00905"},{"dataSource":"NCI","id":"C3117"},{"dataSource":"NCI_CPTAC","id":"C3117"},{"dataSource":"NCI_CTCAE","id":"E13785"},{"dataSource":"NCI_CTRP","id":"C3117"},{"dataSource":"NCI_FDA","id":"1908"},{"dataSource":"NCI_GDC","id":"C3117"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000458091"},{"dataSource":"NCI_NICHD","id":"C3117"},{"dataSource":"NOC","id":"060808"},{"dataSource":"OMIM","id":"MTHU002068"},{"dataSource":"PCDS","id":"PRB_11000.06"},{"dataSource":"PDQ","id":"CDR0000686951"},{"dataSource":"PSY","id":"23830"},{"dataSource":"RCD","id":"XE0Ub"},{"dataSource":"SNM","id":"F-70700"},{"dataSource":"SNMI","id":"D3-02000"},{"dataSource":"SNOMEDCT_US","id":"38341003"},{"dataSource":"WHO","id":"0210"}]}],"relations":[],"warnings":[]},{"id":"1","entities":[{"offset":11,"length":5,"text":"100mg","category":"Dosage","confidenceScore":0.98,"isNegated":false},{"offset":17,"length":9,"text":"ibuprofen","category":"MedicationName","confidenceScore":1.0,"isNegated":false,"links":[{"dataSource":"UMLS","id":"C0020740"},{"dataSource":"AOD","id":"0000019879"},{"dataSource":"ATC","id":"M01AE01"},{"dataSource":"CCPSS","id":"0046165"},{"dataSource":"CHV","id":"0000006519"},{"dataSource":"CSP","id":"2270-2077"},{"dataSource":"DRUGBANK","id":"DB01050"},{"dataSource":"GS","id":"1611"},{"dataSource":"LCH_NW","id":"sh97005926"},{"dataSource":"LNC","id":"LP16165-0"},{"dataSource":"MEDCIN","id":"40458"},{"dataSource":"MMSL","id":"d00015"},{"dataSource":"MSH","id":"D007052"},{"dataSource":"MTHSPL","id":"WK2XYI10QM"},{"dataSource":"NCI","id":"C561"},{"dataSource":"NCI_CTRP","id":"C561"},{"dataSource":"NCI_DCP","id":"00803"},{"dataSource":"NCI_DTP","id":"NSC0256857"},{"dataSource":"NCI_FDA","id":"WK2XYI10QM"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000613511"},{"dataSource":"NDDF","id":"002377"},{"dataSource":"PDQ","id":"CDR0000040475"},{"dataSource":"RCD","id":"x02MO"},{"dataSource":"RXNORM","id":"5640"},{"dataSource":"SNM","id":"E-7772"},{"dataSource":"SNMI","id":"C-603C0"},{"dataSource":"SNOMEDCT_US","id":"387207008"},{"dataSource":"USP","id":"m39860"},{"dataSource":"USPMG","id":"MTHU000060"},{"dataSource":"VANDF","id":"4017840"}]},{"offset":34,"length":11,"text":"twice - daily","category":"Frequency","confidenceScore":1.0,"isNegated":false}],"relations":[{"relationType":"DosageOfMedication","bidirectional":false,"source":"#/results/documents/1/entities/0","target":"#/results/documents/1/entities/1"},{"relationType":"FrequencyOfMedication","bidirectional":false,"source":"#/results/documents/1/entities/2","target":"#/results/documents/1/entities/1"}],"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"e35dc7d2-a539-4751-a334-b05681b6b607","lastUpdateDateTime":"2021-03-01T19:55:15Z","createdDateTime":"2021-03-01T19:55:15Z","expirationDateTime":"2021-03-02T19:55:15Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":29,"length":19,"text":"high + blood pressure","category":"Diagnosis","confidenceScore":1.0,"assertion":{"certainty":"negative"},"links":[{"dataSource":"UMLS","id":"C0020538"},{"dataSource":"AOD","id":"0000023317"},{"dataSource":"BI","id":"BI00001"},{"dataSource":"CCPSS","id":"1017493"},{"dataSource":"CCS","id":"7.1"},{"dataSource":"CHV","id":"0000015800"},{"dataSource":"COSTAR","id":"397"},{"dataSource":"CSP","id":"0571-5243"},{"dataSource":"CST","id":"HYPERTENS"},{"dataSource":"DXP","id":"U002034"},{"dataSource":"HPO","id":"HP:0000822"},{"dataSource":"ICD10","id":"I10-I15.9"},{"dataSource":"ICD10AM","id":"I10-I15.9"},{"dataSource":"ICD10CM","id":"I10"},{"dataSource":"ICD9CM","id":"997.91"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU035456"},{"dataSource":"ICPC2P","id":"K85004"},{"dataSource":"LCH","id":"U002317"},{"dataSource":"LCH_NW","id":"sh85063723"},{"dataSource":"LNC","id":"LA14293-7"},{"dataSource":"MDR","id":"10020772"},{"dataSource":"MEDCIN","id":"33288"},{"dataSource":"MEDLINEPLUS","id":"34"},{"dataSource":"MSH","id":"D006973"},{"dataSource":"MTH","id":"005"},{"dataSource":"MTHICD9","id":"997.91"},{"dataSource":"NANDA-I","id":"00905"},{"dataSource":"NCI","id":"C3117"},{"dataSource":"NCI_CPTAC","id":"C3117"},{"dataSource":"NCI_CTCAE","id":"E13785"},{"dataSource":"NCI_CTRP","id":"C3117"},{"dataSource":"NCI_FDA","id":"1908"},{"dataSource":"NCI_GDC","id":"C3117"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000458091"},{"dataSource":"NCI_NICHD","id":"C3117"},{"dataSource":"NOC","id":"060808"},{"dataSource":"OMIM","id":"MTHU002068"},{"dataSource":"PCDS","id":"PRB_11000.06"},{"dataSource":"PDQ","id":"CDR0000686951"},{"dataSource":"PSY","id":"23830"},{"dataSource":"RCD","id":"XE0Ub"},{"dataSource":"SNM","id":"F-70700"},{"dataSource":"SNMI","id":"D3-02000"},{"dataSource":"SNOMEDCT_US","id":"38341003"},{"dataSource":"WHO","id":"0210"}]}],"relations":[],"warnings":[]},{"id":"1","entities":[{"offset":11,"length":5,"text":"100mg","category":"Dosage","confidenceScore":0.98},{"offset":17,"length":9,"text":"ibuprofen","category":"MedicationName","confidenceScore":1.0,"links":[{"dataSource":"UMLS","id":"C0020740"},{"dataSource":"AOD","id":"0000019879"},{"dataSource":"ATC","id":"M01AE01"},{"dataSource":"CCPSS","id":"0046165"},{"dataSource":"CHV","id":"0000006519"},{"dataSource":"CSP","id":"2270-2077"},{"dataSource":"DRUGBANK","id":"DB01050"},{"dataSource":"GS","id":"1611"},{"dataSource":"LCH_NW","id":"sh97005926"},{"dataSource":"LNC","id":"LP16165-0"},{"dataSource":"MEDCIN","id":"40458"},{"dataSource":"MMSL","id":"d00015"},{"dataSource":"MSH","id":"D007052"},{"dataSource":"MTHSPL","id":"WK2XYI10QM"},{"dataSource":"NCI","id":"C561"},{"dataSource":"NCI_CTRP","id":"C561"},{"dataSource":"NCI_DCP","id":"00803"},{"dataSource":"NCI_DTP","id":"NSC0256857"},{"dataSource":"NCI_FDA","id":"WK2XYI10QM"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000613511"},{"dataSource":"NDDF","id":"002377"},{"dataSource":"PDQ","id":"CDR0000040475"},{"dataSource":"RCD","id":"x02MO"},{"dataSource":"RXNORM","id":"5640"},{"dataSource":"SNM","id":"E-7772"},{"dataSource":"SNMI","id":"C-603C0"},{"dataSource":"SNOMEDCT_US","id":"387207008"},{"dataSource":"USP","id":"m39860"},{"dataSource":"USPMG","id":"MTHU000060"},{"dataSource":"VANDF","id":"4017840"}]},{"offset":34,"length":11,"text":"twice + daily","category":"Frequency","confidenceScore":1.0}],"relations":[{"relationType":"DosageOfMedication","entities":[{"ref":"#/results/documents/1/entities/0","role":"Attribute"},{"ref":"#/results/documents/1/entities/1","role":"Entity"}]},{"relationType":"FrequencyOfMedication","entities":[{"ref":"#/results/documents/1/entities/1","role":"Entity"},{"ref":"#/results/documents/1/entities/2","role":"Attribute"}]}],"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}}],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: 714b29e3-fc5e-4472-9452-8be3f217c386 + apim-request-id: 81de850f-0b06-44f6-be7e-0ab86bf90386 content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:13:33 GMT + date: Mon, 01 Mar 2021 19:55:20 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff @@ -55,5 +55,5 @@ interactions: status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/ef7efc7f-dc28-4ee0-932b-f2368dfead0c + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/e35dc7d2-a539-4751-a334-b05681b6b607 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_payload_too_large.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_payload_too_large.yaml index 5f5185fce333..fe4f97936415 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_payload_too_large.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_payload_too_large.yaml @@ -8511,21 +8511,21 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Request Payload sent is too large to be processed. Limit request size to: 524288"}}}' headers: - apim-request-id: cee18978-e306-4377-972d-18eb8d2166c5 + apim-request-id: 6255ac09-8255-4393-9416-2bf97c25db47 content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:07:24 GMT + date: Mon, 01 Mar 2021 19:55:25 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '24' + x-envoy-upstream-service-time: '31' status: code: 413 message: Payload Too Large - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_relations.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_relations.yaml new file mode 100644 index 000000000000..9b1f00287c3c --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_relations.yaml @@ -0,0 +1,78 @@ +interactions: +- request: + body: '{"documents": [{"id": "0", "text": "The patient was diagnosed with Parkinsons + Disease (PD)", "language": "en"}]}' + headers: + Accept: + - application/json, text/json + Content-Length: + - '112' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: POST + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint + response: + body: + string: '' + headers: + apim-request-id: 2d7453bd-5a05-47be-943b-e330b8c542ee + date: Tue, 02 Mar 2021 16:02:34 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/0cfff844-d608-4679-be0b-922945347987 + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '394' + status: + code: 202 + message: Accepted + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/0cfff844-d608-4679-be0b-922945347987 + response: + body: + string: '{"jobId":"0cfff844-d608-4679-be0b-922945347987","lastUpdateDateTime":"2021-03-02T16:02:34Z","createdDateTime":"2021-03-02T16:02:33Z","expirationDateTime":"2021-03-03T16:02:33Z","status":"notStarted","errors":[]}' + headers: + apim-request-id: c1a37487-107f-4d73-b340-fe0d8176c275 + content-type: application/json; charset=utf-8 + date: Tue, 02 Mar 2021 16:02:38 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '144' + status: + code: 200 + message: OK + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/0cfff844-d608-4679-be0b-922945347987 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/0cfff844-d608-4679-be0b-922945347987 + response: + body: + string: '{"jobId":"0cfff844-d608-4679-be0b-922945347987","lastUpdateDateTime":"2021-03-02T16:02:41Z","createdDateTime":"2021-03-02T16:02:33Z","expirationDateTime":"2021-03-03T16:02:33Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"0","entities":[{"offset":31,"length":18,"text":"Parkinsons + Disease","category":"Diagnosis","confidenceScore":1.0,"links":[{"dataSource":"UMLS","id":"C0030567"},{"dataSource":"AOD","id":"0000006203"},{"dataSource":"BI","id":"BI00554"},{"dataSource":"CCPSS","id":"1018057"},{"dataSource":"CCS","id":"6.2.1"},{"dataSource":"CCSR_10","id":"NVS004"},{"dataSource":"CHV","id":"0000009319"},{"dataSource":"COSTAR","id":"559"},{"dataSource":"CSP","id":"2057-3689"},{"dataSource":"CST","id":"EXTRAPYR + SYND"},{"dataSource":"ICD10","id":"G20"},{"dataSource":"ICD10AM","id":"G20"},{"dataSource":"ICD10CM","id":"G20"},{"dataSource":"ICD9CM","id":"332.0"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU004748"},{"dataSource":"ICPC2P","id":"N87001"},{"dataSource":"LCH_NW","id":"sh85098115"},{"dataSource":"LNC","id":"MTHU020807"},{"dataSource":"MDR","id":"10061536"},{"dataSource":"MEDCIN","id":"32004"},{"dataSource":"MEDLINEPLUS","id":"85"},{"dataSource":"MSH","id":"D010300"},{"dataSource":"NANDA-I","id":"03003"},{"dataSource":"NCI","id":"C26845"},{"dataSource":"NCI_CELLOSAURUS","id":"C26845"},{"dataSource":"NCI_CPTAC","id":"C26845"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000044140"},{"dataSource":"OMIM","id":"516000"},{"dataSource":"PSY","id":"36720"},{"dataSource":"QMR","id":"R0121461"},{"dataSource":"RAM","id":"DX353"},{"dataSource":"RCD","id":"F12.."},{"dataSource":"SNM","id":"D-8450"},{"dataSource":"SNMI","id":"DA-21012"},{"dataSource":"SNOMEDCT_US","id":"49049000"},{"dataSource":"WHO","id":"0106"}]},{"offset":51,"length":2,"text":"PD","category":"Diagnosis","confidenceScore":1.0,"links":[{"dataSource":"UMLS","id":"C0030567"},{"dataSource":"AOD","id":"0000006203"},{"dataSource":"BI","id":"BI00554"},{"dataSource":"CCPSS","id":"1018057"},{"dataSource":"CCS","id":"6.2.1"},{"dataSource":"CCSR_10","id":"NVS004"},{"dataSource":"CHV","id":"0000009319"},{"dataSource":"COSTAR","id":"559"},{"dataSource":"CSP","id":"2057-3689"},{"dataSource":"CST","id":"EXTRAPYR + SYND"},{"dataSource":"ICD10","id":"G20"},{"dataSource":"ICD10AM","id":"G20"},{"dataSource":"ICD10CM","id":"G20"},{"dataSource":"ICD9CM","id":"332.0"},{"dataSource":"ICPC2ICD10ENG","id":"MTHU004748"},{"dataSource":"ICPC2P","id":"N87001"},{"dataSource":"LCH_NW","id":"sh85098115"},{"dataSource":"LNC","id":"MTHU020807"},{"dataSource":"MDR","id":"10061536"},{"dataSource":"MEDCIN","id":"32004"},{"dataSource":"MEDLINEPLUS","id":"85"},{"dataSource":"MSH","id":"D010300"},{"dataSource":"NANDA-I","id":"03003"},{"dataSource":"NCI","id":"C26845"},{"dataSource":"NCI_CELLOSAURUS","id":"C26845"},{"dataSource":"NCI_CPTAC","id":"C26845"},{"dataSource":"NCI_NCI-GLOSS","id":"CDR0000044140"},{"dataSource":"OMIM","id":"516000"},{"dataSource":"PSY","id":"36720"},{"dataSource":"QMR","id":"R0121461"},{"dataSource":"RAM","id":"DX353"},{"dataSource":"RCD","id":"F12.."},{"dataSource":"SNM","id":"D-8450"},{"dataSource":"SNMI","id":"DA-21012"},{"dataSource":"SNOMEDCT_US","id":"49049000"},{"dataSource":"WHO","id":"0106"}]}],"relations":[{"relationType":"Abbreviation","entities":[{"ref":"#/results/documents/0/entities/0","role":"FullTerm"},{"ref":"#/results/documents/0/entities/1","role":"AbbreviatedTerm"}]}],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + headers: + apim-request-id: 855d4679-ce18-4e26-84ea-b922099ac3b1 + content-type: application/json; charset=utf-8 + date: Tue, 02 Mar 2021 16:02:44 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '32' + status: + code: 200 + message: OK + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/0cfff844-d608-4679-be0b-922945347987 +version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_show_stats_and_model_version.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_show_stats_and_model_version.yaml index d8dde0d67141..008a5a8ff12c 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_show_stats_and_model_version.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_show_stats_and_model_version.yaml @@ -14,44 +14,44 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?model-version=2021-01-11&stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?model-version=2021-01-11&stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: 3c1899df-f3c8-4ede-8042-365ea8657efb - date: Tue, 23 Feb 2021 17:14:00 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/3b93f244-e343-4ec8-b664-6f81bce51bbf + apim-request-id: 4ca5f534-ea56-4145-b8b8-fe320dcd43bb + date: Mon, 01 Mar 2021 19:55:20 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/024502d5-c320-49d5-8225-9bb17e6a97df strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '140' + x-envoy-upstream-service-time: '95' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?model-version=2021-01-11&stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?model-version=2021-01-11&stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/3b93f244-e343-4ec8-b664-6f81bce51bbf?showStats=True + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/024502d5-c320-49d5-8225-9bb17e6a97df?showStats=True response: body: - string: '{"jobId":"3b93f244-e343-4ec8-b664-6f81bce51bbf","lastUpdateDateTime":"2021-02-23T17:14:03Z","createdDateTime":"2021-02-23T17:14:01Z","expirationDateTime":"2021-02-24T17:14:01Z","status":"succeeded","errors":[],"results":{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"0","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"19","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"1","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid + string: '{"jobId":"024502d5-c320-49d5-8225-9bb17e6a97df","lastUpdateDateTime":"2021-03-01T19:55:26Z","createdDateTime":"2021-03-01T19:55:21Z","expirationDateTime":"2021-03-02T19:55:21Z","status":"succeeded","errors":[],"results":{"statistics":{"documentsCount":5,"validDocumentsCount":4,"erroneousDocumentsCount":1,"transactionsCount":4},"documents":[{"id":"56","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"0","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"19","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]},{"id":"1","statistics":{"charactersCount":2,"transactionsCount":1},"entities":[],"relations":[],"warnings":[]}],"errors":[{"id":"22","error":{"code":"InvalidArgument","message":"Invalid document in request.","innererror":{"code":"InvalidDocument","message":"Document text is empty."}}}],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: 74ffb544-a3c8-4d69-ad6e-fc5074ca2c36 + apim-request-id: 66d8a31d-92c2-4b7b-962e-3a9bc38f03a6 content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:14:07 GMT + date: Mon, 01 Mar 2021 19:55:25 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '53' + x-envoy-upstream-service-time: '62' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/3b93f244-e343-4ec8-b664-6f81bce51bbf?showStats=True + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/024502d5-c320-49d5-8225-9bb17e6a97df?showStats=True version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_too_many_documents.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_too_many_documents.yaml index e62218ae2dbd..0a7ee2f065e9 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_too_many_documents.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_too_many_documents.yaml @@ -761,21 +761,21 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '{"error":{"code":"InvalidRequest","message":"Invalid document in request.","innererror":{"code":"InvalidDocumentBatch","message":"Batch request contains too many records. Max 10 records are permitted."}}}' headers: - apim-request-id: b2bbe7a5-3f78-492c-9105-31c8eef041be + apim-request-id: 83e038ce-1faf-4dbe-87a7-0965d5a88691 content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:16:55 GMT + date: Mon, 01 Mar 2021 19:55:18 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '8' + x-envoy-upstream-service-time: '9' status: code: 400 message: Bad Request - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_user_agent.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_user_agent.yaml index 772153b7d762..5e9155e7af99 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_user_agent.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_user_agent.yaml @@ -12,42 +12,42 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: 46c93a1c-76fb-4f9a-942e-65e2b720ba04 - date: Tue, 23 Feb 2021 17:11:23 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/ce2be9f1-2623-48f2-9846-91427b74bf3e + apim-request-id: 465244eb-194b-413b-b278-8a799f7cb382 + date: Mon, 01 Mar 2021 19:55:18 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/d170171d-4b93-463b-bf40-5f8684335eec strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '106' + x-envoy-upstream-service-time: '64' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/ce2be9f1-2623-48f2-9846-91427b74bf3e + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/d170171d-4b93-463b-bf40-5f8684335eec response: body: - string: '{"jobId":"ce2be9f1-2623-48f2-9846-91427b74bf3e","lastUpdateDateTime":"2021-02-23T17:11:25Z","createdDateTime":"2021-02-23T17:11:24Z","expirationDateTime":"2021-02-24T17:11:24Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"1","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"d170171d-4b93-463b-bf40-5f8684335eec","lastUpdateDateTime":"2021-03-01T19:55:20Z","createdDateTime":"2021-03-01T19:55:19Z","expirationDateTime":"2021-03-02T19:55:19Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"1","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: b5d4f891-4408-4764-a00d-098c3f048150 + apim-request-id: b7f83d82-788a-48e9-b640-51e0ef4209f6 content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:11:28 GMT + date: Mon, 01 Mar 2021 19:55:24 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '33' + x-envoy-upstream-service-time: '99' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/ce2be9f1-2623-48f2-9846-91427b74bf3e + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/d170171d-4b93-463b-bf40-5f8684335eec version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_whole_batch_language_hint_and_dict_input.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_whole_batch_language_hint_and_dict_input.yaml index c57c22c6a92e..6abbd878305d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_whole_batch_language_hint_and_dict_input.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_healthcare_async.test_whole_batch_language_hint_and_dict_input.yaml @@ -14,42 +14,42 @@ interactions: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint response: body: string: '' headers: - apim-request-id: d1c18c56-d44b-42d0-9f6b-015314b5c9b3 - date: Tue, 23 Feb 2021 17:11:57 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/5914a788-d387-47b2-be93-2e51e8012e77 + apim-request-id: eeac3b7a-3919-4b72-8751-83c2c1333885 + date: Mon, 01 Mar 2021 19:55:29 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/12b6b0f3-6abb-4162-821d-8042fa920072 strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '141' + x-envoy-upstream-service-time: '111' status: code: 202 message: Accepted - url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.3/entities/health/jobs?stringIndexType=UnicodeCodePoint + url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.4/entities/health/jobs?stringIndexType=UnicodeCodePoint - request: body: null headers: User-Agent: - azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/5914a788-d387-47b2-be93-2e51e8012e77 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/12b6b0f3-6abb-4162-821d-8042fa920072 response: body: - string: '{"jobId":"5914a788-d387-47b2-be93-2e51e8012e77","lastUpdateDateTime":"2021-02-23T17:12:01Z","createdDateTime":"2021-02-23T17:11:58Z","expirationDateTime":"2021-02-24T17:11:58Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"1","entities":[],"relations":[],"warnings":[]},{"id":"2","entities":[],"relations":[],"warnings":[]},{"id":"3","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' + string: '{"jobId":"12b6b0f3-6abb-4162-821d-8042fa920072","lastUpdateDateTime":"2021-03-01T19:55:31Z","createdDateTime":"2021-03-01T19:55:29Z","expirationDateTime":"2021-03-02T19:55:29Z","status":"succeeded","errors":[],"results":{"documents":[{"id":"1","entities":[],"relations":[],"warnings":[]},{"id":"2","entities":[],"relations":[],"warnings":[]},{"id":"3","entities":[],"relations":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-11"}}' headers: - apim-request-id: bc128673-0550-4719-b1ef-65dfba627b85 + apim-request-id: e7218a4b-ffee-4325-a899-463ff332e84e content-type: application/json; charset=utf-8 - date: Tue, 23 Feb 2021 17:12:03 GMT + date: Mon, 01 Mar 2021 19:55:34 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '42' + x-envoy-upstream-service-time: '47' status: code: 200 message: OK - url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/entities/health/jobs/5914a788-d387-47b2-be93-2e51e8012e77 + url: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/entities/health/jobs/12b6b0f3-6abb-4162-821d-8042fa920072 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_healthcare.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_healthcare.py index 89c171beee57..3da82f9ae840 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_healthcare.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_healthcare.py @@ -19,6 +19,8 @@ TextDocumentInput, VERSION, TextAnalyticsApiVersion, + HealthcareEntityRelationType, + HealthcareEntityRelationRoleType, ) # pre-apply the client_cls positional argument so it needn't be explicitly passed below @@ -30,13 +32,13 @@ def _interval(self): return 5 if self.is_live else 0 @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_no_single_input(self, client): with self.assertRaises(TypeError): response = client.begin_analyze_healthcare_entities("hello world").result() @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_passing_only_string(self, client): docs = [ u"Patient does not suffer from high blood pressure.", @@ -54,7 +56,7 @@ def test_passing_only_string(self, client): self.assertTrue(response[2].is_error) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_input_with_some_errors(self, client): docs = [{"id": "1", "language": "en", "text": ""}, {"id": "2", "language": "english", "text": "Patient does not suffer from high blood pressure."}, @@ -66,7 +68,7 @@ def test_input_with_some_errors(self, client): self.assertFalse(response[2].is_error) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_too_many_documents(self, client): docs = list(itertools.repeat("input document", 11)) # Maximum number of documents per request is 10 @@ -76,7 +78,7 @@ def test_too_many_documents(self, client): assert excinfo.value.status_code == 400 @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_payload_too_large(self, client): large_doc = "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | \ CORONARY ARTERY DISEASE | Signed | DIS | Admission Date: 5/22/2001 \ @@ -99,7 +101,7 @@ def test_payload_too_large(self, client): assert excinfo.value.status_code == 413 @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_out_of_order_ids(self, client): @@ -117,7 +119,7 @@ def test_out_of_order_ids(self, client): self.assertEqual(resp.id, expected_order[idx]) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_show_stats_and_model_version(self, client): docs = [{"id": "56", "text": ":)"}, {"id": "0", "text": ":("}, @@ -143,7 +145,7 @@ def test_show_stats_and_model_version(self, client): self.assertIsNotNone(doc.statistics) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_whole_batch_language_hint_and_dict_input(self, client): docs = [{"id": "1", "text": "I will go to the park."}, {"id": "2", "text": "I did not like the hotel we stayed at."}, @@ -155,7 +157,7 @@ def test_whole_batch_language_hint_and_dict_input(self, client): self.assertFalse(response[2].is_error) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_invalid_language_hint_method(self, client): response = list(client.begin_analyze_healthcare_entities( ["This should fail because we're passing in an invalid language hint"], language="notalanguage", polling_interval=self._interval() @@ -163,7 +165,7 @@ def test_invalid_language_hint_method(self, client): self.assertEqual(response[0].error.code, 'UnsupportedLanguageCode') @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_invalid_language_hint_docs(self, client): response = list(client.begin_analyze_healthcare_entities( [{"id": "1", "language": "notalanguage", "text": "This should fail because we're passing in an invalid language hint"}], @@ -172,7 +174,7 @@ def test_invalid_language_hint_docs(self, client): self.assertEqual(response[0].error.code, 'UnsupportedLanguageCode') @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_user_agent(self, client): # TODO: verify docs = [{"id": "1", "text": "I will go to the park."}] @@ -185,7 +187,7 @@ def test_user_agent(self, client): # TODO: verify poller.result() # need to call this before tearDown runs even though we don't need the response for the test. @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_document_attribute_error_no_result_attribute(self, client): docs = [{"id": "1", "text": ""}] result = client.begin_analyze_healthcare_entities(docs, polling_interval=self._interval()).result() @@ -208,7 +210,7 @@ def test_document_attribute_error_no_result_attribute(self, client): ) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_bad_model_version_error(self, client): docs = [{"id": "1", "language": "english", "text": "I did not like the hotel we stayed at."}] @@ -219,7 +221,7 @@ def test_bad_model_version_error(self, client): self.assertIsNotNone(err.error.message) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_document_errors(self, client): text = "" for _ in range(5121): @@ -239,7 +241,7 @@ def test_document_errors(self, client): self.assertIsNotNone(doc_errors[2].error.message) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_duplicate_ids_error(self, client): # Duplicate Ids docs = [{"id": "1", "text": "hello world"}, @@ -252,7 +254,7 @@ def test_duplicate_ids_error(self, client): self.assertIsNotNone(err.error.message) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_pass_cls(self, client): def callback(pipeline_response, deserialized, _): return "cls result" @@ -266,7 +268,7 @@ def callback(pipeline_response, deserialized, _): """Commenting out multi page tests until service returns multiple pages""" # @GlobalTextAnalyticsAccountPreparer() - # @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + # @TextAnalyticsClientPreparer() # def test_multiple_pages_of_results_returned_successfully(self, client): # single_doc = "hello world" # docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 10)))] @@ -285,7 +287,7 @@ def callback(pipeline_response, deserialized, _): # self.assertIsNotNone(doc.statistics) # @GlobalTextAnalyticsAccountPreparer() - # @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + # @TextAnalyticsClientPreparer() # def test_multiple_pages_of_results_with_errors_returned_successfully(self, client): # single_doc = "hello world" # docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 9)))] @@ -312,7 +314,7 @@ def callback(pipeline_response, deserialized, _): # self.assertIsNotNone(doc.statistics) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_cancellation(self, client): single_doc = "hello world" docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 10)))] @@ -327,7 +329,7 @@ def test_cancellation(self, client): pass # expected if the operation was already in a terminal state. @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_default_string_index_type_is_UnicodeCodePoint(self, client): poller = client.begin_analyze_healthcare_entities(documents=["Hello world"]) actual_string_index_type = poller._polling_method._initial_response.http_request.query["stringIndexType"] @@ -335,7 +337,7 @@ def test_default_string_index_type_is_UnicodeCodePoint(self, client): poller.result() @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() def test_explicit_set_string_index_type(self, client): poller = client.begin_analyze_healthcare_entities( documents=["Hello world"], @@ -346,20 +348,28 @@ def test_explicit_set_string_index_type(self, client): poller.result() @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) - def test_bidirectional_relation_type(self, client): + @TextAnalyticsClientPreparer() + def test_relations(self, client): result = list(client.begin_analyze_healthcare_entities( documents=["The patient was diagnosed with Parkinsons Disease (PD)"] ).result()) - self.assertEqual(len(result[0].entities), 2) - entity1 = list(filter(lambda x: x.text == "Parkinsons Disease", result[0].entities))[0] - entity2 = list(filter(lambda x: x.text == "PD", result[0].entities))[0] + assert len(result) == 1 + result = result[0] - related_entity1, relation_type1 = entity1.related_entities.popitem() - self.assertEqual(related_entity1, entity2) - self.assertEqual(relation_type1, "Abbreviation") - related_entity2, relation_type2 = entity2.related_entities.popitem() - self.assertEqual(related_entity2, entity1) - self.assertEqual(relation_type2, "Abbreviation") + assert len(result.entities) == 2 + assert len(result.entity_relations) == 1 + relation = result.entity_relations[0] + assert relation.relation_type == HealthcareEntityRelationType.ABBREVIATION + assert len(relation.roles) == 2 + + parkinsons_entity = list(filter(lambda x: x.text == "Parkinsons Disease", result.entities))[0] + parkinsons_abbreviation_entity = list(filter(lambda x: x.text == "PD", result.entities))[0] + + for role in relation.roles: + if role.name == HealthcareEntityRelationRoleType.FULL_TERM: + self.assert_healthcare_entities_equal(role.entity, parkinsons_entity) + else: + assert role.name == HealthcareEntityRelationRoleType.ABBREVIATED_TERM + self.assert_healthcare_entities_equal(role.entity, parkinsons_abbreviation_entity) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_healthcare_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_healthcare_async.py index 4e48c605580c..691e8ade3cf6 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_healthcare_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_healthcare_async.py @@ -22,6 +22,7 @@ TextDocumentInput, VERSION, TextAnalyticsApiVersion, + HealthcareEntityRelationType ) # pre-apply the client_cls positional argument so it needn't be explicitly passed below @@ -43,14 +44,14 @@ def _interval(self): return 5 if self.is_live else 0 @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_no_single_input(self, client): with self.assertRaises(TypeError): async with client: response = await (await client.begin_analyze_healthcare_entities("hello world", polling_interval=self._interval())).result() @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_passing_only_string(self, client): docs = [ u"Patient does not suffer from high blood pressure.", @@ -72,7 +73,7 @@ async def test_passing_only_string(self, client): self.assertTrue(response[2].is_error) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_input_with_some_errors(self, client): docs = [{"id": "1", "language": "en", "text": ""}, {"id": "2", "language": "english", "text": "Patient does not suffer from high blood pressure."}, @@ -89,7 +90,7 @@ async def test_input_with_some_errors(self, client): self.assertFalse(response[2].is_error) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_too_many_documents(self, client): docs = list(itertools.repeat("input document", 1001)) # Maximum number of documents per request is 1000 @@ -100,7 +101,7 @@ async def test_too_many_documents(self, client): assert excinfo.value.status_code == 400 @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_payload_too_large(self, client): large_doc = "RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | \ CORONARY ARTERY DISEASE | Signed | DIS | Admission Date: 5/22/2001 \ @@ -144,7 +145,7 @@ async def test_out_of_order_ids(self, client): self.assertEqual(resp.id, expected_order[idx]) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_show_stats_and_model_version(self, client): docs = [{"id": "56", "text": ":)"}, {"id": "0", "text": ":("}, @@ -172,7 +173,7 @@ async def test_show_stats_and_model_version(self, client): self.assertIsNotNone(doc.statistics) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_whole_batch_language_hint_and_dict_input(self, client): docs = [{"id": "1", "text": "I will go to the park."}, {"id": "2", "text": "I did not like the hotel we stayed at."}, @@ -189,7 +190,7 @@ async def test_whole_batch_language_hint_and_dict_input(self, client): self.assertFalse(response[2].is_error) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_invalid_language_hint_method(self, client): docs = ["This should fail because we're passing in an invalid language hint"] @@ -202,7 +203,7 @@ async def test_invalid_language_hint_method(self, client): self.assertEqual(response[0].error.code, 'UnsupportedLanguageCode') @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_invalid_language_hint_docs(self, client): docs = [{"id": "1", "language": "notalanguage", "text": "This should fail because we're passing in an invalid language hint"}] @@ -215,7 +216,7 @@ async def test_invalid_language_hint_docs(self, client): self.assertEqual(response[0].error.code, 'UnsupportedLanguageCode') @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_user_agent(self, client): # TODO: verify def callback(resp): self.assertIn("azsdk-python-ai-textanalytics/{} Python/{} ({})".format( @@ -235,7 +236,7 @@ def callback(resp): await poller.result() # need to call this before tearDown runs even though we don't need the response for the test. @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_bad_model_version_error(self, client): docs = [{"id": "1", "language": "english", "text": "I did not like the hotel we stayed at."}] @@ -250,7 +251,7 @@ async def test_bad_model_version_error(self, client): self.assertIsNotNone(err.error.message) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_document_errors(self, client): text = "" for _ in range(5121): @@ -273,7 +274,7 @@ async def test_document_errors(self, client): self.assertIsNotNone(doc_errors[2].error.message) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_duplicate_ids_error(self, client): # Duplicate Ids docs = [{"id": "1", "text": "hello world"}, @@ -286,7 +287,7 @@ async def test_duplicate_ids_error(self, client): self.assertIsNotNone(err.error.message) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_pass_cls(self, client): def callback(pipeline_response, deserialized, _): return "cls result" @@ -302,7 +303,7 @@ def callback(pipeline_response, deserialized, _): """Commenting out multi page tests until service returns multiple pages""" # @GlobalTextAnalyticsAccountPreparer() - # @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + # @TextAnalyticsClientPreparer() # async def test_multiple_pages_of_results_returned_successfully(self, client): # single_doc = "hello world" # docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 10)))] @@ -324,7 +325,7 @@ def callback(pipeline_response, deserialized, _): # self.assertEqual(docs[idx]["id"], doc.id) # @GlobalTextAnalyticsAccountPreparer() - # @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + # @TextAnalyticsClientPreparer() # async def test_multiple_pages_of_results_with_errors_returned_successfully(self, client): # single_doc = "hello world" # docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 9)))] @@ -353,7 +354,7 @@ def callback(pipeline_response, deserialized, _): # self.assertIsNotNone(doc.statistics) @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_cancellation(self, client): single_doc = "hello world" docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 10)))] @@ -370,7 +371,7 @@ async def test_cancellation(self, client): @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_default_string_index_type_is_UnicodeCodePoint(self, client): poller = await client.begin_analyze_healthcare_entities(documents=["Hello world"]) actual_string_index_type = poller._polling_method._initial_response.http_request.query["stringIndexType"] @@ -378,7 +379,7 @@ async def test_default_string_index_type_is_UnicodeCodePoint(self, client): await poller.result() @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) + @TextAnalyticsClientPreparer() async def test_explicit_set_string_index_type(self, client): poller = await client.begin_analyze_healthcare_entities( documents=["Hello world"], @@ -389,8 +390,8 @@ async def test_explicit_set_string_index_type(self, client): await poller.result() @GlobalTextAnalyticsAccountPreparer() - @TextAnalyticsClientPreparer(client_kwargs={"api_version": TextAnalyticsApiVersion.V3_1_PREVIEW_3}) - async def test_bidirectional_relation_type(self, client): + @TextAnalyticsClientPreparer() + async def test_relations(self, client): response = await (await client.begin_analyze_healthcare_entities( documents=["The patient was diagnosed with Parkinsons Disease (PD)"] )).result() @@ -399,15 +400,24 @@ async def test_bidirectional_relation_type(self, client): async for r in response: result.append(r) - self.assertEqual(len(result[0].entities), 2) - entity1 = list(filter(lambda x: x.text == "Parkinsons Disease", result[0].entities))[0] - entity2 = list(filter(lambda x: x.text == "PD", result[0].entities))[0] + assert len(result) == 1 + result = result[0] + + assert len(result.entities) == 2 + assert len(result.entity_relations) == 1 + + relation = result.entity_relations[0] + assert relation.relation_type == HealthcareEntityRelationType.ABBREVIATION + assert len(relation.roles) == 2 + + parkinsons_entity = list(filter(lambda x: x.text == "Parkinsons Disease", result.entities))[0] + parkinsons_abbreviation_entity = list(filter(lambda x: x.text == "PD", result.entities))[0] - related_entity1, relation_type1 = entity1.related_entities.popitem() - self.assertEqual(related_entity1, entity2) - self.assertEqual(relation_type1, "Abbreviation") - related_entity2, relation_type2 = entity2.related_entities.popitem() - self.assertEqual(related_entity2, entity1) - self.assertEqual(relation_type2, "Abbreviation") + for role in relation.roles: + if role.name == "FullTerm": + self.assert_healthcare_entities_equal(role.entity, parkinsons_entity) + else: + assert role.name == "AbbreviatedTerm" + self.assert_healthcare_entities_equal(role.entity, parkinsons_abbreviation_entity) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py index 3e62b7c983f8..ba97135c8384 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment.py @@ -723,7 +723,7 @@ def test_string_index_type_not_fail_v3(self, client): def test_string_index_type_explicit_fails_v3(self, client): with pytest.raises(ValueError) as excinfo: client.analyze_sentiment(["this should fail"], string_index_type="UnicodeCodePoint") - assert "'string_index_type' is only available for API version v3.1-preview and up" in str(excinfo.value) + assert "'string_index_type' is only available for API version V3_1_PREVIEW and up" in str(excinfo.value) @GlobalTextAnalyticsAccountPreparer() @TextAnalyticsClientPreparer() diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py index 861b1eabc799..f80097493f08 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_sentiment_async.py @@ -738,7 +738,7 @@ async def test_string_index_type_not_fail_v3(self, client): async def test_string_index_type_explicit_fails_v3(self, client): with pytest.raises(ValueError) as excinfo: await client.analyze_sentiment(["this should fail"], string_index_type="UnicodeCodePoint") - assert "'string_index_type' is only available for API version v3.1-preview and up" in str(excinfo.value) + assert "'string_index_type' is only available for API version V3_1_PREVIEW and up" in str(excinfo.value) @GlobalTextAnalyticsAccountPreparer() @TextAnalyticsClientPreparer() diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities.py index e45b8e662dfb..ca8e4832ebda 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities.py @@ -575,7 +575,7 @@ def test_string_index_type_not_fail_v3(self, client): def test_string_index_type_explicit_fails_v3(self, client): with pytest.raises(ValueError) as excinfo: client.recognize_entities(["this should fail"], string_index_type="UnicodeCodePoint") - assert "'string_index_type' is only available for API version v3.1-preview and up" in str(excinfo.value) + assert "'string_index_type' is only available for API version V3_1_PREVIEW and up" in str(excinfo.value) @GlobalTextAnalyticsAccountPreparer() @TextAnalyticsClientPreparer() diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities_async.py index dcae04c85fae..6f9e69ade61c 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_entities_async.py @@ -594,7 +594,7 @@ async def test_string_index_type_not_fail_v3(self, client): async def test_string_index_type_explicit_fails_v3(self, client): with pytest.raises(ValueError) as excinfo: await client.recognize_entities(["this should fail"], string_index_type="UnicodeCodePoint") - assert "'string_index_type' is only available for API version v3.1-preview and up" in str(excinfo.value) + assert "'string_index_type' is only available for API version V3_1_PREVIEW and up" in str(excinfo.value) @GlobalTextAnalyticsAccountPreparer() @TextAnalyticsClientPreparer() diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities.py index 598383c46d30..65e5a081700f 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities.py @@ -590,7 +590,7 @@ def test_bing_id(self, client): def test_string_index_type_explicit_fails_v3(self, client): with pytest.raises(ValueError) as excinfo: client.recognize_linked_entities(["this should fail"], string_index_type="UnicodeCodePoint") - assert "'string_index_type' is only available for API version v3.1-preview and up" in str(excinfo.value) + assert "'string_index_type' is only available for API version V3_1_PREVIEW and up" in str(excinfo.value) @GlobalTextAnalyticsAccountPreparer() @TextAnalyticsClientPreparer() diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities_async.py index 8f73a2a89dc0..e8dfc9c0c6d0 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities_async.py @@ -626,7 +626,7 @@ async def test_bing_id(self, client): async def test_string_index_type_explicit_fails_v3(self, client): with pytest.raises(ValueError) as excinfo: await client.recognize_linked_entities(["this should fail"], string_index_type="UnicodeCodePoint") - assert "'string_index_type' is only available for API version v3.1-preview and up" in str(excinfo.value) + assert "'string_index_type' is only available for API version V3_1_PREVIEW and up" in str(excinfo.value) @GlobalTextAnalyticsAccountPreparer() @TextAnalyticsClientPreparer() diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py index 5841a4dbb05d..773f6384fc45 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py @@ -572,7 +572,7 @@ def test_recognize_pii_entities_v3(self, client): with pytest.raises(ValueError) as excinfo: client.recognize_pii_entities(["this should fail"]) - assert "'recognize_pii_entities' endpoint is only available for API version v3.1-preview and up" in str(excinfo.value) + assert "'recognize_pii_entities' endpoint is only available for API version V3_1_PREVIEW and up" in str(excinfo.value) @GlobalTextAnalyticsAccountPreparer() @TextAnalyticsClientPreparer() @@ -601,7 +601,7 @@ def test_phi_domain_filter(self, client): def test_string_index_type_explicit_fails_v3(self, client): with pytest.raises(ValueError) as excinfo: client.recognize_pii_entities(["this should fail"], string_index_type="UnicodeCodePoint") - assert "'string_index_type' is only available for API version v3.1-preview and up" in str(excinfo.value) + assert "'string_index_type' is only available for API version V3_1_PREVIEW and up" in str(excinfo.value) @GlobalTextAnalyticsAccountPreparer() @TextAnalyticsClientPreparer() diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py index 55306a72e98e..1f467991f1c0 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities_async.py @@ -574,7 +574,7 @@ async def test_recognize_pii_entities_v3(self, client): with pytest.raises(ValueError) as excinfo: await client.recognize_pii_entities(["this should fail"]) - assert "'recognize_pii_entities' endpoint is only available for API version v3.1-preview and up" in str(excinfo.value) + assert "'recognize_pii_entities' endpoint is only available for API version V3_1_PREVIEW and up" in str(excinfo.value) @GlobalTextAnalyticsAccountPreparer() @TextAnalyticsClientPreparer() @@ -602,7 +602,7 @@ async def test_phi_domain_filter(self, client): async def test_string_index_type_explicit_fails_v3(self, client): with pytest.raises(ValueError) as excinfo: await client.recognize_pii_entities(["this should fail"], string_index_type="UnicodeCodePoint") - assert "'string_index_type' is only available for API version v3.1-preview and up" in str(excinfo.value) + assert "'string_index_type' is only available for API version V3_1_PREVIEW and up" in str(excinfo.value) @GlobalTextAnalyticsAccountPreparer() @TextAnalyticsClientPreparer() diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_repr.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_repr.py index 5653966b7d06..4af40c47ab9a 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_repr.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_repr.py @@ -263,6 +263,60 @@ def extract_key_phrases_result(text_analytics_warning, text_document_statistics) assert repr(model) == model_repr return model, model_repr +@pytest.fixture +def data_source(): + model = _models.HealthcareEntityDataSource( + entity_id="BONJOUR", + name="UMLS", + ) + model_repr = "HealthcareEntityDataSource(entity_id=BONJOUR, name=UMLS)" + + assert repr(model) == model_repr + return model, model_repr + +@pytest.fixture +def healthcare_entity(data_source): + model = _models.HealthcareEntity( + text="Bonjour", + category="MyCategory", + subcategory="MySubcategory", + length=7, + offset=12, + confidence_score=0.95, + data_sources=[data_source[0]], + ) + model_repr = ( + "HealthcareEntity(text=Bonjour, category=MyCategory, subcategory=MySubcategory, length=7, offset=12, " + + "confidence_score=0.95, data_sources=[{}])".format(data_source[1]) + ) + + assert repr(model) == model_repr + return model, model_repr + +@pytest.fixture +def healthcare_relation_role(healthcare_entity): + model = _models.HealthcareRelationRole( + name="ROLE", + entity=healthcare_entity[0] + ) + + model_repr = "HealthcareRelationRole(name=ROLE, entity={})".format(healthcare_entity[1]) + + assert repr(model) == model_repr + return model, model_repr + +@pytest.fixture +def healthcare_relation(healthcare_relation_role): + model = _models.HealthcareRelation( + relation_type="DOSAGE", + roles=[healthcare_relation_role[0]] + ) + + model_repr = "HealthcareRelation(relation_type=DOSAGE, roles=[{}])".format(healthcare_relation_role[1]) + + assert repr(model) == model_repr + return model, model_repr + class TestRepr(): def test_text_document_input(self): model = _models.TextDocumentInput( @@ -419,4 +473,24 @@ def test_analyze_batch_actions_result_extract_key_phrases(self, extract_key_phra ) ) + assert repr(model) == model_repr + + def test_analyze_healthcare_entities_result_item( + self, healthcare_entity, healthcare_relation, text_analytics_warning, text_document_statistics + ): + model = _models.AnalyzeHealthcareEntitiesResultItem( + id=1, + entities=[healthcare_entity[0]], + entity_relations=[healthcare_relation[0]], + warnings=[text_analytics_warning[0]], + statistics=text_document_statistics[0], + is_error=False + ) + + model_repr = ( + "AnalyzeHealthcareEntitiesResultItem(id=1, entities=[{}], entity_relations=[{}], warnings=[{}], statistics={}, is_error=False)".format( + healthcare_entity[1], healthcare_relation[1], text_analytics_warning[1], text_document_statistics[1] + ) + ) + assert repr(model) == model_repr \ No newline at end of file diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/testcase.py b/sdk/textanalytics/azure-ai-textanalytics/tests/testcase.py index b6f016036a6c..af101458e0c8 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/testcase.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/testcase.py @@ -71,6 +71,22 @@ def validateConfidenceScores(self, confidence_scores): confidence_scores.positive + confidence_scores.neutral + confidence_scores.negative, 1 ) + def assert_healthcare_data_sources_equal(self, data_sources_a, data_sources_b): + assert len(data_sources_a) == len(data_sources_b) + for data_source_a, data_source_b in zip(data_sources_a, data_sources_b): + assert data_source_a.entity_id == data_source_b.entity_id + assert data_source_a.name == data_source_b.name + + + def assert_healthcare_entities_equal(self, entity_a, entity_b): + assert entity_a.text == entity_b.text + assert entity_a.category == entity_b.category + assert entity_a.subcategory == entity_b.subcategory + assert len(entity_a.data_sources) == len(entity_b.data_sources) + self.assert_healthcare_data_sources_equal(entity_a.data_sources, entity_b.data_sources) + assert entity_a.length == entity_b.length + assert entity_a.offset == entity_b.offset + class GlobalResourceGroupPreparer(AzureMgmtPreparer): def __init__(self):