From 9e882d715a6d7541bc53ae77d6a05861f0e42f80 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Wed, 6 Oct 2021 14:24:06 -0700 Subject: [PATCH] [textanalytics] add support for custom text actions (#20721) * impl for custom actions sync/async + models * remove project_name and deployment_name from result models * update naming to classify documents * add samples for arch board * fix sample * update naming to align with all langs * update sample names * arch board feedback * rename samples and fix types * regenerate on latest swagger * add new tests and recordings * make corrections to code based on renames * remove samples from PR * fix * update changelog * update missing docstrings * bump azure-core for azure.core.rest --- .../azure-ai-textanalytics/CHANGELOG.md | 4 + .../azure/ai/textanalytics/__init__.py | 14 + .../azure/ai/textanalytics/_base_client.py | 4 +- .../_generated/_operations_mixin.py | 68 +- .../_generated/_text_analytics_client.py | 1 - .../_generated/aio/_operations_mixin.py | 49 +- .../_generated/aio/_text_analytics_client.py | 2 +- .../_generated/v3_0/_metadata.json | 27 +- .../_generated/v3_0/_text_analytics_client.py | 56 +- .../textanalytics/_generated/v3_0/_vendor.py | 15 + .../v3_0/aio/_text_analytics_client.py | 56 +- .../_text_analytics_client_operations.py | 227 +- .../_generated/v3_0/models/_models.py | 687 +++-- .../_generated/v3_0/models/_models_py3.py | 687 +++-- .../models/_text_analytics_client_enums.py | 29 +- .../_text_analytics_client_operations.py | 400 ++- .../_generated/v3_1/_metadata.json | 69 +- .../_generated/v3_1/_text_analytics_client.py | 59 +- .../textanalytics/_generated/v3_1/_vendor.py | 27 + .../v3_1/aio/_text_analytics_client.py | 59 +- .../_text_analytics_client_operations.py | 589 ++-- .../_generated/v3_1/models/_models.py | 1908 ++++++++---- .../_generated/v3_1/models/_models_py3.py | 1908 ++++++++---- .../models/_text_analytics_client_enums.py | 51 +- .../_text_analytics_client_operations.py | 1001 ++++--- .../_generated/v3_2_preview_2/_metadata.json | 69 +- .../v3_2_preview_2/_text_analytics_client.py | 59 +- .../_generated/v3_2_preview_2/_vendor.py | 27 + .../aio/_text_analytics_client.py | 59 +- .../_text_analytics_client_operations.py | 589 ++-- .../v3_2_preview_2/models/_models.py | 2573 ++++++++++++----- .../v3_2_preview_2/models/_models_py3.py | 2573 ++++++++++++----- .../models/_text_analytics_client_enums.py | 53 +- .../_text_analytics_client_operations.py | 1004 ++++--- .../azure/ai/textanalytics/_models.py | 376 +++ .../ai/textanalytics/_request_handlers.py | 11 +- .../ai/textanalytics/_response_handlers.py | 45 +- .../textanalytics/_text_analytics_client.py | 54 +- .../textanalytics/aio/_base_client_async.py | 4 +- .../aio/_text_analytics_client_async.py | 57 +- .../azure-ai-textanalytics/setup.py | 2 +- .../azure-ai-textanalytics/swagger/README.md | 2 +- ...est_analyze.test_custom_partial_error.yaml | 95 + ...est_analyze.test_disable_service_logs.yaml | 164 +- ..._analyze.test_multi_category_classify.yaml | 88 + ...nalyze.test_recognize_custom_entities.yaml | 93 + ...analyze.test_single_category_classify.yaml | 88 + ...alyze_async.test_custom_partial_error.yaml | 73 + ...alyze_async.test_disable_service_logs.yaml | 153 +- ...ze_async.test_multi_category_classify.yaml | 66 + ..._async.test_recognize_custom_entities.yaml | 71 + ...e_async.test_single_category_classify.yaml | 66 + .../tests/test_analyze.py | 201 +- .../tests/test_analyze_async.py | 215 +- .../azure-ai-textanalytics/tests/testcase.py | 8 + sdk/textanalytics/tests.yml | 8 + shared_requirements.txt | 2 +- 57 files changed, 11963 insertions(+), 4982 deletions(-) create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_vendor.py create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_vendor.py create mode 100644 sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_vendor.py create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_custom_partial_error.yaml create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_multi_category_classify.yaml create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_recognize_custom_entities.yaml create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_single_category_classify.yaml create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_custom_partial_error.yaml create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_multi_category_classify.yaml create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_recognize_custom_entities.yaml create mode 100644 sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_single_category_classify.yaml diff --git a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md index c98fd49194cb..a2e9e5345fde 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md +++ b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md @@ -5,12 +5,16 @@ This version of the SDK defaults to the latest supported API version, which currently is `v3.2-preview.2`. ### Features Added +- Added support for Custom Entities Recognition through the `begin_analyze_actions` API with the `RecognizeCustomEntitiesAction` and `RecognizeCustomEntitiesResult` types. +- Added support for Custom Single Classification through the `begin_analyze_actions` API with the `SingleCategoryClassifyAction` and `SingleCategoryClassifyActionResult` types. +- Added support for Custom Multi Classification through the `begin_analyze_actions` API with the `MultiCategoryClassifyAction` and `MultiCategoryClassifyActionResult` types. ### Breaking Changes ### Bugs Fixed ### Other Changes +- Package requires [azure-core](https://pypi.org/project/azure-core/) version 1.16.0 or greater ## 5.2.0b1 (2021-08-09) 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 d78a7244020b..c9812c7241cd 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py @@ -53,6 +53,13 @@ ExtractSummaryAction, ExtractSummaryResult, SummarySentence, + RecognizeCustomEntitiesAction, + RecognizeCustomEntitiesResult, + SingleCategoryClassifyAction, + SingleCategoryClassifyResult, + MultiCategoryClassifyAction, + MultiCategoryClassifyResult, + ClassificationCategory, ) from ._lro import AnalyzeHealthcareEntitiesLROPoller, AnalyzeActionsLROPoller @@ -107,6 +114,13 @@ "ExtractSummaryAction", "ExtractSummaryResult", "SummarySentence", + "RecognizeCustomEntitiesAction", + "RecognizeCustomEntitiesResult", + "SingleCategoryClassifyAction", + "SingleCategoryClassifyResult", + "MultiCategoryClassifyAction", + "MultiCategoryClassifyResult", + "ClassificationCategory", ] __version__ = VERSION 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 7dbb24aefddd..9e2e10b79ad8 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 @@ -44,8 +44,8 @@ def __init__(self, endpoint, credential, **kwargs): credential=credential, api_version=kwargs.pop("api_version", DEFAULT_API_VERSION), sdk_moniker=USER_AGENT, - authentication_policy=_authentication_policy(credential), - custom_hook_policy=TextAnalyticsResponseHookPolicy(**kwargs), + authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential)), + custom_hook_policy=kwargs.pop("custom_hook_policy", TextAnalyticsResponseHookPolicy(**kwargs)), **kwargs ) 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 3946776732c3..bc3cc2f45004 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 @@ -10,19 +10,14 @@ # -------------------------------------------------------------------------- from msrest import Serializer, Deserializer from typing import TYPE_CHECKING -import warnings - -# FIXME: have to manually reconfigure import path for multiapi operation mixin -from .._lro import AnalyzeActionsLROPoller, AnalyzeActionsLROPollingMethod, 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + from typing import Any, List, Optional, Union + + # FIXME: have to manually reconfigure import path for multiapi operation mixin + from .._lro import AnalyzeActionsLROPoller, AnalyzeHealthcareEntitiesLROPoller + from azure.core.polling import LROPoller class TextAnalyticsClientOperationsMixin(object): @@ -35,6 +30,7 @@ def analyze_status( 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 @@ -77,6 +73,7 @@ def begin_analyze( body=None, # type: Optional["_models.AnalyzeBatchInput"] **kwargs # type: Any ): + # type: (...) -> AnalyzeActionsLROPoller["_models.AnalyzeJobState"] """Submit analysis job. Submit a collection of text documents for analysis. Specify one or more unique tasks to be @@ -86,13 +83,17 @@ def begin_analyze( :type body: ~azure.ai.textanalytics.v3_2_preview_2.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: By default, your polling method will be AnalyzeActionsLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AnalyzeActionsLROPollingMethod. Pass + in False for this operation to not poll, or pass in 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 AnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response) - :rtype: ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.AnalyzeJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AnalyzeActionsLROPoller that returns either AnalyzeJobState or the + result of cls(response) + :rtype: + ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.AnalyzeJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('begin_analyze') if api_version == 'v3.1': @@ -114,6 +115,7 @@ def begin_cancel_health_job( job_id, # type: str **kwargs # type: Any ): + # type: (...) -> LROPoller[None] """Cancel healthcare prediction job. Cancel healthcare prediction job. @@ -122,13 +124,15 @@ def begin_cancel_health_job( :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: By default, your polling method will be LROBasePolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in 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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('begin_cancel_health_job') if api_version == 'v3.1': @@ -153,6 +157,7 @@ def begin_health( logging_opt_out=None, # type: Optional[bool] **kwargs # type: Any ): + # type: (...) -> AnalyzeHealthcareEntitiesLROPoller["_models.HealthcareJobState"] """Submit healthcare analysis job. Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions, @@ -177,13 +182,17 @@ def begin_health( :type logging_opt_out: bool :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: By default, your polling method will be AnalyzeHealthcareEntitiesLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be + AnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll, or + pass in 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_2_preview_2.models.HealthcareJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :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_2_preview_2.models.HealthcareJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('begin_health') if api_version == 'v3.1': @@ -209,6 +218,7 @@ def entities_linking( string_index_type=None, # 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 @@ -270,6 +280,7 @@ def entities_recognition_general( string_index_type=None, # 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 @@ -334,6 +345,7 @@ def entities_recognition_pii( pii_categories=None, # type: Optional[List[Union[str, "_models.PiiCategory"]]] **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 @@ -395,6 +407,7 @@ def health_status( 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. @@ -438,6 +451,7 @@ def key_phrases( logging_opt_out=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:` "_models.LanguageResult" """Detect Language. The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 @@ -553,6 +568,7 @@ def sentiment( string_index_type=None, # 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 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 7cba63c4359c..a797041e8e45 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,7 +24,6 @@ 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): 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 b4bb93f4c6cf..d2621eaa925a 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 @@ -9,16 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- from msrest import Serializer, Deserializer -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings +from typing import Any, List, Optional, Union # FIXME: have to manually reconfigure import path for multiapi operation mixin from ...aio._lro_async import AsyncAnalyzeHealthcareEntitiesLROPoller, AsyncAnalyzeHealthcareEntitiesLROPollingMethod, AsyncAnalyzeActionsLROPoller, AsyncAnalyzeActionsLROPollingMethod -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 azure.core.polling import AsyncLROPoller class TextAnalyticsClientOperationsMixin(object): @@ -83,12 +78,16 @@ async def begin_analyze( :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: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + Pass in False for this operation to not poll, or pass in 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 AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response) - :rtype: ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.AnalyzeJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the + result of cls(response) + :rtype: + ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.AnalyzeJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('begin_analyze') if api_version == 'v3.1': @@ -118,13 +117,15 @@ async def begin_cancel_health_job( :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: By default, your polling method will be AsyncLROBasePolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in 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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('begin_cancel_health_job') if api_version == 'v3.1': @@ -173,13 +174,17 @@ async def begin_health( :type logging_opt_out: bool :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: By default, your polling method will be AsyncAnalyzeHealthcareEntitiesLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be + AsyncAnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll, + or pass in 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 AsyncAnalyzeHealthcareEntitiesLROPoller that returns either HealthcareJobState or the result of cls(response) - :rtype: ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncAnalyzeHealthcareEntitiesLROPoller that returns either + HealthcareJobState or the result of cls(response) + :rtype: + ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('begin_health') if api_version == 'v3.1': 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 70a99709c5f6..aeebabb40c25 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,7 +12,6 @@ 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 @@ -22,6 +21,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential from azure.core.credentials_async import AsyncTokenCredential class _SDKClient(object): 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 76307d2f859c..2c7bf3972632 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 @@ -5,13 +5,13 @@ "name": "TextAnalyticsClient", "filename": "_text_analytics_client", "description": "The Text Analytics API is a suite of text analytics web 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. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview.", - "base_url": null, - "custom_base_url": "\u0027{Endpoint}/text/analytics/v3.0\u0027", + "host_value": null, + "parameterized_host_template": "\u0027{Endpoint}/text/analytics/v3.0\u0027", "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\"]}, \"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\"]}}}" + "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\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"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": { @@ -79,21 +79,20 @@ "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, + "credential_call_sync": "policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)", "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\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"List\", \"Optional\", \"TypeVar\"]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"List\", \"Optional\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"List\", \"Optional\"]}}}", "operations": { "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 **kwargs # type: Any\n):\n", + "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 **kwargs # type: Any\n):\n # type: (...) -\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_0.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 input 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: EntitiesResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -105,7 +104,7 @@ }, "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 **kwargs # type: Any\n):\n", + "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 **kwargs # type: Any\n):\n # type: (...) -\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_0.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 input 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: EntityLinkingResult, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.EntityLinkingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -117,7 +116,7 @@ }, "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", + "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 # type: (...) -\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_0.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 input 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_0.models.KeyPhraseResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -129,7 +128,7 @@ }, "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", + "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 # type: (...) -\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_0.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 input 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_0.models.LanguageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -141,7 +140,7 @@ }, "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 **kwargs # type: Any\n):\n", + "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 **kwargs # type: Any\n):\n # type: (...) -\u003e \"_models.SentimentResponse\"\n", "doc": "\"\"\"Sentiment.\n\nThe API returns a sentiment prediction, as well as sentiment scores for each sentiment class\n(Positive, Negative, and Neutral) for the document and each sentence within it. 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_0.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 input 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: SentimentResponse, or the result of cls(response)\n:rtype: ~azure.ai.textanalytics.v3_0.models.SentimentResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { 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 1549d8848edb..27af5789fda3 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 @@ -6,29 +6,30 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from copy import deepcopy from typing import TYPE_CHECKING from azure.core import PipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import TextAnalyticsClientConfiguration +from .operations import TextAnalyticsClientOperationsMixin + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports 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 -from . import models - + from azure.core.rest import HttpRequest, HttpResponse class TextAnalyticsClient(TextAnalyticsClientOperationsMixin): """The Text Analytics API is a suite of text analytics web 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. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in 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). + :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: + https://westus.api.cognitive.microsoft.com). :type endpoint: str """ @@ -39,33 +40,46 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - base_url = '{Endpoint}/text/analytics/v3.0' + _base_url = '{Endpoint}/text/analytics/v3.0' self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs) - self._client = PipelineClient(base_url=base_url, config=self._config, **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) + self._serialize.client_side_validation = False - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs # type: Any + ): + # type: (...) -> 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ + + request_copy = deepcopy(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_vendor.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_vendor.py new file mode 100644 index 000000000000..9a223d15524c --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/_vendor.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------- +# 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.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request 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 2453bcc1b7cf..8b931109b766 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 @@ -6,27 +6,28 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING from azure.core import AsyncPipelineClient -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from msrest import Deserializer, Serializer -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - +from .. import models from ._configuration import TextAnalyticsClientConfiguration from .operations import TextAnalyticsClientOperationsMixin -from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential class TextAnalyticsClient(TextAnalyticsClientOperationsMixin): """The Text Analytics API is a suite of text analytics web 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. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in 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). + :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: + https://westus.api.cognitive.microsoft.com). :type endpoint: str """ @@ -36,32 +37,45 @@ def __init__( endpoint: str, **kwargs: Any ) -> None: - base_url = '{Endpoint}/text/analytics/v3.0' + _base_url = '{Endpoint}/text/analytics/v3.0' self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs) - self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **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) + self._serialize.client_side_validation = False - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ + + request_copy = deepcopy(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/aio/operations/_text_analytics_client_operations.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/aio/operations/_text_analytics_client_operations.py index 34b14601e9af..358d23615dee 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/aio/operations/_text_analytics_client_operations.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/aio/operations/_text_analytics_client_operations.py @@ -5,20 +5,26 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings 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.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from ... import models as _models +from ..._vendor import _convert_request +from ...operations._text_analytics_client_operations import build_entities_linking_request, build_entities_recognition_general_request, build_key_phrases_request, build_languages_request, build_sentiment_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class TextAnalyticsClientOperationsMixin: + @distributed_trace_async async def entities_recognition_general( self, documents: List["_models.MultiLanguageInput"], @@ -52,39 +58,30 @@ async def entities_recognition_general( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_recognition_general.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_recognition_general_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + json=json, + template_url=self.entities_recognition_general.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntitiesResult', pipeline_response) @@ -93,8 +90,11 @@ async def entities_recognition_general( return cls(pipeline_response, deserialized, {}) return deserialized + entities_recognition_general.metadata = {'url': '/entities/recognition/general'} # type: ignore + + @distributed_trace_async async def entities_linking( self, documents: List["_models.MultiLanguageInput"], @@ -127,39 +127,30 @@ async def entities_linking( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_linking.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_linking_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + json=json, + template_url=self.entities_linking.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntityLinkingResult', pipeline_response) @@ -168,8 +159,11 @@ async def entities_linking( return cls(pipeline_response, deserialized, {}) return deserialized + entities_linking.metadata = {'url': '/entities/linking'} # type: ignore + + @distributed_trace_async async def key_phrases( self, documents: List["_models.MultiLanguageInput"], @@ -202,39 +196,30 @@ async def key_phrases( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.key_phrases.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_key_phrases_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + json=json, + template_url=self.key_phrases.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('KeyPhraseResult', pipeline_response) @@ -243,8 +228,11 @@ async def key_phrases( return cls(pipeline_response, deserialized, {}) return deserialized + key_phrases.metadata = {'url': '/keyPhrases'} # type: ignore + + @distributed_trace_async async def languages( self, documents: List["_models.LanguageInput"], @@ -278,39 +266,30 @@ async def languages( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.languages.metadata['url'] # type: ignore + _input = _models.LanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'LanguageBatchInput') + + request = build_languages_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + json=json, + template_url=self.languages.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('LanguageResult', pipeline_response) @@ -319,8 +298,11 @@ async def languages( return cls(pipeline_response, deserialized, {}) return deserialized + languages.metadata = {'url': '/languages'} # type: ignore + + @distributed_trace_async async def sentiment( self, documents: List["_models.MultiLanguageInput"], @@ -354,39 +336,30 @@ async def sentiment( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.sentiment.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_sentiment_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + json=json, + template_url=self.sentiment.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SentimentResponse', pipeline_response) @@ -395,4 +368,6 @@ async def sentiment( 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_0/models/_models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models.py index 9a13949fe30d..b47d3f0319b6 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models.py @@ -15,14 +15,14 @@ class DetectedLanguage(msrest.serialization.Model): 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 + :ivar name: Required. Long name of a detected language (e.g. English, French). + :vartype name: str + :ivar iso6391_name: Required. A two letter representation of the detected language according to + the ISO 639-1 standard (e.g. en, fr). + :vartype iso6391_name: str + :ivar 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 + :vartype confidence_score: float """ _validation = { @@ -41,6 +41,16 @@ def __init__( self, **kwargs ): + """ + :keyword name: Required. Long name of a detected language (e.g. English, French). + :paramtype name: str + :keyword iso6391_name: Required. A two letter representation of the detected language according + to the ISO 639-1 standard (e.g. en, fr). + :paramtype iso6391_name: str + :keyword confidence_score: Required. A confidence score between 0 and 1. Scores close to 1 + indicate 100% certainty that the identified language is true. + :paramtype confidence_score: float + """ super(DetectedLanguage, self).__init__(**kwargs) self.name = kwargs['name'] self.iso6391_name = kwargs['iso6391_name'] @@ -52,15 +62,15 @@ class DocumentEntities(msrest.serialization.Model): 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_0.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_0.models.Entity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics """ _validation = { @@ -80,6 +90,17 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_0.models.Entity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + """ super(DocumentEntities, self).__init__(**kwargs) self.id = kwargs['id'] self.entities = kwargs['entities'] @@ -92,10 +113,10 @@ class DocumentError(msrest.serialization.Model): 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_0.models.TextAnalyticsError + :ivar id: Required. Document Id. + :vartype id: str + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_0.models.TextAnalyticsError """ _validation = { @@ -112,6 +133,12 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Document Id. + :paramtype id: str + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_0.models.TextAnalyticsError + """ super(DocumentError, self).__init__(**kwargs) self.id = kwargs['id'] self.error = kwargs['error'] @@ -122,16 +149,16 @@ class DocumentKeyPhrases(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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_0.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :vartype key_phrases: list[str] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics """ _validation = { @@ -151,6 +178,18 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword 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. + :paramtype key_phrases: list[str] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + """ super(DocumentKeyPhrases, self).__init__(**kwargs) self.id = kwargs['id'] self.key_phrases = kwargs['key_phrases'] @@ -163,15 +202,15 @@ class DocumentLanguage(msrest.serialization.Model): 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_0.models.DetectedLanguage - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar detected_language: Required. Detected Language. + :vartype detected_language: ~azure.ai.textanalytics.v3_0.models.DetectedLanguage + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics """ _validation = { @@ -191,6 +230,17 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword detected_language: Required. Detected Language. + :paramtype detected_language: ~azure.ai.textanalytics.v3_0.models.DetectedLanguage + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + """ super(DocumentLanguage, self).__init__(**kwargs) self.id = kwargs['id'] self.detected_language = kwargs['detected_language'] @@ -203,15 +253,15 @@ class DocumentLinkedEntities(msrest.serialization.Model): 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_0.models.LinkedEntity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized well-known entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_0.models.LinkedEntity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics """ _validation = { @@ -231,6 +281,17 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized well-known entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_0.models.LinkedEntity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + """ super(DocumentLinkedEntities, self).__init__(**kwargs) self.id = kwargs['id'] self.entities = kwargs['entities'] @@ -243,21 +304,22 @@ class DocumentSentiment(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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_0.models.DocumentSentimentValue - :param statistics: if showStats=true was specified in the request this field will contain + :vartype sentiment: str or ~azure.ai.textanalytics.v3_0.models.DocumentSentimentValue + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics - :param confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :ivar confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 for each sentiment class. - :type confidence_scores: ~azure.ai.textanalytics.v3_0.models.SentimentConfidenceScorePerLabel - :param sentences: Required. Sentence level sentiment analysis. - :type sentences: list[~azure.ai.textanalytics.v3_0.models.SentenceSentiment] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :vartype confidence_scores: + ~azure.ai.textanalytics.v3_0.models.SentimentConfidenceScorePerLabel + :ivar sentences: Required. Sentence level sentiment analysis. + :vartype sentences: list[~azure.ai.textanalytics.v3_0.models.SentenceSentiment] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] """ _validation = { @@ -281,6 +343,24 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword sentiment: Required. Predicted sentiment for document (Negative, Neutral, Positive, or + Mixed). Possible values include: "positive", "neutral", "negative", "mixed". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_0.models.DocumentSentimentValue + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :keyword confidence_scores: Required. Document level sentiment confidence scores between 0 and + 1 for each sentiment class. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_0.models.SentimentConfidenceScorePerLabel + :keyword sentences: Required. Sentence level sentiment analysis. + :paramtype sentences: list[~azure.ai.textanalytics.v3_0.models.SentenceSentiment] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + """ super(DocumentSentiment, self).__init__(**kwargs) self.id = kwargs['id'] self.sentiment = kwargs['sentiment'] @@ -295,10 +375,10 @@ class DocumentStatistics(msrest.serialization.Model): 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 + :ivar characters_count: Required. Number of text elements recognized in the document. + :vartype characters_count: int + :ivar transactions_count: Required. Number of transactions for the document. + :vartype transactions_count: int """ _validation = { @@ -315,6 +395,12 @@ def __init__( self, **kwargs ): + """ + :keyword characters_count: Required. Number of text elements recognized in the document. + :paramtype characters_count: int + :keyword transactions_count: Required. Number of transactions for the document. + :paramtype transactions_count: int + """ super(DocumentStatistics, self).__init__(**kwargs) self.characters_count = kwargs['characters_count'] self.transactions_count = kwargs['transactions_count'] @@ -325,15 +411,15 @@ class EntitiesResult(msrest.serialization.Model): 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_0.models.DocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -353,6 +439,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntitiesResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -365,18 +462,18 @@ class Entity(msrest.serialization.Model): 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, such as Person/Location/Org/SSN etc. - :type category: str - :param subcategory: Entity sub type, such as Age/Year/TimeRange etc. - :type subcategory: str - :param offset: Required. Start position (in Unicode characters) for the entity text. - :type offset: int - :param length: Required. Length (in Unicode characters) for the entity text. - :type length: int - :param confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. - :type confidence_score: float + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Entity type, such as Person/Location/Org/SSN etc. + :vartype category: str + :ivar subcategory: Entity sub type, such as Age/Year/TimeRange etc. + :vartype subcategory: str + :ivar offset: Required. Start position (in Unicode characters) for the entity text. + :vartype offset: int + :ivar length: Required. Length (in Unicode characters) for the entity text. + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -400,6 +497,20 @@ def __init__( self, **kwargs ): + """ + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Entity type, such as Person/Location/Org/SSN etc. + :paramtype category: str + :keyword subcategory: Entity sub type, such as Age/Year/TimeRange etc. + :paramtype subcategory: str + :keyword offset: Required. Start position (in Unicode characters) for the entity text. + :paramtype offset: int + :keyword length: Required. Length (in Unicode characters) for the entity text. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(Entity, self).__init__(**kwargs) self.text = kwargs['text'] self.category = kwargs['category'] @@ -414,15 +525,15 @@ class EntityLinkingResult(msrest.serialization.Model): 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_0.models.DocumentLinkedEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentLinkedEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -442,6 +553,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentLinkedEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntityLinkingResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -454,8 +576,8 @@ class ErrorResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param error: Required. Document Error. - :type error: ~azure.ai.textanalytics.v3_0.models.TextAnalyticsError + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_0.models.TextAnalyticsError """ _validation = { @@ -470,6 +592,10 @@ def __init__( self, **kwargs ): + """ + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_0.models.TextAnalyticsError + """ super(ErrorResponse, self).__init__(**kwargs) self.error = kwargs['error'] @@ -479,19 +605,19 @@ class InnerError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "invalidParameterValue", + :ivar code: Required. Error code. Possible values include: "invalidParameterValue", "invalidRequestBodyFormat", "emptyRequest", "missingInputRecords", "invalidDocument", "modelVersionIncorrect", "invalidDocumentBatch", "unsupportedLanguageCode", "invalidCountryHint". - :type code: str or ~azure.ai.textanalytics.v3_0.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_0.models.InnerError + :vartype code: str or ~azure.ai.textanalytics.v3_0.models.InnerErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar details: Error details. + :vartype details: dict[str, str] + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_0.models.InnerError """ _validation = { @@ -511,6 +637,21 @@ def __init__( self, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "invalidParameterValue", + "invalidRequestBodyFormat", "emptyRequest", "missingInputRecords", "invalidDocument", + "modelVersionIncorrect", "invalidDocumentBatch", "unsupportedLanguageCode", + "invalidCountryHint". + :paramtype code: str or ~azure.ai.textanalytics.v3_0.models.InnerErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword details: Error details. + :paramtype details: dict[str, str] + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_0.models.InnerError + """ super(InnerError, self).__init__(**kwargs) self.code = kwargs['code'] self.message = kwargs['message'] @@ -524,15 +665,15 @@ class KeyPhraseResult(msrest.serialization.Model): 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_0.models.DocumentKeyPhrases] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentKeyPhrases] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -552,6 +693,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentKeyPhrases] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(KeyPhraseResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -564,8 +716,8 @@ class LanguageBatchInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param documents: Required. - :type documents: list[~azure.ai.textanalytics.v3_0.models.LanguageInput] + :ivar documents: Required. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.LanguageInput] """ _validation = { @@ -580,6 +732,10 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.LanguageInput] + """ super(LanguageBatchInput, self).__init__(**kwargs) self.documents = kwargs['documents'] @@ -589,12 +745,12 @@ class LanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. + :vartype text: str + :ivar country_hint: + :vartype country_hint: str """ _validation = { @@ -612,6 +768,14 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. + :paramtype text: str + :keyword country_hint: + :paramtype country_hint: str + """ super(LanguageInput, self).__init__(**kwargs) self.id = kwargs['id'] self.text = kwargs['text'] @@ -623,15 +787,15 @@ class LanguageResult(msrest.serialization.Model): 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_0.models.DocumentLanguage] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentLanguage] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -651,6 +815,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentLanguage] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(LanguageResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -663,19 +838,18 @@ class LinkedEntity(msrest.serialization.Model): 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_0.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 + :ivar name: Required. Entity Linking formal name. + :vartype name: str + :ivar matches: Required. List of instances this entity appears in the text. + :vartype matches: list[~azure.ai.textanalytics.v3_0.models.Match] + :ivar language: Required. Language used in the data source. + :vartype language: str + :ivar id: Unique identifier of the recognized entity from the data source. + :vartype id: str + :ivar url: Required. URL for the entity's page from the data source. + :vartype url: str + :ivar data_source: Required. Data source used to extract entity linking, such as Wiki/Bing etc. + :vartype data_source: str """ _validation = { @@ -699,6 +873,21 @@ def __init__( self, **kwargs ): + """ + :keyword name: Required. Entity Linking formal name. + :paramtype name: str + :keyword matches: Required. List of instances this entity appears in the text. + :paramtype matches: list[~azure.ai.textanalytics.v3_0.models.Match] + :keyword language: Required. Language used in the data source. + :paramtype language: str + :keyword id: Unique identifier of the recognized entity from the data source. + :paramtype id: str + :keyword url: Required. URL for the entity's page from the data source. + :paramtype url: str + :keyword data_source: Required. Data source used to extract entity linking, such as Wiki/Bing + etc. + :paramtype data_source: str + """ super(LinkedEntity, self).__init__(**kwargs) self.name = kwargs['name'] self.matches = kwargs['matches'] @@ -713,15 +902,15 @@ class Match(msrest.serialization.Model): 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 (in Unicode characters) for the entity match text. - :type offset: int - :param length: Required. Length (in Unicode characters) for the entity match text. - :type length: int + :ivar confidence_score: Required. If a well-known item is recognized, a decimal number denoting + the confidence level between 0 and 1 will be returned. + :vartype confidence_score: float + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar offset: Required. Start position (in Unicode characters) for the entity match text. + :vartype offset: int + :ivar length: Required. Length (in Unicode characters) for the entity match text. + :vartype length: int """ _validation = { @@ -742,6 +931,17 @@ def __init__( self, **kwargs ): + """ + :keyword confidence_score: Required. If a well-known item is recognized, a decimal number + denoting the confidence level between 0 and 1 will be returned. + :paramtype confidence_score: float + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword offset: Required. Start position (in Unicode characters) for the entity match text. + :paramtype offset: int + :keyword length: Required. Length (in Unicode characters) for the entity match text. + :paramtype length: int + """ super(Match, self).__init__(**kwargs) self.confidence_score = kwargs['confidence_score'] self.text = kwargs['text'] @@ -754,8 +954,8 @@ class MultiLanguageBatchInput(msrest.serialization.Model): 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_0.models.MultiLanguageInput] + :ivar documents: Required. The set of documents to process as part of this batch. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput] """ _validation = { @@ -770,6 +970,10 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. The set of documents to process as part of this batch. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput] + """ super(MultiLanguageBatchInput, self).__init__(**kwargs) self.documents = kwargs['documents'] @@ -779,14 +983,14 @@ class MultiLanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. A unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. The input text to process. + :vartype text: str + :ivar 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 + :vartype language: str """ _validation = { @@ -804,6 +1008,16 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. A unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. The input text to process. + :paramtype text: str + :keyword 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. + :paramtype language: str + """ super(MultiLanguageInput, self).__init__(**kwargs) self.id = kwargs['id'] self.text = kwargs['text'] @@ -815,16 +1029,16 @@ class RequestStatistics(msrest.serialization.Model): 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, + :ivar documents_count: Required. Number of documents submitted in the request. + :vartype documents_count: int + :ivar 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, + :vartype valid_documents_count: int + :ivar 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 + :vartype erroneous_documents_count: int + :ivar transactions_count: Required. Number of transactions for the request. + :vartype transactions_count: long """ _validation = { @@ -845,6 +1059,18 @@ def __init__( self, **kwargs ): + """ + :keyword documents_count: Required. Number of documents submitted in the request. + :paramtype documents_count: int + :keyword valid_documents_count: Required. Number of valid documents. This excludes empty, + over-size limit or non-supported languages documents. + :paramtype valid_documents_count: int + :keyword erroneous_documents_count: Required. Number of invalid documents. This includes empty, + over-size limit or non-supported languages documents. + :paramtype erroneous_documents_count: int + :keyword transactions_count: Required. Number of transactions for the request. + :paramtype transactions_count: long + """ super(RequestStatistics, self).__init__(**kwargs) self.documents_count = kwargs['documents_count'] self.valid_documents_count = kwargs['valid_documents_count'] @@ -857,18 +1083,19 @@ class SentenceSentiment(msrest.serialization.Model): 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: + :ivar text: Required. The sentence text. + :vartype text: str + :ivar sentiment: Required. The predicted Sentiment for the sentence. Possible values include: "positive", "neutral", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_0.models.SentenceSentimentValue - :param confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + :vartype sentiment: str or ~azure.ai.textanalytics.v3_0.models.SentenceSentimentValue + :ivar confidence_scores: Required. The sentiment confidence score between 0 and 1 for the sentence for all classes. - :type confidence_scores: ~azure.ai.textanalytics.v3_0.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 by Unicode standard. - :type length: int + :vartype confidence_scores: + ~azure.ai.textanalytics.v3_0.models.SentimentConfidenceScorePerLabel + :ivar offset: Required. The sentence offset from the start of the document. + :vartype offset: int + :ivar length: Required. The length of the sentence by Unicode standard. + :vartype length: int """ _validation = { @@ -891,6 +1118,21 @@ def __init__( self, **kwargs ): + """ + :keyword text: Required. The sentence text. + :paramtype text: str + :keyword sentiment: Required. The predicted Sentiment for the sentence. Possible values + include: "positive", "neutral", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_0.models.SentenceSentimentValue + :keyword confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + sentence for all classes. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_0.models.SentimentConfidenceScorePerLabel + :keyword offset: Required. The sentence offset from the start of the document. + :paramtype offset: int + :keyword length: Required. The length of the sentence by Unicode standard. + :paramtype length: int + """ super(SentenceSentiment, self).__init__(**kwargs) self.text = kwargs['text'] self.sentiment = kwargs['sentiment'] @@ -904,12 +1146,12 @@ class SentimentConfidenceScorePerLabel(msrest.serialization.Model): 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 + :ivar positive: Required. + :vartype positive: float + :ivar neutral: Required. + :vartype neutral: float + :ivar negative: Required. + :vartype negative: float """ _validation = { @@ -928,6 +1170,14 @@ def __init__( self, **kwargs ): + """ + :keyword positive: Required. + :paramtype positive: float + :keyword neutral: Required. + :paramtype neutral: float + :keyword negative: Required. + :paramtype negative: float + """ super(SentimentConfidenceScorePerLabel, self).__init__(**kwargs) self.positive = kwargs['positive'] self.neutral = kwargs['neutral'] @@ -939,15 +1189,15 @@ class SentimentResponse(msrest.serialization.Model): 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_0.models.DocumentSentiment] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Sentiment analysis per document. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentSentiment] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -967,6 +1217,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Sentiment analysis per document. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentSentiment] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(SentimentResponse, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -979,17 +1240,17 @@ class TextAnalyticsError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "invalidRequest", - "invalidArgument", "internalServerError", "serviceUnavailable". - :type code: str or ~azure.ai.textanalytics.v3_0.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_0.models.InnerError - :param details: Details about specific errors that led to this reported error. - :type details: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsError] + :ivar code: Required. Error code. Possible values include: "invalidRequest", "invalidArgument", + "internalServerError", "serviceUnavailable". + :vartype code: str or ~azure.ai.textanalytics.v3_0.models.ErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_0.models.InnerError + :ivar details: Details about specific errors that led to this reported error. + :vartype details: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsError] """ _validation = { @@ -1009,6 +1270,19 @@ def __init__( self, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "invalidRequest", + "invalidArgument", "internalServerError", "serviceUnavailable". + :paramtype code: str or ~azure.ai.textanalytics.v3_0.models.ErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_0.models.InnerError + :keyword details: Details about specific errors that led to this reported error. + :paramtype details: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsError] + """ super(TextAnalyticsError, self).__init__(**kwargs) self.code = kwargs['code'] self.message = kwargs['message'] @@ -1022,13 +1296,13 @@ class TextAnalyticsWarning(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "LongWordsInDocument", + :ivar code: Required. Error code. Possible values include: "LongWordsInDocument", "DocumentTruncated". - :type code: str or ~azure.ai.textanalytics.v3_0.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 + :vartype code: str or ~azure.ai.textanalytics.v3_0.models.WarningCodeValue + :ivar message: Required. Warning message. + :vartype message: str + :ivar target_ref: A JSON pointer reference indicating the target object. + :vartype target_ref: str """ _validation = { @@ -1046,6 +1320,15 @@ def __init__( self, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "LongWordsInDocument", + "DocumentTruncated". + :paramtype code: str or ~azure.ai.textanalytics.v3_0.models.WarningCodeValue + :keyword message: Required. Warning message. + :paramtype message: str + :keyword target_ref: A JSON pointer reference indicating the target object. + :paramtype target_ref: str + """ super(TextAnalyticsWarning, self).__init__(**kwargs) self.code = kwargs['code'] self.message = kwargs['message'] diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py index 56f6eaa51439..356e2c20b49e 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py @@ -19,14 +19,14 @@ class DetectedLanguage(msrest.serialization.Model): 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 + :ivar name: Required. Long name of a detected language (e.g. English, French). + :vartype name: str + :ivar iso6391_name: Required. A two letter representation of the detected language according to + the ISO 639-1 standard (e.g. en, fr). + :vartype iso6391_name: str + :ivar 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 + :vartype confidence_score: float """ _validation = { @@ -49,6 +49,16 @@ def __init__( confidence_score: float, **kwargs ): + """ + :keyword name: Required. Long name of a detected language (e.g. English, French). + :paramtype name: str + :keyword iso6391_name: Required. A two letter representation of the detected language according + to the ISO 639-1 standard (e.g. en, fr). + :paramtype iso6391_name: str + :keyword confidence_score: Required. A confidence score between 0 and 1. Scores close to 1 + indicate 100% certainty that the identified language is true. + :paramtype confidence_score: float + """ super(DetectedLanguage, self).__init__(**kwargs) self.name = name self.iso6391_name = iso6391_name @@ -60,15 +70,15 @@ class DocumentEntities(msrest.serialization.Model): 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_0.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_0.models.Entity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics """ _validation = { @@ -93,6 +103,17 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_0.models.Entity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + """ super(DocumentEntities, self).__init__(**kwargs) self.id = id self.entities = entities @@ -105,10 +126,10 @@ class DocumentError(msrest.serialization.Model): 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_0.models.TextAnalyticsError + :ivar id: Required. Document Id. + :vartype id: str + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_0.models.TextAnalyticsError """ _validation = { @@ -128,6 +149,12 @@ def __init__( error: "TextAnalyticsError", **kwargs ): + """ + :keyword id: Required. Document Id. + :paramtype id: str + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_0.models.TextAnalyticsError + """ super(DocumentError, self).__init__(**kwargs) self.id = id self.error = error @@ -138,16 +165,16 @@ class DocumentKeyPhrases(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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_0.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :vartype key_phrases: list[str] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics """ _validation = { @@ -172,6 +199,18 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword 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. + :paramtype key_phrases: list[str] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + """ super(DocumentKeyPhrases, self).__init__(**kwargs) self.id = id self.key_phrases = key_phrases @@ -184,15 +223,15 @@ class DocumentLanguage(msrest.serialization.Model): 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_0.models.DetectedLanguage - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar detected_language: Required. Detected Language. + :vartype detected_language: ~azure.ai.textanalytics.v3_0.models.DetectedLanguage + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics """ _validation = { @@ -217,6 +256,17 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword detected_language: Required. Detected Language. + :paramtype detected_language: ~azure.ai.textanalytics.v3_0.models.DetectedLanguage + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + """ super(DocumentLanguage, self).__init__(**kwargs) self.id = id self.detected_language = detected_language @@ -229,15 +279,15 @@ class DocumentLinkedEntities(msrest.serialization.Model): 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_0.models.LinkedEntity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized well-known entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_0.models.LinkedEntity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics """ _validation = { @@ -262,6 +312,17 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized well-known entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_0.models.LinkedEntity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + """ super(DocumentLinkedEntities, self).__init__(**kwargs) self.id = id self.entities = entities @@ -274,21 +335,22 @@ class DocumentSentiment(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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_0.models.DocumentSentimentValue - :param statistics: if showStats=true was specified in the request this field will contain + :vartype sentiment: str or ~azure.ai.textanalytics.v3_0.models.DocumentSentimentValue + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics - :param confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :ivar confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 for each sentiment class. - :type confidence_scores: ~azure.ai.textanalytics.v3_0.models.SentimentConfidenceScorePerLabel - :param sentences: Required. Sentence level sentiment analysis. - :type sentences: list[~azure.ai.textanalytics.v3_0.models.SentenceSentiment] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + :vartype confidence_scores: + ~azure.ai.textanalytics.v3_0.models.SentimentConfidenceScorePerLabel + :ivar sentences: Required. Sentence level sentiment analysis. + :vartype sentences: list[~azure.ai.textanalytics.v3_0.models.SentenceSentiment] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] """ _validation = { @@ -319,6 +381,24 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword sentiment: Required. Predicted sentiment for document (Negative, Neutral, Positive, or + Mixed). Possible values include: "positive", "neutral", "negative", "mixed". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_0.models.DocumentSentimentValue + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.DocumentStatistics + :keyword confidence_scores: Required. Document level sentiment confidence scores between 0 and + 1 for each sentiment class. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_0.models.SentimentConfidenceScorePerLabel + :keyword sentences: Required. Sentence level sentiment analysis. + :paramtype sentences: list[~azure.ai.textanalytics.v3_0.models.SentenceSentiment] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsWarning] + """ super(DocumentSentiment, self).__init__(**kwargs) self.id = id self.sentiment = sentiment @@ -333,10 +413,10 @@ class DocumentStatistics(msrest.serialization.Model): 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 + :ivar characters_count: Required. Number of text elements recognized in the document. + :vartype characters_count: int + :ivar transactions_count: Required. Number of transactions for the document. + :vartype transactions_count: int """ _validation = { @@ -356,6 +436,12 @@ def __init__( transactions_count: int, **kwargs ): + """ + :keyword characters_count: Required. Number of text elements recognized in the document. + :paramtype characters_count: int + :keyword transactions_count: Required. Number of transactions for the document. + :paramtype transactions_count: int + """ super(DocumentStatistics, self).__init__(**kwargs) self.characters_count = characters_count self.transactions_count = transactions_count @@ -366,15 +452,15 @@ class EntitiesResult(msrest.serialization.Model): 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_0.models.DocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -399,6 +485,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntitiesResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -411,18 +508,18 @@ class Entity(msrest.serialization.Model): 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, such as Person/Location/Org/SSN etc. - :type category: str - :param subcategory: Entity sub type, such as Age/Year/TimeRange etc. - :type subcategory: str - :param offset: Required. Start position (in Unicode characters) for the entity text. - :type offset: int - :param length: Required. Length (in Unicode characters) for the entity text. - :type length: int - :param confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. - :type confidence_score: float + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Entity type, such as Person/Location/Org/SSN etc. + :vartype category: str + :ivar subcategory: Entity sub type, such as Age/Year/TimeRange etc. + :vartype subcategory: str + :ivar offset: Required. Start position (in Unicode characters) for the entity text. + :vartype offset: int + :ivar length: Required. Length (in Unicode characters) for the entity text. + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -453,6 +550,20 @@ def __init__( subcategory: Optional[str] = None, **kwargs ): + """ + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Entity type, such as Person/Location/Org/SSN etc. + :paramtype category: str + :keyword subcategory: Entity sub type, such as Age/Year/TimeRange etc. + :paramtype subcategory: str + :keyword offset: Required. Start position (in Unicode characters) for the entity text. + :paramtype offset: int + :keyword length: Required. Length (in Unicode characters) for the entity text. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(Entity, self).__init__(**kwargs) self.text = text self.category = category @@ -467,15 +578,15 @@ class EntityLinkingResult(msrest.serialization.Model): 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_0.models.DocumentLinkedEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentLinkedEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -500,6 +611,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentLinkedEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntityLinkingResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -512,8 +634,8 @@ class ErrorResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param error: Required. Document Error. - :type error: ~azure.ai.textanalytics.v3_0.models.TextAnalyticsError + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_0.models.TextAnalyticsError """ _validation = { @@ -530,6 +652,10 @@ def __init__( error: "TextAnalyticsError", **kwargs ): + """ + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_0.models.TextAnalyticsError + """ super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -539,19 +665,19 @@ class InnerError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "invalidParameterValue", + :ivar code: Required. Error code. Possible values include: "invalidParameterValue", "invalidRequestBodyFormat", "emptyRequest", "missingInputRecords", "invalidDocument", "modelVersionIncorrect", "invalidDocumentBatch", "unsupportedLanguageCode", "invalidCountryHint". - :type code: str or ~azure.ai.textanalytics.v3_0.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_0.models.InnerError + :vartype code: str or ~azure.ai.textanalytics.v3_0.models.InnerErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar details: Error details. + :vartype details: dict[str, str] + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_0.models.InnerError """ _validation = { @@ -577,6 +703,21 @@ def __init__( innererror: Optional["InnerError"] = None, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "invalidParameterValue", + "invalidRequestBodyFormat", "emptyRequest", "missingInputRecords", "invalidDocument", + "modelVersionIncorrect", "invalidDocumentBatch", "unsupportedLanguageCode", + "invalidCountryHint". + :paramtype code: str or ~azure.ai.textanalytics.v3_0.models.InnerErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword details: Error details. + :paramtype details: dict[str, str] + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_0.models.InnerError + """ super(InnerError, self).__init__(**kwargs) self.code = code self.message = message @@ -590,15 +731,15 @@ class KeyPhraseResult(msrest.serialization.Model): 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_0.models.DocumentKeyPhrases] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentKeyPhrases] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -623,6 +764,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentKeyPhrases] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(KeyPhraseResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -635,8 +787,8 @@ class LanguageBatchInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param documents: Required. - :type documents: list[~azure.ai.textanalytics.v3_0.models.LanguageInput] + :ivar documents: Required. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.LanguageInput] """ _validation = { @@ -653,6 +805,10 @@ def __init__( documents: List["LanguageInput"], **kwargs ): + """ + :keyword documents: Required. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.LanguageInput] + """ super(LanguageBatchInput, self).__init__(**kwargs) self.documents = documents @@ -662,12 +818,12 @@ class LanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. + :vartype text: str + :ivar country_hint: + :vartype country_hint: str """ _validation = { @@ -689,6 +845,14 @@ def __init__( country_hint: Optional[str] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. + :paramtype text: str + :keyword country_hint: + :paramtype country_hint: str + """ super(LanguageInput, self).__init__(**kwargs) self.id = id self.text = text @@ -700,15 +864,15 @@ class LanguageResult(msrest.serialization.Model): 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_0.models.DocumentLanguage] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentLanguage] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -733,6 +897,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentLanguage] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(LanguageResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -745,19 +920,18 @@ class LinkedEntity(msrest.serialization.Model): 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_0.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 + :ivar name: Required. Entity Linking formal name. + :vartype name: str + :ivar matches: Required. List of instances this entity appears in the text. + :vartype matches: list[~azure.ai.textanalytics.v3_0.models.Match] + :ivar language: Required. Language used in the data source. + :vartype language: str + :ivar id: Unique identifier of the recognized entity from the data source. + :vartype id: str + :ivar url: Required. URL for the entity's page from the data source. + :vartype url: str + :ivar data_source: Required. Data source used to extract entity linking, such as Wiki/Bing etc. + :vartype data_source: str """ _validation = { @@ -788,6 +962,21 @@ def __init__( id: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. Entity Linking formal name. + :paramtype name: str + :keyword matches: Required. List of instances this entity appears in the text. + :paramtype matches: list[~azure.ai.textanalytics.v3_0.models.Match] + :keyword language: Required. Language used in the data source. + :paramtype language: str + :keyword id: Unique identifier of the recognized entity from the data source. + :paramtype id: str + :keyword url: Required. URL for the entity's page from the data source. + :paramtype url: str + :keyword data_source: Required. Data source used to extract entity linking, such as Wiki/Bing + etc. + :paramtype data_source: str + """ super(LinkedEntity, self).__init__(**kwargs) self.name = name self.matches = matches @@ -802,15 +991,15 @@ class Match(msrest.serialization.Model): 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 (in Unicode characters) for the entity match text. - :type offset: int - :param length: Required. Length (in Unicode characters) for the entity match text. - :type length: int + :ivar confidence_score: Required. If a well-known item is recognized, a decimal number denoting + the confidence level between 0 and 1 will be returned. + :vartype confidence_score: float + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar offset: Required. Start position (in Unicode characters) for the entity match text. + :vartype offset: int + :ivar length: Required. Length (in Unicode characters) for the entity match text. + :vartype length: int """ _validation = { @@ -836,6 +1025,17 @@ def __init__( length: int, **kwargs ): + """ + :keyword confidence_score: Required. If a well-known item is recognized, a decimal number + denoting the confidence level between 0 and 1 will be returned. + :paramtype confidence_score: float + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword offset: Required. Start position (in Unicode characters) for the entity match text. + :paramtype offset: int + :keyword length: Required. Length (in Unicode characters) for the entity match text. + :paramtype length: int + """ super(Match, self).__init__(**kwargs) self.confidence_score = confidence_score self.text = text @@ -848,8 +1048,8 @@ class MultiLanguageBatchInput(msrest.serialization.Model): 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_0.models.MultiLanguageInput] + :ivar documents: Required. The set of documents to process as part of this batch. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput] """ _validation = { @@ -866,6 +1066,10 @@ def __init__( documents: List["MultiLanguageInput"], **kwargs ): + """ + :keyword documents: Required. The set of documents to process as part of this batch. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.MultiLanguageInput] + """ super(MultiLanguageBatchInput, self).__init__(**kwargs) self.documents = documents @@ -875,14 +1079,14 @@ class MultiLanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. A unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. The input text to process. + :vartype text: str + :ivar 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 + :vartype language: str """ _validation = { @@ -904,6 +1108,16 @@ def __init__( language: Optional[str] = None, **kwargs ): + """ + :keyword id: Required. A unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. The input text to process. + :paramtype text: str + :keyword 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. + :paramtype language: str + """ super(MultiLanguageInput, self).__init__(**kwargs) self.id = id self.text = text @@ -915,16 +1129,16 @@ class RequestStatistics(msrest.serialization.Model): 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, + :ivar documents_count: Required. Number of documents submitted in the request. + :vartype documents_count: int + :ivar 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, + :vartype valid_documents_count: int + :ivar 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 + :vartype erroneous_documents_count: int + :ivar transactions_count: Required. Number of transactions for the request. + :vartype transactions_count: long """ _validation = { @@ -950,6 +1164,18 @@ def __init__( transactions_count: int, **kwargs ): + """ + :keyword documents_count: Required. Number of documents submitted in the request. + :paramtype documents_count: int + :keyword valid_documents_count: Required. Number of valid documents. This excludes empty, + over-size limit or non-supported languages documents. + :paramtype valid_documents_count: int + :keyword erroneous_documents_count: Required. Number of invalid documents. This includes empty, + over-size limit or non-supported languages documents. + :paramtype erroneous_documents_count: int + :keyword transactions_count: Required. Number of transactions for the request. + :paramtype transactions_count: long + """ super(RequestStatistics, self).__init__(**kwargs) self.documents_count = documents_count self.valid_documents_count = valid_documents_count @@ -962,18 +1188,19 @@ class SentenceSentiment(msrest.serialization.Model): 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: + :ivar text: Required. The sentence text. + :vartype text: str + :ivar sentiment: Required. The predicted Sentiment for the sentence. Possible values include: "positive", "neutral", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_0.models.SentenceSentimentValue - :param confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + :vartype sentiment: str or ~azure.ai.textanalytics.v3_0.models.SentenceSentimentValue + :ivar confidence_scores: Required. The sentiment confidence score between 0 and 1 for the sentence for all classes. - :type confidence_scores: ~azure.ai.textanalytics.v3_0.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 by Unicode standard. - :type length: int + :vartype confidence_scores: + ~azure.ai.textanalytics.v3_0.models.SentimentConfidenceScorePerLabel + :ivar offset: Required. The sentence offset from the start of the document. + :vartype offset: int + :ivar length: Required. The length of the sentence by Unicode standard. + :vartype length: int """ _validation = { @@ -1002,6 +1229,21 @@ def __init__( length: int, **kwargs ): + """ + :keyword text: Required. The sentence text. + :paramtype text: str + :keyword sentiment: Required. The predicted Sentiment for the sentence. Possible values + include: "positive", "neutral", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_0.models.SentenceSentimentValue + :keyword confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + sentence for all classes. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_0.models.SentimentConfidenceScorePerLabel + :keyword offset: Required. The sentence offset from the start of the document. + :paramtype offset: int + :keyword length: Required. The length of the sentence by Unicode standard. + :paramtype length: int + """ super(SentenceSentiment, self).__init__(**kwargs) self.text = text self.sentiment = sentiment @@ -1015,12 +1257,12 @@ class SentimentConfidenceScorePerLabel(msrest.serialization.Model): 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 + :ivar positive: Required. + :vartype positive: float + :ivar neutral: Required. + :vartype neutral: float + :ivar negative: Required. + :vartype negative: float """ _validation = { @@ -1043,6 +1285,14 @@ def __init__( negative: float, **kwargs ): + """ + :keyword positive: Required. + :paramtype positive: float + :keyword neutral: Required. + :paramtype neutral: float + :keyword negative: Required. + :paramtype negative: float + """ super(SentimentConfidenceScorePerLabel, self).__init__(**kwargs) self.positive = positive self.neutral = neutral @@ -1054,15 +1304,15 @@ class SentimentResponse(msrest.serialization.Model): 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_0.models.DocumentSentiment] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Sentiment analysis per document. + :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentSentiment] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1087,6 +1337,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Sentiment analysis per document. + :paramtype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentSentiment] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_0.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_0.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(SentimentResponse, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -1099,17 +1360,17 @@ class TextAnalyticsError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "invalidRequest", - "invalidArgument", "internalServerError", "serviceUnavailable". - :type code: str or ~azure.ai.textanalytics.v3_0.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_0.models.InnerError - :param details: Details about specific errors that led to this reported error. - :type details: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsError] + :ivar code: Required. Error code. Possible values include: "invalidRequest", "invalidArgument", + "internalServerError", "serviceUnavailable". + :vartype code: str or ~azure.ai.textanalytics.v3_0.models.ErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_0.models.InnerError + :ivar details: Details about specific errors that led to this reported error. + :vartype details: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsError] """ _validation = { @@ -1135,6 +1396,19 @@ def __init__( details: Optional[List["TextAnalyticsError"]] = None, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "invalidRequest", + "invalidArgument", "internalServerError", "serviceUnavailable". + :paramtype code: str or ~azure.ai.textanalytics.v3_0.models.ErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_0.models.InnerError + :keyword details: Details about specific errors that led to this reported error. + :paramtype details: list[~azure.ai.textanalytics.v3_0.models.TextAnalyticsError] + """ super(TextAnalyticsError, self).__init__(**kwargs) self.code = code self.message = message @@ -1148,13 +1422,13 @@ class TextAnalyticsWarning(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "LongWordsInDocument", + :ivar code: Required. Error code. Possible values include: "LongWordsInDocument", "DocumentTruncated". - :type code: str or ~azure.ai.textanalytics.v3_0.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 + :vartype code: str or ~azure.ai.textanalytics.v3_0.models.WarningCodeValue + :ivar message: Required. Warning message. + :vartype message: str + :ivar target_ref: A JSON pointer reference indicating the target object. + :vartype target_ref: str """ _validation = { @@ -1176,6 +1450,15 @@ def __init__( target_ref: Optional[str] = None, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "LongWordsInDocument", + "DocumentTruncated". + :paramtype code: str or ~azure.ai.textanalytics.v3_0.models.WarningCodeValue + :keyword message: Required. Warning message. + :paramtype message: str + :keyword target_ref: A JSON pointer reference indicating the target object. + :paramtype target_ref: str + """ super(TextAnalyticsWarning, self).__init__(**kwargs) self.code = code self.message = message diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_text_analytics_client_enums.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_text_analytics_client_enums.py index 880e381d7da3..cae791e56103 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_text_analytics_client_enums.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/_text_analytics_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 DocumentSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DocumentSentimentValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Predicted sentiment for document (Negative, Neutral, Positive, or Mixed). """ @@ -35,7 +20,7 @@ class DocumentSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) NEGATIVE = "negative" MIXED = "mixed" -class ErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ErrorCodeValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Error code. """ @@ -44,7 +29,7 @@ class ErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): INTERNAL_SERVER_ERROR = "internalServerError" SERVICE_UNAVAILABLE = "serviceUnavailable" -class InnerErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class InnerErrorCodeValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Error code. """ @@ -58,7 +43,7 @@ class InnerErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UNSUPPORTED_LANGUAGE_CODE = "unsupportedLanguageCode" INVALID_COUNTRY_HINT = "invalidCountryHint" -class SentenceSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SentenceSentimentValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The predicted Sentiment for the sentence. """ @@ -66,7 +51,7 @@ class SentenceSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) NEUTRAL = "neutral" NEGATIVE = "negative" -class WarningCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WarningCodeValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Error code. """ diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/operations/_text_analytics_client_operations.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/operations/_text_analytics_client_operations.py index 913f3155c4c1..cc979c8445bc 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/operations/_text_analytics_client_operations.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/operations/_text_analytics_client_operations.py @@ -5,14 +5,19 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings 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.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -21,8 +26,182 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +# fmt: off + +def build_entities_recognition_general_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/recognition/general') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_entities_linking_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/linking') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_key_phrases_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/keyPhrases') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_languages_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/languages') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_sentiment_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/sentiment') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class TextAnalyticsClientOperationsMixin(object): + @distributed_trace def entities_recognition_general( self, documents, # type: List["_models.MultiLanguageInput"] @@ -57,39 +236,30 @@ def entities_recognition_general( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_recognition_general.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_recognition_general_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + json=json, + template_url=self.entities_recognition_general.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntitiesResult', pipeline_response) @@ -98,8 +268,11 @@ def entities_recognition_general( return cls(pipeline_response, deserialized, {}) return deserialized + entities_recognition_general.metadata = {'url': '/entities/recognition/general'} # type: ignore + + @distributed_trace def entities_linking( self, documents, # type: List["_models.MultiLanguageInput"] @@ -133,39 +306,30 @@ def entities_linking( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_linking.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_linking_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + json=json, + template_url=self.entities_linking.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntityLinkingResult', pipeline_response) @@ -174,8 +338,11 @@ def entities_linking( return cls(pipeline_response, deserialized, {}) return deserialized + entities_linking.metadata = {'url': '/entities/linking'} # type: ignore + + @distributed_trace def key_phrases( self, documents, # type: List["_models.MultiLanguageInput"] @@ -209,39 +376,30 @@ def key_phrases( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.key_phrases.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_key_phrases_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + json=json, + template_url=self.key_phrases.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('KeyPhraseResult', pipeline_response) @@ -250,8 +408,11 @@ def key_phrases( return cls(pipeline_response, deserialized, {}) return deserialized + key_phrases.metadata = {'url': '/keyPhrases'} # type: ignore + + @distributed_trace def languages( self, documents, # type: List["_models.LanguageInput"] @@ -286,39 +447,30 @@ def languages( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.languages.metadata['url'] # type: ignore + _input = _models.LanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'LanguageBatchInput') + + request = build_languages_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + json=json, + template_url=self.languages.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('LanguageResult', pipeline_response) @@ -327,8 +479,11 @@ def languages( return cls(pipeline_response, deserialized, {}) return deserialized + languages.metadata = {'url': '/languages'} # type: ignore + + @distributed_trace def sentiment( self, documents, # type: List["_models.MultiLanguageInput"] @@ -363,39 +518,30 @@ def sentiment( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.sentiment.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_sentiment_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + json=json, + template_url=self.sentiment.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SentimentResponse', pipeline_response) @@ -404,4 +550,6 @@ def sentiment( 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/_metadata.json b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_metadata.json index 28bb0368c3b1..a3d69330a7ad 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_metadata.json +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_metadata.json @@ -5,13 +5,13 @@ "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. Functionality for analysis of text specific to the healthcare domain and personal information are also available in the API. 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\u0027", + "host_value": null, + "parameterized_host_template": "\u0027{Endpoint}/text/analytics/v3.1\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\"]}, \"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\"]}}}" + "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\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"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": { @@ -79,45 +79,44 @@ "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, + "credential_call_sync": "policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)", "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\": [\"AnalyzeActionsLROPoller\", \"AnalyzeActionsLROPollingMethod\", \"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\"], \".....aio._lro_async\": [\"AsyncAnalyzeActionsLROPoller\", \"AsyncAnalyzeActionsLROPollingMethod\", \"AsyncAnalyzeHealthcareEntitiesLROPoller\", \"AsyncAnalyzeHealthcareEntitiesLROPollingMethod\"], \"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\"]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"List\", \"Optional\", \"Union\"]}, \"azurecore\": {\"...._lro\": [\"AnalyzeActionsLROPoller\", \"AnalyzeHealthcareEntitiesLROPoller\"], \"azure.core.polling\": [\"LROPoller\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"List\", \"Optional\", \"Union\"]}, \"azurecore\": {\".....aio._lro_async\": [\"AsyncAnalyzeActionsLROPoller\", \"AsyncAnalyzeHealthcareEntitiesLROPoller\"], \"azure.core.polling\": [\"AsyncLROPoller\"]}}}", "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.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.models.AnalyzeJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _analyze_initial(\n self,\n body=None, # type: Optional[\"_models.AnalyzeBatchInput\"]\n **kwargs # type: Any\n):\n # type: (...) -\u003e Optional[\"_models.AnalyzeJobState\"]\n", + "doc": "\"\"\"Submit analysis job.\n\n:param body: Collection of documents to analyze and tasks to execute.\n:type body: ~azure.ai.textanalytics.v3_1.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.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: Any\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.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.models.AnalyzeJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Submit analysis job.\n\n:param body: Collection of documents to analyze and tasks to execute.\n:type body: ~azure.ai.textanalytics.v3_1.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.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.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: By default, your polling method will be AnalyzeActionsLROPollingMethod.\n Pass in False for this operation to not poll, or pass in 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 AnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)\n:rtype: ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1.models.AnalyzeJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_analyze(\n self,\n body=None, # type: Optional[\"_models.AnalyzeBatchInput\"]\n **kwargs # type: Any\n):\n # type: (...) -\u003e AnalyzeActionsLROPoller[\"_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.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: By default, your polling method will be AnalyzeActionsLROPollingMethod. Pass\n in False for this operation to not poll, or pass in your own initialized polling object for a\n 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\n Retry-After header is present.\n:return: An instance of AnalyzeActionsLROPoller that returns either AnalyzeJobState or the\n result of cls(response)\n:rtype: ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1.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: Any\n) -\u003e AsyncAnalyzeActionsLROPoller[\"_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.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: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod.\n Pass in False for this operation to not poll, or pass in 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 AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)\n:rtype: ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1.models.AnalyzeJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\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.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: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod.\n Pass in False for this operation to not poll, or pass in your own initialized polling object\n 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\n Retry-After header is present.\n:return: An instance of AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the\n result of cls(response)\n:rtype:\n ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1.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", + "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 # type: (...) -\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.models.AnalyzeJobState\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -129,7 +128,7 @@ }, "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", + "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 # type: (...) -\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.models.HealthcareJobState\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -141,55 +140,55 @@ }, "_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\"\"\"" + "signature": "def _cancel_health_job_initial(\n self,\n job_id, # type: str\n **kwargs # type: Any\n):\n # type: (...) -\u003e None\n", + "doc": "\"\"\"Cancel 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: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: Any\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\"\"\"" + "doc": "\"\"\"Cancel 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: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: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in 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\"\"\"" + "signature": "def begin_cancel_health_job(\n self,\n job_id, # type: str\n **kwargs # type: Any\n):\n # type: (...) -\u003e LROPoller[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: By default, your polling method will be LROBasePolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n 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\n 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: Any\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: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in 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\"\"\"" + "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: By default, your polling method will be AsyncLROBasePolling. Pass in False\n for this operation to not poll, or pass in your own initialized polling object for a personal\n 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\n 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=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n logging_opt_out=None, # type: Optional[bool]\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.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.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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.models.HealthcareJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _health_initial(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n # type: (...) -\u003e Optional[\"_models.HealthcareJobState\"]\n", + "doc": "\"\"\"Submit healthcare analysis job.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1.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.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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.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\"]] = None,\n logging_opt_out: Optional[bool] = None,\n **kwargs: Any\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.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.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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.models.HealthcareJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Submit healthcare analysis job.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1.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.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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.models.HealthcareJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "documents, model_version, string_index_type, logging_opt_out" }, "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=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n logging_opt_out=None, # type: Optional[bool]\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.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.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: bool\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: By default, your polling method will be AnalyzeHealthcareEntitiesLROPollingMethod.\n Pass in False for this operation to not poll, or pass in 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.models.HealthcareJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_health(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n # type: (...) -\u003e AnalyzeHealthcareEntitiesLROPoller[\"_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.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.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: bool\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: By default, your polling method will be\n AnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll, or\n pass in 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\n Retry-After header is present.\n:return: An instance of AnalyzeHealthcareEntitiesLROPoller that returns either\n HealthcareJobState or the result of cls(response)\n:rtype:\n ~...._lro.AnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1.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\"]] = None,\n logging_opt_out: Optional[bool] = None,\n **kwargs: Any\n) -\u003e AsyncAnalyzeHealthcareEntitiesLROPoller[\"_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.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.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: bool\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: By default, your polling method will be AsyncAnalyzeHealthcareEntitiesLROPollingMethod.\n Pass in False for this operation to not poll, or pass in 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 AsyncAnalyzeHealthcareEntitiesLROPoller that returns either HealthcareJobState or the result of cls(response)\n:rtype: ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1.models.HealthcareJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\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.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.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: bool\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: By default, your polling method will be\n AsyncAnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll,\n or pass in 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\n Retry-After header is present.\n:return: An instance of AsyncAnalyzeHealthcareEntitiesLROPoller that returns either\n HealthcareJobState or the result of cls(response)\n:rtype:\n ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1.models.HealthcareJobState]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "documents, model_version, string_index_type, logging_opt_out" }, "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 logging_opt_out=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n # type: (...) -\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.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 logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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.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.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -201,7 +200,7 @@ }, "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 logging_opt_out=None, # type: Optional[bool]\n domain=None, # type: Optional[str]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n pii_categories=None, # type: Optional[List[Union[str, \"_models.PiiCategory\"]]]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n domain=None, # type: Optional[str]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n pii_categories=None, # type: Optional[List[Union[str, \"_models.PiiCategory\"]]]\n **kwargs # type: Any\n):\n # type: (...) -\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.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 logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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.models.StringIndexType\n:param pii_categories: (Optional) describes the PII categories to return.\n:type pii_categories: list[str or ~azure.ai.textanalytics.v3_1.models.PiiCategory]\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.models.PiiResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -213,7 +212,7 @@ }, "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 logging_opt_out=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n # type: (...) -\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.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 logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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.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.models.EntityLinkingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -225,7 +224,7 @@ }, "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 logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n # type: (...) -\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.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 logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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.models.KeyPhraseResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -237,7 +236,7 @@ }, "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 logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n # type: (...) -\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.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:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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.models.LanguageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -249,7 +248,7 @@ }, "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 logging_opt_out=None, # type: Optional[bool]\n opinion_mining=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n opinion_mining=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n # type: (...) -\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(targets and assessments).\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_1.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 logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: bool\n:param opinion_mining: (Optional) if set to true, response will contain not only sentiment\n prediction but also opinion mining (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.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.models.SentimentResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_text_analytics_client.py index 3ddfe5c33c8d..79760767eb6f 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_text_analytics_client.py @@ -6,31 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from copy import deepcopy from typing import TYPE_CHECKING from azure.core import PipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import TextAnalyticsClientConfiguration +from .operations import TextAnalyticsClientOperationsMixin + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports 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 -from . import models - + from azure.core.rest import HttpRequest, HttpResponse 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. Functionality for analysis of text specific to the healthcare domain and personal information are also available in the API. 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). + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( @@ -40,33 +42,46 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - base_url = '{Endpoint}/text/analytics/v3.1' + _base_url = '{Endpoint}/text/analytics/v3.1' self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs) - self._client = PipelineClient(base_url=base_url, config=self._config, **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) + self._serialize.client_side_validation = False - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs # type: Any + ): + # type: (...) -> 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ + + request_copy = deepcopy(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_vendor.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# 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.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/_text_analytics_client.py index 32f4bb4051e0..975be64f0179 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/_text_analytics_client.py @@ -6,29 +6,31 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING from azure.core import AsyncPipelineClient -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from msrest import Deserializer, Serializer -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - +from .. import models from ._configuration import TextAnalyticsClientConfiguration from .operations import TextAnalyticsClientOperationsMixin -from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential 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. Functionality for analysis of text specific to the healthcare domain and personal information are also available in the API. 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). + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( @@ -37,32 +39,45 @@ def __init__( endpoint: str, **kwargs: Any ) -> None: - base_url = '{Endpoint}/text/analytics/v3.1' + _base_url = '{Endpoint}/text/analytics/v3.1' self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs) - self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **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) + self._serialize.client_side_validation = False - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ + + request_copy = deepcopy(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/operations/_text_analytics_client_operations.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/operations/_text_analytics_client_operations.py index d8dd4b5e851a..f016a0f75863 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/operations/_text_analytics_client_operations.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/operations/_text_analytics_client_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings from .....aio._lro_async import AsyncAnalyzeActionsLROPoller, AsyncAnalyzeActionsLROPollingMethod, AsyncAnalyzeHealthcareEntitiesLROPoller, AsyncAnalyzeHealthcareEntitiesLROPollingMethod 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.polling.async_base_polling import AsyncLROBasePolling +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from ... import models as _models +from ..._vendor import _convert_request +from ...operations._text_analytics_client_operations import build_analyze_request_initial, build_analyze_status_request, build_cancel_health_job_request_initial, build_entities_linking_request, build_entities_recognition_general_request, build_entities_recognition_pii_request, build_health_request_initial, build_health_status_request, build_key_phrases_request, build_languages_request, build_sentiment_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,53 +37,50 @@ async def _analyze_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } 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] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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] if body is not None: - body_content = self._serialize.body(body, 'AnalyzeBatchInput') + json = 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) + json = None + + request = build_analyze_request_initial( + content_type=content_type, + json=json, + template_url=self._analyze_initial.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) - response_headers = {} deserialized = None + response_headers = {} 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 + + @distributed_trace_async async def begin_analyze( self, body: Optional["_models.AnalyzeBatchInput"] = None, @@ -94,14 +96,19 @@ async def begin_analyze( :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: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + Pass in False for this operation to not poll, or pass in 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 AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response) - :rtype: ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1.models.AnalyzeJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the + result of cls(response) + :rtype: + ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1.models.AnalyzeJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeJobState"] lro_delay = kwargs.pop( 'polling_interval', @@ -111,25 +118,25 @@ async def begin_analyze( if cont_token is None: raw_result = await self._analyze_initial( body=body, + content_type=content_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): + response = pipeline_response.http_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), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = AsyncAnalyzeActionsLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncAnalyzeActionsLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -141,8 +148,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncAnalyzeActionsLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze.metadata = {'url': '/analyze'} # type: ignore + @distributed_trace_async async def analyze_status( self, job_id: str, @@ -178,36 +187,27 @@ async def analyze_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self.analyze_status.metadata['url'] # type: ignore + + request = build_analyze_status_request( + job_id=job_id, + show_stats=show_stats, + top=top, + skip=skip, + template_url=self.analyze_status.metadata['url'], + ) + request = _convert_request(request) 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'), + "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 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('AnalyzeJobState', pipeline_response) @@ -216,8 +216,11 @@ async def analyze_status( return cls(pipeline_response, deserialized, {}) return deserialized + analyze_status.metadata = {'url': '/analyze/jobs/{jobId}'} # type: ignore + + @distributed_trace_async async def health_status( self, job_id: str, @@ -251,36 +254,27 @@ async def health_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self.health_status.metadata['url'] # type: ignore + + request = build_health_status_request( + job_id=job_id, + top=top, + skip=skip, + show_stats=show_stats, + template_url=self.health_status.metadata['url'], + ) + request = _convert_request(request) 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'), + "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 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('HealthcareJobState', pipeline_response) @@ -289,8 +283,10 @@ async def health_status( 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, @@ -301,40 +297,36 @@ async def _cancel_health_job_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self._cancel_health_job_initial.metadata['url'] # type: ignore + + request = build_cancel_health_job_request_initial( + job_id=job_id, + template_url=self._cancel_health_job_initial.metadata['url'], + ) + request = _convert_request(request) 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'), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + 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 + + @distributed_trace_async async def begin_cancel_health_job( self, job_id: str, @@ -348,15 +340,17 @@ async def begin_cancel_health_job( :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: By default, your polling method will be AsyncLROBasePolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in 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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -369,20 +363,18 @@ async def begin_cancel_health_job( 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'), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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: @@ -394,6 +386,7 @@ def get_long_running_output(pipeline_response): ) 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( @@ -410,57 +403,50 @@ async def _health_initial( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self._health_initial.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_health_request_initial( + content_type=content_type, + model_version=model_version, + string_index_type=string_index_type, + logging_opt_out=logging_opt_out, + json=json, + template_url=self._health_initial.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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') - if logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) - response_headers = {} deserialized = None + response_headers = {} 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 + + @distributed_trace_async async def begin_health( self, documents: List["_models.MultiLanguageInput"], @@ -493,15 +479,20 @@ async def begin_health( :type logging_opt_out: bool :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: By default, your polling method will be AsyncAnalyzeHealthcareEntitiesLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be + AsyncAnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll, + or pass in 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 AsyncAnalyzeHealthcareEntitiesLROPoller that returns either HealthcareJobState or the result of cls(response) - :rtype: ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1.models.HealthcareJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncAnalyzeHealthcareEntitiesLROPoller that returns either + HealthcareJobState or the result of cls(response) + :rtype: + ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1.models.HealthcareJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.HealthcareJobState"] lro_delay = kwargs.pop( 'polling_interval', @@ -514,25 +505,25 @@ async def begin_health( model_version=model_version, string_index_type=string_index_type, logging_opt_out=logging_opt_out, + content_type=content_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): + response = pipeline_response.http_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), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = AsyncAnalyzeHealthcareEntitiesLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncAnalyzeHealthcareEntitiesLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -544,8 +535,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncAnalyzeHealthcareEntitiesLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_health.metadata = {'url': '/entities/health/jobs'} # type: ignore + @distributed_trace_async async def entities_recognition_general( self, documents: List["_models.MultiLanguageInput"], @@ -593,43 +586,32 @@ async def entities_recognition_general( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_recognition_general.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_recognition_general_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + string_index_type=string_index_type, + json=json, + template_url=self.entities_recognition_general.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntitiesResult', pipeline_response) @@ -638,8 +620,11 @@ async def entities_recognition_general( return cls(pipeline_response, deserialized, {}) return deserialized + entities_recognition_general.metadata = {'url': '/entities/recognition/general'} # type: ignore + + @distributed_trace_async async def entities_recognition_pii( self, documents: List["_models.MultiLanguageInput"], @@ -695,47 +680,34 @@ async def entities_recognition_pii( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_recognition_pii.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_recognition_pii_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + domain=domain, + string_index_type=string_index_type, + pii_categories=pii_categories, + json=json, + template_url=self.entities_recognition_pii.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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') - if pii_categories is not None: - query_parameters['piiCategories'] = self._serialize.query("pii_categories", pii_categories, '[str]', div=',') - - # 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PiiResult', pipeline_response) @@ -744,8 +716,11 @@ async def entities_recognition_pii( return cls(pipeline_response, deserialized, {}) return deserialized + entities_recognition_pii.metadata = {'url': '/entities/recognition/pii'} # type: ignore + + @distributed_trace_async async def entities_linking( self, documents: List["_models.MultiLanguageInput"], @@ -792,43 +767,32 @@ async def entities_linking( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_linking.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_linking_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + string_index_type=string_index_type, + json=json, + template_url=self.entities_linking.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntityLinkingResult', pipeline_response) @@ -837,8 +801,11 @@ async def entities_linking( return cls(pipeline_response, deserialized, {}) return deserialized + entities_linking.metadata = {'url': '/entities/linking'} # type: ignore + + @distributed_trace_async async def key_phrases( self, documents: List["_models.MultiLanguageInput"], @@ -880,41 +847,31 @@ async def key_phrases( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.key_phrases.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_key_phrases_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + json=json, + template_url=self.key_phrases.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('KeyPhraseResult', pipeline_response) @@ -923,8 +880,11 @@ async def key_phrases( return cls(pipeline_response, deserialized, {}) return deserialized + key_phrases.metadata = {'url': '/keyPhrases'} # type: ignore + + @distributed_trace_async async def languages( self, documents: List["_models.LanguageInput"], @@ -967,41 +927,31 @@ async def languages( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.languages.metadata['url'] # type: ignore + _input = _models.LanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'LanguageBatchInput') + + request = build_languages_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + json=json, + template_url=self.languages.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('LanguageResult', pipeline_response) @@ -1010,8 +960,11 @@ async def languages( return cls(pipeline_response, deserialized, {}) return deserialized + languages.metadata = {'url': '/languages'} # type: ignore + + @distributed_trace_async async def sentiment( self, documents: List["_models.MultiLanguageInput"], @@ -1062,45 +1015,33 @@ async def sentiment( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.sentiment.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_sentiment_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + opinion_mining=opinion_mining, + string_index_type=string_index_type, + json=json, + template_url=self.sentiment.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SentimentResponse', pipeline_response) @@ -1109,4 +1050,6 @@ async def sentiment( 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/models/_models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_models.py index 69764c937670..f049bc1cdf92 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_models.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_models.py @@ -15,9 +15,9 @@ class AnalysisInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param analysis_input: Required. Contains a set of input documents to be analyzed by the + :ivar analysis_input: Required. Contains a set of input documents to be analyzed by the service. - :type analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput + :vartype analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput """ _validation = { @@ -32,6 +32,11 @@ def __init__( self, **kwargs ): + """ + :keyword analysis_input: Required. Contains a set of input documents to be analyzed by the + service. + :paramtype analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput + """ super(AnalysisInput, self).__init__(**kwargs) self.analysis_input = kwargs['analysis_input'] @@ -41,9 +46,9 @@ class JobManifest(msrest.serialization.Model): 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 + :ivar 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.models.JobManifestTasks + :vartype tasks: ~azure.ai.textanalytics.v3_1.models.JobManifestTasks """ _validation = { @@ -58,6 +63,11 @@ def __init__( self, **kwargs ): + """ + :keyword tasks: Required. The set of tasks to execute on the input documents. Cannot specify + the same task more than once. + :paramtype tasks: ~azure.ai.textanalytics.v3_1.models.JobManifestTasks + """ super(JobManifest, self).__init__(**kwargs) self.tasks = kwargs['tasks'] @@ -65,8 +75,8 @@ def __init__( class JobDescriptor(msrest.serialization.Model): """JobDescriptor. - :param display_name: Optional display name for the analysis job. - :type display_name: str + :ivar display_name: Optional display name for the analysis job. + :vartype display_name: str """ _attribute_map = { @@ -77,6 +87,10 @@ def __init__( self, **kwargs ): + """ + :keyword display_name: Optional display name for the analysis job. + :paramtype display_name: str + """ super(JobDescriptor, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) @@ -86,14 +100,14 @@ class AnalyzeBatchInput(JobDescriptor, AnalysisInput, 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 + :ivar 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.models.JobManifestTasks - :param analysis_input: Required. Contains a set of input documents to be analyzed by the + :vartype tasks: ~azure.ai.textanalytics.v3_1.models.JobManifestTasks + :ivar analysis_input: Required. Contains a set of input documents to be analyzed by the service. - :type analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput - :param display_name: Optional display name for the analysis job. - :type display_name: str + :vartype analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput + :ivar display_name: Optional display name for the analysis job. + :vartype display_name: str """ _validation = { @@ -111,6 +125,16 @@ def __init__( self, **kwargs ): + """ + :keyword tasks: Required. The set of tasks to execute on the input documents. Cannot specify + the same task more than once. + :paramtype tasks: ~azure.ai.textanalytics.v3_1.models.JobManifestTasks + :keyword analysis_input: Required. Contains a set of input documents to be analyzed by the + service. + :paramtype analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput + :keyword display_name: Optional display name for the analysis job. + :paramtype display_name: str + """ super(AnalyzeBatchInput, self).__init__(**kwargs) self.tasks = kwargs['tasks'] self.analysis_input = kwargs['analysis_input'] @@ -123,8 +147,8 @@ def __init__( class AnalyzeJobDisplayName(msrest.serialization.Model): """AnalyzeJobDisplayName. - :param display_name: - :type display_name: str + :ivar display_name: + :vartype display_name: str """ _attribute_map = { @@ -135,6 +159,10 @@ def __init__( self, **kwargs ): + """ + :keyword display_name: + :paramtype display_name: str + """ super(AnalyzeJobDisplayName, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) @@ -142,11 +170,11 @@ def __init__( class AnalyzeJobErrorsAndStatistics(msrest.serialization.Model): """AnalyzeJobErrorsAndStatistics. - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :ivar 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.models.RequestStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics """ _attribute_map = { @@ -158,6 +186,13 @@ def __init__( self, **kwargs ): + """ + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + """ super(AnalyzeJobErrorsAndStatistics, self).__init__(**kwargs) self.errors = kwargs.get('errors', None) self.statistics = kwargs.get('statistics', None) @@ -168,17 +203,17 @@ class JobMetadata(msrest.serialization.Model): 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", + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -200,6 +235,19 @@ def __init__( self, **kwargs ): + """ + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(JobMetadata, self).__init__(**kwargs) self.created_date_time = kwargs['created_date_time'] self.expiration_date_time = kwargs.get('expiration_date_time', None) @@ -213,19 +261,19 @@ class AnalyzeJobMetadata(JobMetadata, AnalyzeJobDisplayName): All required parameters must be populated in order to send to Azure. - :param display_name: - :type display_name: 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", + :ivar display_name: + :vartype display_name: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -248,6 +296,21 @@ def __init__( self, **kwargs ): + """ + :keyword display_name: + :paramtype display_name: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(AnalyzeJobMetadata, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) self.created_date_time = kwargs['created_date_time'] @@ -260,8 +323,8 @@ def __init__( class Pagination(msrest.serialization.Model): """Pagination. - :param next_link: - :type next_link: str + :ivar next_link: + :vartype next_link: str """ _attribute_map = { @@ -272,6 +335,10 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: + :paramtype next_link: str + """ super(Pagination, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) @@ -281,8 +348,8 @@ class TasksState(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks + :ivar tasks: Required. + :vartype tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks """ _validation = { @@ -297,6 +364,10 @@ def __init__( self, **kwargs ): + """ + :keyword tasks: Required. + :paramtype tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks + """ super(TasksState, self).__init__(**kwargs) self.tasks = kwargs['tasks'] @@ -306,28 +377,28 @@ class AnalyzeJobState(AnalyzeJobMetadata, TasksState, AnalyzeJobErrorsAndStatist All required parameters must be populated in order to send to Azure. - :param next_link: - :type next_link: str - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar next_link: + :vartype next_link: str + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :ivar 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.models.RequestStatistics - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks - :param display_name: - :type display_name: 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", + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar tasks: Required. + :vartype tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks + :ivar display_name: + :vartype display_name: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -355,6 +426,30 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: + :paramtype next_link: str + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword tasks: Required. + :paramtype tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks + :keyword display_name: + :paramtype display_name: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(AnalyzeJobState, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) self.errors = kwargs.get('errors', None) @@ -393,14 +488,14 @@ class DetectedLanguage(msrest.serialization.Model): 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 + :ivar name: Required. Long name of a detected language (e.g. English, French). + :vartype name: str + :ivar iso6391_name: Required. A two letter representation of the detected language according to + the ISO 639-1 standard (e.g. en, fr). + :vartype iso6391_name: str + :ivar 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 + :vartype confidence_score: float """ _validation = { @@ -419,6 +514,16 @@ def __init__( self, **kwargs ): + """ + :keyword name: Required. Long name of a detected language (e.g. English, French). + :paramtype name: str + :keyword iso6391_name: Required. A two letter representation of the detected language according + to the ISO 639-1 standard (e.g. en, fr). + :paramtype iso6391_name: str + :keyword confidence_score: Required. A confidence score between 0 and 1. Scores close to 1 + indicate 100% certainty that the identified language is true. + :paramtype confidence_score: float + """ super(DetectedLanguage, self).__init__(**kwargs) self.name = kwargs['name'] self.iso6391_name = kwargs['iso6391_name'] @@ -430,15 +535,15 @@ class DocumentEntities(msrest.serialization.Model): 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.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_1.models.Entity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -458,6 +563,17 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_1.models.Entity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(DocumentEntities, self).__init__(**kwargs) self.id = kwargs['id'] self.entities = kwargs['entities'] @@ -470,10 +586,10 @@ class DocumentError(msrest.serialization.Model): 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.models.TextAnalyticsError + :ivar id: Required. Document Id. + :vartype id: str + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_1.models.TextAnalyticsError """ _validation = { @@ -490,6 +606,12 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Document Id. + :paramtype id: str + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_1.models.TextAnalyticsError + """ super(DocumentError, self).__init__(**kwargs) self.id = kwargs['id'] self.error = kwargs['error'] @@ -500,17 +622,17 @@ class DocumentHealthcareEntities(msrest.serialization.Model): 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.models.HealthcareEntity] - :param relations: Required. Healthcare entity relations. - :type relations: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelation] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Healthcare entities. + :vartype entities: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntity] + :ivar relations: Required. Healthcare entity relations. + :vartype relations: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelation] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -532,6 +654,19 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Healthcare entities. + :paramtype entities: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntity] + :keyword relations: Required. Healthcare entity relations. + :paramtype relations: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelation] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(DocumentHealthcareEntities, self).__init__(**kwargs) self.id = kwargs['id'] self.entities = kwargs['entities'] @@ -545,16 +680,16 @@ class DocumentKeyPhrases(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :vartype key_phrases: list[str] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -574,6 +709,18 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword 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. + :paramtype key_phrases: list[str] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(DocumentKeyPhrases, self).__init__(**kwargs) self.id = kwargs['id'] self.key_phrases = kwargs['key_phrases'] @@ -586,15 +733,15 @@ class DocumentLanguage(msrest.serialization.Model): 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.models.DetectedLanguage - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar detected_language: Required. Detected Language. + :vartype detected_language: ~azure.ai.textanalytics.v3_1.models.DetectedLanguage + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -614,6 +761,17 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword detected_language: Required. Detected Language. + :paramtype detected_language: ~azure.ai.textanalytics.v3_1.models.DetectedLanguage + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(DocumentLanguage, self).__init__(**kwargs) self.id = kwargs['id'] self.detected_language = kwargs['detected_language'] @@ -626,15 +784,15 @@ class DocumentLinkedEntities(msrest.serialization.Model): 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.models.LinkedEntity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized well known entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_1.models.LinkedEntity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -654,6 +812,17 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized well known entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_1.models.LinkedEntity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(DocumentLinkedEntities, self).__init__(**kwargs) self.id = kwargs['id'] self.entities = kwargs['entities'] @@ -666,21 +835,22 @@ class DocumentSentiment(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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.models.DocumentSentimentValue - :param statistics: if showStats=true was specified in the request this field will contain + :vartype sentiment: str or ~azure.ai.textanalytics.v3_1.models.DocumentSentimentValue + :ivar 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.models.DocumentStatistics - :param confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + :ivar confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 for each sentiment class. - :type confidence_scores: ~azure.ai.textanalytics.v3_1.models.SentimentConfidenceScorePerLabel - :param sentences: Required. Sentence level sentiment analysis. - :type sentences: list[~azure.ai.textanalytics.v3_1.models.SentenceSentiment] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :vartype confidence_scores: + ~azure.ai.textanalytics.v3_1.models.SentimentConfidenceScorePerLabel + :ivar sentences: Required. Sentence level sentiment analysis. + :vartype sentences: list[~azure.ai.textanalytics.v3_1.models.SentenceSentiment] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] """ _validation = { @@ -704,6 +874,24 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword sentiment: Required. Predicted sentiment for document (Negative, Neutral, Positive, or + Mixed). Possible values include: "positive", "neutral", "negative", "mixed". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_1.models.DocumentSentimentValue + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + :keyword confidence_scores: Required. Document level sentiment confidence scores between 0 and + 1 for each sentiment class. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_1.models.SentimentConfidenceScorePerLabel + :keyword sentences: Required. Sentence level sentiment analysis. + :paramtype sentences: list[~azure.ai.textanalytics.v3_1.models.SentenceSentiment] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + """ super(DocumentSentiment, self).__init__(**kwargs) self.id = kwargs['id'] self.sentiment = kwargs['sentiment'] @@ -718,10 +906,10 @@ class DocumentStatistics(msrest.serialization.Model): 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 + :ivar characters_count: Required. Number of text elements recognized in the document. + :vartype characters_count: int + :ivar transactions_count: Required. Number of transactions for the document. + :vartype transactions_count: int """ _validation = { @@ -738,6 +926,12 @@ def __init__( self, **kwargs ): + """ + :keyword characters_count: Required. Number of text elements recognized in the document. + :paramtype characters_count: int + :keyword transactions_count: Required. Number of transactions for the document. + :paramtype transactions_count: int + """ super(DocumentStatistics, self).__init__(**kwargs) self.characters_count = kwargs['characters_count'] self.transactions_count = kwargs['transactions_count'] @@ -748,15 +942,15 @@ class EntitiesResult(msrest.serialization.Model): 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.models.DocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -776,6 +970,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntitiesResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -786,10 +991,10 @@ def __init__( class EntitiesTask(msrest.serialization.Model): """EntitiesTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1.models.EntitiesTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_1.models.EntitiesTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -801,6 +1006,12 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_1.models.EntitiesTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(EntitiesTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -809,13 +1020,13 @@ def __init__( class EntitiesTaskParameters(msrest.serialization.Model): """EntitiesTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + :vartype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType """ _attribute_map = { @@ -828,6 +1039,15 @@ def __init__( self, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + """ super(EntitiesTaskParameters, self).__init__(**kwargs) self.model_version = kwargs.get('model_version', "latest") self.logging_opt_out = kwargs.get('logging_opt_out', False) @@ -837,8 +1057,8 @@ def __init__( class EntitiesTaskResult(msrest.serialization.Model): """EntitiesTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult """ _attribute_map = { @@ -849,6 +1069,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult + """ super(EntitiesTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -858,20 +1082,20 @@ class Entity(msrest.serialization.Model): 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' + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Entity type. + :vartype category: str + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -895,6 +1119,22 @@ def __init__( self, **kwargs ): + """ + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Entity type. + :paramtype category: str + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(Entity, self).__init__(**kwargs) self.text = kwargs['text'] self.category = kwargs['category'] @@ -909,15 +1149,15 @@ class EntityLinkingResult(msrest.serialization.Model): 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.models.DocumentLinkedEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentLinkedEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -937,6 +1177,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentLinkedEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntityLinkingResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -947,10 +1198,10 @@ def __init__( class EntityLinkingTask(msrest.serialization.Model): """EntityLinkingTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1.models.EntityLinkingTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_1.models.EntityLinkingTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -962,6 +1213,12 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_1.models.EntityLinkingTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(EntityLinkingTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -970,13 +1227,13 @@ def __init__( class EntityLinkingTaskParameters(msrest.serialization.Model): """EntityLinkingTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + :vartype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType """ _attribute_map = { @@ -989,6 +1246,15 @@ def __init__( self, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + """ super(EntityLinkingTaskParameters, self).__init__(**kwargs) self.model_version = kwargs.get('model_version', "latest") self.logging_opt_out = kwargs.get('logging_opt_out', False) @@ -998,8 +1264,8 @@ def __init__( class EntityLinkingTaskResult(msrest.serialization.Model): """EntityLinkingTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult """ _attribute_map = { @@ -1010,6 +1276,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult + """ super(EntityLinkingTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -1019,8 +1289,8 @@ class ErrorResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param error: Required. Document Error. - :type error: ~azure.ai.textanalytics.v3_1.models.TextAnalyticsError + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_1.models.TextAnalyticsError """ _validation = { @@ -1035,6 +1305,10 @@ def __init__( self, **kwargs ): + """ + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_1.models.TextAnalyticsError + """ super(ErrorResponse, self).__init__(**kwargs) self.error = kwargs['error'] @@ -1042,15 +1316,15 @@ def __init__( class HealthcareAssertion(msrest.serialization.Model): """HealthcareAssertion. - :param conditionality: Describes any conditionality on the entity. Possible values include: + :ivar conditionality: Describes any conditionality on the entity. Possible values include: "hypothetical", "conditional". - :type conditionality: str or ~azure.ai.textanalytics.v3_1.models.Conditionality - :param certainty: Describes the entities certainty and polarity. Possible values include: + :vartype conditionality: str or ~azure.ai.textanalytics.v3_1.models.Conditionality + :ivar certainty: Describes the entities certainty and polarity. Possible values include: "positive", "positivePossible", "neutralPossible", "negativePossible", "negative". - :type certainty: str or ~azure.ai.textanalytics.v3_1.models.Certainty - :param association: Describes if the entity is the subject of the text or if it describes + :vartype certainty: str or ~azure.ai.textanalytics.v3_1.models.Certainty + :ivar association: Describes if the entity is the subject of the text or if it describes someone else. Possible values include: "subject", "other". - :type association: str or ~azure.ai.textanalytics.v3_1.models.Association + :vartype association: str or ~azure.ai.textanalytics.v3_1.models.Association """ _attribute_map = { @@ -1063,6 +1337,17 @@ def __init__( self, **kwargs ): + """ + :keyword conditionality: Describes any conditionality on the entity. Possible values include: + "hypothetical", "conditional". + :paramtype conditionality: str or ~azure.ai.textanalytics.v3_1.models.Conditionality + :keyword certainty: Describes the entities certainty and polarity. Possible values include: + "positive", "positivePossible", "neutralPossible", "negativePossible", "negative". + :paramtype certainty: str or ~azure.ai.textanalytics.v3_1.models.Certainty + :keyword association: Describes if the entity is the subject of the text or if it describes + someone else. Possible values include: "subject", "other". + :paramtype association: str or ~azure.ai.textanalytics.v3_1.models.Association + """ super(HealthcareAssertion, self).__init__(**kwargs) self.conditionality = kwargs.get('conditionality', None) self.certainty = kwargs.get('certainty', None) @@ -1072,13 +1357,13 @@ def __init__( class HealthcareLinkingProperties(msrest.serialization.Model): """HealthcareLinkingProperties. - :param assertion: - :type assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion - :param name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + :ivar assertion: + :vartype assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion + :ivar name: Preferred name for the entity. Example: 'histologically' would have a 'name' of 'histologic'. - :type name: str - :param links: Entity references in known data sources. - :type links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] + :vartype name: str + :ivar links: Entity references in known data sources. + :vartype links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] """ _attribute_map = { @@ -1091,6 +1376,15 @@ def __init__( self, **kwargs ): + """ + :keyword assertion: + :paramtype assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion + :keyword name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + 'histologic'. + :paramtype name: str + :keyword links: Entity references in known data sources. + :paramtype links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] + """ super(HealthcareLinkingProperties, self).__init__(**kwargs) self.assertion = kwargs.get('assertion', None) self.name = kwargs.get('name', None) @@ -1102,25 +1396,25 @@ class HealthcareEntityProperties(msrest.serialization.Model): 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. Healthcare Entity Category. Possible values include: + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Healthcare Entity Category. Possible values include: "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". - :type category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' + :vartype category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -1144,6 +1438,27 @@ def __init__( self, **kwargs ): + """ + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Healthcare Entity Category. Possible values include: + "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", + "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", + "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", + "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", + "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". + :paramtype category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(HealthcareEntityProperties, self).__init__(**kwargs) self.text = kwargs['text'] self.category = kwargs['category'] @@ -1158,32 +1473,32 @@ class HealthcareEntity(HealthcareEntityProperties, HealthcareLinkingProperties): All required parameters must be populated in order to send to Azure. - :param assertion: - :type assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion - :param name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + :ivar assertion: + :vartype assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion + :ivar name: Preferred name for the entity. Example: 'histologically' would have a 'name' of 'histologic'. - :type name: str - :param links: Entity references in known data sources. - :type links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] - :param text: Required. Entity text as appears in the request. - :type text: str - :param category: Required. Healthcare Entity Category. Possible values include: + :vartype name: str + :ivar links: Entity references in known data sources. + :vartype links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Healthcare Entity Category. Possible values include: "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". - :type category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' + :vartype category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -1210,6 +1525,34 @@ def __init__( self, **kwargs ): + """ + :keyword assertion: + :paramtype assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion + :keyword name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + 'histologic'. + :paramtype name: str + :keyword links: Entity references in known data sources. + :paramtype links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Healthcare Entity Category. Possible values include: + "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", + "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", + "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", + "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", + "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". + :paramtype category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(HealthcareEntity, self).__init__(**kwargs) self.assertion = kwargs.get('assertion', None) self.name = kwargs.get('name', None) @@ -1227,10 +1570,10 @@ class HealthcareEntityLink(msrest.serialization.Model): 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 + :ivar data_source: Required. Entity Catalog. Examples include: UMLS, CHV, MSH, etc. + :vartype data_source: str + :ivar id: Required. Entity id in the given source catalog. + :vartype id: str """ _validation = { @@ -1247,6 +1590,12 @@ def __init__( self, **kwargs ): + """ + :keyword data_source: Required. Entity Catalog. Examples include: UMLS, CHV, MSH, etc. + :paramtype data_source: str + :keyword id: Required. Entity id in the given source catalog. + :paramtype id: str + """ super(HealthcareEntityLink, self).__init__(**kwargs) self.data_source = kwargs['data_source'] self.id = kwargs['id'] @@ -1255,10 +1604,10 @@ def __init__( class HealthcareTaskResult(msrest.serialization.Model): """HealthcareTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] """ _attribute_map = { @@ -1270,6 +1619,12 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + """ super(HealthcareTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.errors = kwargs.get('errors', None) @@ -1280,23 +1635,23 @@ class HealthcareJobState(JobMetadata, Pagination, HealthcareTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] - :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", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :ivar next_link: + :vartype next_link: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -1321,6 +1676,25 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :keyword next_link: + :paramtype next_link: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(HealthcareJobState, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.errors = kwargs.get('errors', None) @@ -1345,16 +1719,16 @@ class HealthcareRelation(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or + :ivar relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or 'FrequencyOfMedication', etc. Possible values include: "Abbreviation", "DirectionOfBodyStructure", "DirectionOfCondition", "DirectionOfExamination", "DirectionOfTreatment", "DosageOfMedication", "FormOfMedication", "FrequencyOfMedication", "FrequencyOfTreatment", "QualifierOfCondition", "RelationOfExamination", "RouteOfMedication", "TimeOfCondition", "TimeOfEvent", "TimeOfExamination", "TimeOfMedication", "TimeOfTreatment", "UnitOfCondition", "UnitOfExamination", "ValueOfCondition", "ValueOfExamination". - :type relation_type: str or ~azure.ai.textanalytics.v3_1.models.RelationType - :param entities: Required. The entities in the relation. - :type entities: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelationEntity] + :vartype relation_type: str or ~azure.ai.textanalytics.v3_1.models.RelationType + :ivar entities: Required. The entities in the relation. + :vartype entities: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelationEntity] """ _validation = { @@ -1371,6 +1745,18 @@ def __init__( self, **kwargs ): + """ + :keyword relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or + 'FrequencyOfMedication', etc. Possible values include: "Abbreviation", + "DirectionOfBodyStructure", "DirectionOfCondition", "DirectionOfExamination", + "DirectionOfTreatment", "DosageOfMedication", "FormOfMedication", "FrequencyOfMedication", + "FrequencyOfTreatment", "QualifierOfCondition", "RelationOfExamination", "RouteOfMedication", + "TimeOfCondition", "TimeOfEvent", "TimeOfExamination", "TimeOfMedication", "TimeOfTreatment", + "UnitOfCondition", "UnitOfExamination", "ValueOfCondition", "ValueOfExamination". + :paramtype relation_type: str or ~azure.ai.textanalytics.v3_1.models.RelationType + :keyword entities: Required. The entities in the relation. + :paramtype entities: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelationEntity] + """ super(HealthcareRelation, self).__init__(**kwargs) self.relation_type = kwargs['relation_type'] self.entities = kwargs['entities'] @@ -1381,13 +1767,13 @@ class HealthcareRelationEntity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment + :ivar ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment Identifier Representation), pointing to the entity . - :type ref: str - :param role: Required. Role of entity in the relationship. For example: 'CD20-positive diffuse + :vartype ref: str + :ivar role: Required. Role of entity in the relationship. For example: 'CD20-positive diffuse large B-cell lymphoma' has the following entities with their roles in parenthesis: CD20 (GeneOrProtein), Positive (Expression), diffuse large B-cell lymphoma (Diagnosis). - :type role: str + :vartype role: str """ _validation = { @@ -1404,6 +1790,15 @@ def __init__( self, **kwargs ): + """ + :keyword ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment + Identifier Representation), pointing to the entity . + :paramtype ref: str + :keyword role: Required. Role of entity in the relationship. For example: 'CD20-positive + diffuse large B-cell lymphoma' has the following entities with their roles in parenthesis: + CD20 (GeneOrProtein), Positive (Expression), diffuse large B-cell lymphoma (Diagnosis). + :paramtype role: str + """ super(HealthcareRelationEntity, self).__init__(**kwargs) self.ref = kwargs['ref'] self.role = kwargs['role'] @@ -1414,15 +1809,15 @@ class HealthcareResult(msrest.serialization.Model): 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.models.DocumentHealthcareEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentHealthcareEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1442,6 +1837,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentHealthcareEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(HealthcareResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -1454,19 +1860,19 @@ class InnerError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "InvalidParameterValue", + :ivar 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.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.models.InnerError + :vartype code: str or ~azure.ai.textanalytics.v3_1.models.InnerErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar details: Error details. + :vartype details: dict[str, str] + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_1.models.InnerError """ _validation = { @@ -1486,6 +1892,21 @@ def __init__( self, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "InvalidParameterValue", + "InvalidRequestBodyFormat", "EmptyRequest", "MissingInputRecords", "InvalidDocument", + "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", + "InvalidCountryHint". + :paramtype code: str or ~azure.ai.textanalytics.v3_1.models.InnerErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword details: Error details. + :paramtype details: dict[str, str] + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_1.models.InnerError + """ super(InnerError, self).__init__(**kwargs) self.code = kwargs['code'] self.message = kwargs['message'] @@ -1497,16 +1918,17 @@ def __init__( 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.models.EntitiesTask] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_1.models.PiiTask] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: list[~azure.ai.textanalytics.v3_1.models.KeyPhrasesTask] - :param entity_linking_tasks: - :type entity_linking_tasks: list[~azure.ai.textanalytics.v3_1.models.EntityLinkingTask] - :param sentiment_analysis_tasks: - :type sentiment_analysis_tasks: list[~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTask] + :ivar entity_recognition_tasks: + :vartype entity_recognition_tasks: list[~azure.ai.textanalytics.v3_1.models.EntitiesTask] + :ivar entity_recognition_pii_tasks: + :vartype entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_1.models.PiiTask] + :ivar key_phrase_extraction_tasks: + :vartype key_phrase_extraction_tasks: list[~azure.ai.textanalytics.v3_1.models.KeyPhrasesTask] + :ivar entity_linking_tasks: + :vartype entity_linking_tasks: list[~azure.ai.textanalytics.v3_1.models.EntityLinkingTask] + :ivar sentiment_analysis_tasks: + :vartype sentiment_analysis_tasks: + list[~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTask] """ _attribute_map = { @@ -1521,6 +1943,20 @@ def __init__( self, **kwargs ): + """ + :keyword entity_recognition_tasks: + :paramtype entity_recognition_tasks: list[~azure.ai.textanalytics.v3_1.models.EntitiesTask] + :keyword entity_recognition_pii_tasks: + :paramtype entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_1.models.PiiTask] + :keyword key_phrase_extraction_tasks: + :paramtype key_phrase_extraction_tasks: + list[~azure.ai.textanalytics.v3_1.models.KeyPhrasesTask] + :keyword entity_linking_tasks: + :paramtype entity_linking_tasks: list[~azure.ai.textanalytics.v3_1.models.EntityLinkingTask] + :keyword sentiment_analysis_tasks: + :paramtype sentiment_analysis_tasks: + list[~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTask] + """ 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) @@ -1534,15 +1970,15 @@ class KeyPhraseResult(msrest.serialization.Model): 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.models.DocumentKeyPhrases] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentKeyPhrases] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1562,6 +1998,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentKeyPhrases] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(KeyPhraseResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -1572,10 +2019,10 @@ def __init__( class KeyPhrasesTask(msrest.serialization.Model): """KeyPhrasesTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1.models.KeyPhrasesTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_1.models.KeyPhrasesTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -1587,6 +2034,12 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_1.models.KeyPhrasesTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(KeyPhrasesTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -1595,10 +2048,10 @@ def __init__( class KeyPhrasesTaskParameters(msrest.serialization.Model): """KeyPhrasesTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool """ _attribute_map = { @@ -1610,6 +2063,12 @@ def __init__( self, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + """ super(KeyPhrasesTaskParameters, self).__init__(**kwargs) self.model_version = kwargs.get('model_version', "latest") self.logging_opt_out = kwargs.get('logging_opt_out', False) @@ -1618,8 +2077,8 @@ def __init__( class KeyPhraseTaskResult(msrest.serialization.Model): """KeyPhraseTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult """ _attribute_map = { @@ -1630,6 +2089,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult + """ super(KeyPhraseTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -1639,8 +2102,8 @@ class LanguageBatchInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param documents: Required. - :type documents: list[~azure.ai.textanalytics.v3_1.models.LanguageInput] + :ivar documents: Required. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.LanguageInput] """ _validation = { @@ -1655,6 +2118,10 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.LanguageInput] + """ super(LanguageBatchInput, self).__init__(**kwargs) self.documents = kwargs['documents'] @@ -1664,12 +2131,12 @@ class LanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. + :vartype text: str + :ivar country_hint: + :vartype country_hint: str """ _validation = { @@ -1687,6 +2154,14 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. + :paramtype text: str + :keyword country_hint: + :paramtype country_hint: str + """ super(LanguageInput, self).__init__(**kwargs) self.id = kwargs['id'] self.text = kwargs['text'] @@ -1698,15 +2173,15 @@ class LanguageResult(msrest.serialization.Model): 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.models.DocumentLanguage] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentLanguage] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1726,6 +2201,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentLanguage] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(LanguageResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -1738,21 +2224,20 @@ class LinkedEntity(msrest.serialization.Model): 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.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 + :ivar name: Required. Entity Linking formal name. + :vartype name: str + :ivar matches: Required. List of instances this entity appears in the text. + :vartype matches: list[~azure.ai.textanalytics.v3_1.models.Match] + :ivar language: Required. Language used in the data source. + :vartype language: str + :ivar id: Unique identifier of the recognized entity from the data source. + :vartype id: str + :ivar url: Required. URL for the entity's page from the data source. + :vartype url: str + :ivar data_source: Required. Data source used to extract entity linking, such as Wiki/Bing etc. + :vartype data_source: str + :ivar bing_id: Bing Entity Search API unique identifier of the recognized entity. + :vartype bing_id: str """ _validation = { @@ -1777,6 +2262,23 @@ def __init__( self, **kwargs ): + """ + :keyword name: Required. Entity Linking formal name. + :paramtype name: str + :keyword matches: Required. List of instances this entity appears in the text. + :paramtype matches: list[~azure.ai.textanalytics.v3_1.models.Match] + :keyword language: Required. Language used in the data source. + :paramtype language: str + :keyword id: Unique identifier of the recognized entity from the data source. + :paramtype id: str + :keyword url: Required. URL for the entity's page from the data source. + :paramtype url: str + :keyword data_source: Required. Data source used to extract entity linking, such as Wiki/Bing + etc. + :paramtype data_source: str + :keyword bing_id: Bing Entity Search API unique identifier of the recognized entity. + :paramtype bing_id: str + """ super(LinkedEntity, self).__init__(**kwargs) self.name = kwargs['name'] self.matches = kwargs['matches'] @@ -1792,15 +2294,15 @@ class Match(msrest.serialization.Model): 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 + :ivar confidence_score: Required. If a well known item is recognized, a decimal number denoting + the confidence level between 0 and 1 will be returned. + :vartype confidence_score: float + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar offset: Required. Start position for the entity match text. + :vartype offset: int + :ivar length: Required. Length for the entity match text. + :vartype length: int """ _validation = { @@ -1821,6 +2323,17 @@ def __init__( self, **kwargs ): + """ + :keyword confidence_score: Required. If a well known item is recognized, a decimal number + denoting the confidence level between 0 and 1 will be returned. + :paramtype confidence_score: float + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword offset: Required. Start position for the entity match text. + :paramtype offset: int + :keyword length: Required. Length for the entity match text. + :paramtype length: int + """ super(Match, self).__init__(**kwargs) self.confidence_score = kwargs['confidence_score'] self.text = kwargs['text'] @@ -1833,8 +2346,8 @@ class MultiLanguageBatchInput(msrest.serialization.Model): 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.models.MultiLanguageInput] + :ivar documents: Required. The set of documents to process as part of this batch. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.MultiLanguageInput] """ _validation = { @@ -1849,6 +2362,10 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. The set of documents to process as part of this batch. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.MultiLanguageInput] + """ super(MultiLanguageBatchInput, self).__init__(**kwargs) self.documents = kwargs['documents'] @@ -1858,14 +2375,14 @@ class MultiLanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. A unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. The input text to process. + :vartype text: str + :ivar 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 + :vartype language: str """ _validation = { @@ -1883,6 +2400,16 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. A unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. The input text to process. + :paramtype text: str + :keyword 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. + :paramtype language: str + """ super(MultiLanguageInput, self).__init__(**kwargs) self.id = kwargs['id'] self.text = kwargs['text'] @@ -1894,17 +2421,17 @@ class PiiDocumentEntities(msrest.serialization.Model): 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.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar redacted_text: Required. Returns redacted text. + :vartype redacted_text: str + :ivar entities: Required. Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_1.models.Entity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -1926,6 +2453,19 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword redacted_text: Required. Returns redacted text. + :paramtype redacted_text: str + :keyword entities: Required. Recognized entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_1.models.Entity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(PiiDocumentEntities, self).__init__(**kwargs) self.id = kwargs['id'] self.redacted_text = kwargs['redacted_text'] @@ -1939,15 +2479,15 @@ class PiiResult(msrest.serialization.Model): 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.models.PiiDocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.PiiDocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1967,6 +2507,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.PiiDocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(PiiResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -1977,10 +2528,10 @@ def __init__( class PiiTask(msrest.serialization.Model): """PiiTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1.models.PiiTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_1.models.PiiTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -1992,6 +2543,12 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_1.models.PiiTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(PiiTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -2000,17 +2557,17 @@ def __init__( 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.models.PiiTaskParametersDomain - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param pii_categories: (Optional) describes the PII categories to return. - :type pii_categories: list[str or ~azure.ai.textanalytics.v3_1.models.PiiCategory] - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar domain: Possible values include: "phi", "none". Default value: "none". + :vartype domain: str or ~azure.ai.textanalytics.v3_1.models.PiiTaskParametersDomain + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar pii_categories: (Optional) describes the PII categories to return. + :vartype pii_categories: list[str or ~azure.ai.textanalytics.v3_1.models.PiiCategory] + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + :vartype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType """ _validation = { @@ -2029,6 +2586,19 @@ def __init__( self, **kwargs ): + """ + :keyword domain: Possible values include: "phi", "none". Default value: "none". + :paramtype domain: str or ~azure.ai.textanalytics.v3_1.models.PiiTaskParametersDomain + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword pii_categories: (Optional) describes the PII categories to return. + :paramtype pii_categories: list[str or ~azure.ai.textanalytics.v3_1.models.PiiCategory] + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + """ super(PiiTaskParameters, self).__init__(**kwargs) self.domain = kwargs.get('domain', "none") self.model_version = kwargs.get('model_version', "latest") @@ -2040,8 +2610,8 @@ def __init__( class PiiTaskResult(msrest.serialization.Model): """PiiTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.PiiResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.PiiResult """ _attribute_map = { @@ -2052,6 +2622,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.PiiResult + """ super(PiiTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -2061,16 +2635,16 @@ class RequestStatistics(msrest.serialization.Model): 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, + :ivar documents_count: Required. Number of documents submitted in the request. + :vartype documents_count: int + :ivar 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, + :vartype valid_documents_count: int + :ivar 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 + :vartype erroneous_documents_count: int + :ivar transactions_count: Required. Number of transactions for the request. + :vartype transactions_count: long """ _validation = { @@ -2091,6 +2665,18 @@ def __init__( self, **kwargs ): + """ + :keyword documents_count: Required. Number of documents submitted in the request. + :paramtype documents_count: int + :keyword valid_documents_count: Required. Number of valid documents. This excludes empty, + over-size limit or non-supported languages documents. + :paramtype valid_documents_count: int + :keyword erroneous_documents_count: Required. Number of invalid documents. This includes empty, + over-size limit or non-supported languages documents. + :paramtype erroneous_documents_count: int + :keyword transactions_count: Required. Number of transactions for the request. + :paramtype transactions_count: long + """ super(RequestStatistics, self).__init__(**kwargs) self.documents_count = kwargs['documents_count'] self.valid_documents_count = kwargs['valid_documents_count'] @@ -2103,19 +2689,19 @@ class SentenceAssessment(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param sentiment: Required. Assessment sentiment in the sentence. Possible values include: + :ivar sentiment: Required. Assessment sentiment in the sentence. Possible values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue - :param confidence_scores: Required. Assessment sentiment confidence scores in the sentence. - :type confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel - :param offset: Required. The assessment offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the assessment. - :type length: int - :param text: Required. The assessment text detected. - :type text: str - :param is_negated: Required. The indicator representing if the assessment is negated. - :type is_negated: bool + :vartype sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue + :ivar confidence_scores: Required. Assessment sentiment confidence scores in the sentence. + :vartype confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel + :ivar offset: Required. The assessment offset from the start of the sentence. + :vartype offset: int + :ivar length: Required. The length of the assessment. + :vartype length: int + :ivar text: Required. The assessment text detected. + :vartype text: str + :ivar is_negated: Required. The indicator representing if the assessment is negated. + :vartype is_negated: bool """ _validation = { @@ -2140,6 +2726,21 @@ def __init__( self, **kwargs ): + """ + :keyword sentiment: Required. Assessment sentiment in the sentence. Possible values include: + "positive", "mixed", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue + :keyword confidence_scores: Required. Assessment sentiment confidence scores in the sentence. + :paramtype confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel + :keyword offset: Required. The assessment offset from the start of the sentence. + :paramtype offset: int + :keyword length: Required. The length of the assessment. + :paramtype length: int + :keyword text: Required. The assessment text detected. + :paramtype text: str + :keyword is_negated: Required. The indicator representing if the assessment is negated. + :paramtype is_negated: bool + """ super(SentenceAssessment, self).__init__(**kwargs) self.sentiment = kwargs['sentiment'] self.confidence_scores = kwargs['confidence_scores'] @@ -2154,22 +2755,23 @@ class SentenceSentiment(msrest.serialization.Model): 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: + :ivar text: Required. The sentence text. + :vartype text: str + :ivar sentiment: Required. The predicted Sentiment for the sentence. Possible values include: "positive", "neutral", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1.models.SentenceSentimentValue - :param confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + :vartype sentiment: str or ~azure.ai.textanalytics.v3_1.models.SentenceSentimentValue + :ivar 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.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 targets: The array of sentence targets for the sentence. - :type targets: list[~azure.ai.textanalytics.v3_1.models.SentenceTarget] - :param assessments: The array of assessments for the sentence. - :type assessments: list[~azure.ai.textanalytics.v3_1.models.SentenceAssessment] + :vartype confidence_scores: + ~azure.ai.textanalytics.v3_1.models.SentimentConfidenceScorePerLabel + :ivar offset: Required. The sentence offset from the start of the document. + :vartype offset: int + :ivar length: Required. The length of the sentence. + :vartype length: int + :ivar targets: The array of sentence targets for the sentence. + :vartype targets: list[~azure.ai.textanalytics.v3_1.models.SentenceTarget] + :ivar assessments: The array of assessments for the sentence. + :vartype assessments: list[~azure.ai.textanalytics.v3_1.models.SentenceAssessment] """ _validation = { @@ -2194,6 +2796,25 @@ def __init__( self, **kwargs ): + """ + :keyword text: Required. The sentence text. + :paramtype text: str + :keyword sentiment: Required. The predicted Sentiment for the sentence. Possible values + include: "positive", "neutral", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_1.models.SentenceSentimentValue + :keyword confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + sentence for all classes. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_1.models.SentimentConfidenceScorePerLabel + :keyword offset: Required. The sentence offset from the start of the document. + :paramtype offset: int + :keyword length: Required. The length of the sentence. + :paramtype length: int + :keyword targets: The array of sentence targets for the sentence. + :paramtype targets: list[~azure.ai.textanalytics.v3_1.models.SentenceTarget] + :keyword assessments: The array of assessments for the sentence. + :paramtype assessments: list[~azure.ai.textanalytics.v3_1.models.SentenceAssessment] + """ super(SentenceSentiment, self).__init__(**kwargs) self.text = kwargs['text'] self.sentiment = kwargs['sentiment'] @@ -2209,21 +2830,21 @@ class SentenceTarget(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param sentiment: Required. Targeted sentiment in the sentence. Possible values include: + :ivar sentiment: Required. Targeted sentiment in the sentence. Possible values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue - :param confidence_scores: Required. Target sentiment confidence scores for the target in the + :vartype sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue + :ivar confidence_scores: Required. Target sentiment confidence scores for the target in the sentence. - :type confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel - :param offset: Required. The target offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the target. - :type length: int - :param text: Required. The target text detected. - :type text: str - :param relations: Required. The array of either assessment or target objects which is related - to the target. - :type relations: list[~azure.ai.textanalytics.v3_1.models.TargetRelation] + :vartype confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel + :ivar offset: Required. The target offset from the start of the sentence. + :vartype offset: int + :ivar length: Required. The length of the target. + :vartype length: int + :ivar text: Required. The target text detected. + :vartype text: str + :ivar relations: Required. The array of either assessment or target objects which is related to + the target. + :vartype relations: list[~azure.ai.textanalytics.v3_1.models.TargetRelation] """ _validation = { @@ -2248,6 +2869,23 @@ def __init__( self, **kwargs ): + """ + :keyword sentiment: Required. Targeted sentiment in the sentence. Possible values include: + "positive", "mixed", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue + :keyword confidence_scores: Required. Target sentiment confidence scores for the target in the + sentence. + :paramtype confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel + :keyword offset: Required. The target offset from the start of the sentence. + :paramtype offset: int + :keyword length: Required. The length of the target. + :paramtype length: int + :keyword text: Required. The target text detected. + :paramtype text: str + :keyword relations: Required. The array of either assessment or target objects which is related + to the target. + :paramtype relations: list[~azure.ai.textanalytics.v3_1.models.TargetRelation] + """ super(SentenceTarget, self).__init__(**kwargs) self.sentiment = kwargs['sentiment'] self.confidence_scores = kwargs['confidence_scores'] @@ -2260,10 +2898,10 @@ def __init__( class SentimentAnalysisTask(msrest.serialization.Model): """SentimentAnalysisTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -2275,6 +2913,12 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(SentimentAnalysisTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -2283,15 +2927,15 @@ def __init__( class SentimentAnalysisTaskParameters(msrest.serialization.Model): """SentimentAnalysisTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param opinion_mining: - :type opinion_mining: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar opinion_mining: + :vartype opinion_mining: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + :vartype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType """ _attribute_map = { @@ -2305,6 +2949,17 @@ def __init__( self, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword opinion_mining: + :paramtype opinion_mining: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + """ super(SentimentAnalysisTaskParameters, self).__init__(**kwargs) self.model_version = kwargs.get('model_version', "latest") self.logging_opt_out = kwargs.get('logging_opt_out', False) @@ -2317,12 +2972,12 @@ class SentimentConfidenceScorePerLabel(msrest.serialization.Model): 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 + :ivar positive: Required. + :vartype positive: float + :ivar neutral: Required. + :vartype neutral: float + :ivar negative: Required. + :vartype negative: float """ _validation = { @@ -2341,6 +2996,14 @@ def __init__( self, **kwargs ): + """ + :keyword positive: Required. + :paramtype positive: float + :keyword neutral: Required. + :paramtype neutral: float + :keyword negative: Required. + :paramtype negative: float + """ super(SentimentConfidenceScorePerLabel, self).__init__(**kwargs) self.positive = kwargs['positive'] self.neutral = kwargs['neutral'] @@ -2352,15 +3015,15 @@ class SentimentResponse(msrest.serialization.Model): 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.models.DocumentSentiment] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Sentiment analysis per document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentSentiment] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2380,6 +3043,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Sentiment analysis per document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentSentiment] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(SentimentResponse, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -2390,8 +3064,8 @@ def __init__( class SentimentTaskResult(msrest.serialization.Model): """SentimentTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse """ _attribute_map = { @@ -2402,6 +3076,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse + """ super(SentimentTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -2411,10 +3089,10 @@ class TargetConfidenceScoreLabel(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param positive: Required. - :type positive: float - :param negative: Required. - :type negative: float + :ivar positive: Required. + :vartype positive: float + :ivar negative: Required. + :vartype negative: float """ _validation = { @@ -2431,6 +3109,12 @@ def __init__( self, **kwargs ): + """ + :keyword positive: Required. + :paramtype positive: float + :keyword negative: Required. + :paramtype negative: float + """ super(TargetConfidenceScoreLabel, self).__init__(**kwargs) self.positive = kwargs['positive'] self.negative = kwargs['negative'] @@ -2441,11 +3125,11 @@ class TargetRelation(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param relation_type: Required. The type related to the target. Possible values include: + :ivar relation_type: Required. The type related to the target. Possible values include: "assessment", "target". - :type relation_type: str or ~azure.ai.textanalytics.v3_1.models.TargetRelationType - :param ref: Required. The JSON pointer indicating the linked object. - :type ref: str + :vartype relation_type: str or ~azure.ai.textanalytics.v3_1.models.TargetRelationType + :ivar ref: Required. The JSON pointer indicating the linked object. + :vartype ref: str """ _validation = { @@ -2462,6 +3146,13 @@ def __init__( self, **kwargs ): + """ + :keyword relation_type: Required. The type related to the target. Possible values include: + "assessment", "target". + :paramtype relation_type: str or ~azure.ai.textanalytics.v3_1.models.TargetRelationType + :keyword ref: Required. The JSON pointer indicating the linked object. + :paramtype ref: str + """ super(TargetRelation, self).__init__(**kwargs) self.relation_type = kwargs['relation_type'] self.ref = kwargs['ref'] @@ -2472,28 +3163,28 @@ class TasksStateTasks(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :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: + :ivar completed: Required. + :vartype completed: int + :ivar failed: Required. + :vartype failed: int + :ivar in_progress: Required. + :vartype in_progress: int + :ivar total: Required. + :vartype total: int + :ivar entity_recognition_tasks: + :vartype entity_recognition_tasks: list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityRecognitionTasksItem] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: + :ivar entity_recognition_pii_tasks: + :vartype entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityRecognitionPiiTasksItem] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: + :ivar key_phrase_extraction_tasks: + :vartype key_phrase_extraction_tasks: list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksKeyPhraseExtractionTasksItem] - :param entity_linking_tasks: - :type entity_linking_tasks: + :ivar entity_linking_tasks: + :vartype entity_linking_tasks: list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityLinkingTasksItem] - :param sentiment_analysis_tasks: - :type sentiment_analysis_tasks: + :ivar sentiment_analysis_tasks: + :vartype sentiment_analysis_tasks: list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksSentimentAnalysisTasksItem] """ @@ -2520,6 +3211,31 @@ def __init__( self, **kwargs ): + """ + :keyword completed: Required. + :paramtype completed: int + :keyword failed: Required. + :paramtype failed: int + :keyword in_progress: Required. + :paramtype in_progress: int + :keyword total: Required. + :paramtype total: int + :keyword entity_recognition_tasks: + :paramtype entity_recognition_tasks: + list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityRecognitionTasksItem] + :keyword entity_recognition_pii_tasks: + :paramtype entity_recognition_pii_tasks: + list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityRecognitionPiiTasksItem] + :keyword key_phrase_extraction_tasks: + :paramtype key_phrase_extraction_tasks: + list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksKeyPhraseExtractionTasksItem] + :keyword entity_linking_tasks: + :paramtype entity_linking_tasks: + list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityLinkingTasksItem] + :keyword sentiment_analysis_tasks: + :paramtype sentiment_analysis_tasks: + list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksSentimentAnalysisTasksItem] + """ super(TasksStateTasks, self).__init__(**kwargs) self.completed = kwargs['completed'] self.failed = kwargs['failed'] @@ -2537,13 +3253,13 @@ class TaskState(msrest.serialization.Model): 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 task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -2562,6 +3278,15 @@ def __init__( self, **kwargs ): + """ + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TaskState, self).__init__(**kwargs) self.last_update_date_time = kwargs['last_update_date_time'] self.task_name = kwargs['task_name'] @@ -2573,15 +3298,15 @@ class TasksStateTasksEntityLinkingTasksItem(TaskState, EntityLinkingTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -2601,6 +3326,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TasksStateTasksEntityLinkingTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -2613,15 +3349,15 @@ class TasksStateTasksEntityRecognitionPiiTasksItem(TaskState, PiiTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.PiiResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.PiiResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -2641,6 +3377,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.PiiResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TasksStateTasksEntityRecognitionPiiTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -2653,15 +3400,15 @@ class TasksStateTasksEntityRecognitionTasksItem(TaskState, EntitiesTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -2681,6 +3428,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TasksStateTasksEntityRecognitionTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -2693,15 +3451,15 @@ class TasksStateTasksKeyPhraseExtractionTasksItem(TaskState, KeyPhraseTaskResult All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -2721,6 +3479,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TasksStateTasksKeyPhraseExtractionTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -2733,15 +3502,15 @@ class TasksStateTasksSentimentAnalysisTasksItem(TaskState, SentimentTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -2761,6 +3530,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TasksStateTasksSentimentAnalysisTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -2773,17 +3553,17 @@ class TextAnalyticsError(msrest.serialization.Model): 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.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.models.InnerError - :param details: Details about specific errors that led to this reported error. - :type details: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :ivar code: Required. Error code. Possible values include: "InvalidRequest", "InvalidArgument", + "InternalServerError", "ServiceUnavailable", "NotFound". + :vartype code: str or ~azure.ai.textanalytics.v3_1.models.ErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_1.models.InnerError + :ivar details: Details about specific errors that led to this reported error. + :vartype details: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] """ _validation = { @@ -2803,6 +3583,19 @@ def __init__( self, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "InvalidRequest", + "InvalidArgument", "InternalServerError", "ServiceUnavailable", "NotFound". + :paramtype code: str or ~azure.ai.textanalytics.v3_1.models.ErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_1.models.InnerError + :keyword details: Details about specific errors that led to this reported error. + :paramtype details: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + """ super(TextAnalyticsError, self).__init__(**kwargs) self.code = kwargs['code'] self.message = kwargs['message'] @@ -2816,13 +3609,13 @@ class TextAnalyticsWarning(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "LongWordsInDocument", + :ivar code: Required. Error code. Possible values include: "LongWordsInDocument", "DocumentTruncated". - :type code: str or ~azure.ai.textanalytics.v3_1.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 + :vartype code: str or ~azure.ai.textanalytics.v3_1.models.WarningCodeValue + :ivar message: Required. Warning message. + :vartype message: str + :ivar target_ref: A JSON pointer reference indicating the target object. + :vartype target_ref: str """ _validation = { @@ -2840,6 +3633,15 @@ def __init__( self, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "LongWordsInDocument", + "DocumentTruncated". + :paramtype code: str or ~azure.ai.textanalytics.v3_1.models.WarningCodeValue + :keyword message: Required. Warning message. + :paramtype message: str + :keyword target_ref: A JSON pointer reference indicating the target object. + :paramtype target_ref: str + """ super(TextAnalyticsWarning, self).__init__(**kwargs) self.code = kwargs['code'] self.message = kwargs['message'] diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_models_py3.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_models_py3.py index 956013a60c86..bd19b6e79753 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_models_py3.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_models_py3.py @@ -20,9 +20,9 @@ class AnalysisInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param analysis_input: Required. Contains a set of input documents to be analyzed by the + :ivar analysis_input: Required. Contains a set of input documents to be analyzed by the service. - :type analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput + :vartype analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput """ _validation = { @@ -39,6 +39,11 @@ def __init__( analysis_input: "MultiLanguageBatchInput", **kwargs ): + """ + :keyword analysis_input: Required. Contains a set of input documents to be analyzed by the + service. + :paramtype analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput + """ super(AnalysisInput, self).__init__(**kwargs) self.analysis_input = analysis_input @@ -48,9 +53,9 @@ class JobManifest(msrest.serialization.Model): 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 + :ivar 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.models.JobManifestTasks + :vartype tasks: ~azure.ai.textanalytics.v3_1.models.JobManifestTasks """ _validation = { @@ -67,6 +72,11 @@ def __init__( tasks: "JobManifestTasks", **kwargs ): + """ + :keyword tasks: Required. The set of tasks to execute on the input documents. Cannot specify + the same task more than once. + :paramtype tasks: ~azure.ai.textanalytics.v3_1.models.JobManifestTasks + """ super(JobManifest, self).__init__(**kwargs) self.tasks = tasks @@ -74,8 +84,8 @@ def __init__( class JobDescriptor(msrest.serialization.Model): """JobDescriptor. - :param display_name: Optional display name for the analysis job. - :type display_name: str + :ivar display_name: Optional display name for the analysis job. + :vartype display_name: str """ _attribute_map = { @@ -88,6 +98,10 @@ def __init__( display_name: Optional[str] = None, **kwargs ): + """ + :keyword display_name: Optional display name for the analysis job. + :paramtype display_name: str + """ super(JobDescriptor, self).__init__(**kwargs) self.display_name = display_name @@ -97,14 +111,14 @@ class AnalyzeBatchInput(JobDescriptor, AnalysisInput, 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 + :ivar 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.models.JobManifestTasks - :param analysis_input: Required. Contains a set of input documents to be analyzed by the + :vartype tasks: ~azure.ai.textanalytics.v3_1.models.JobManifestTasks + :ivar analysis_input: Required. Contains a set of input documents to be analyzed by the service. - :type analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput - :param display_name: Optional display name for the analysis job. - :type display_name: str + :vartype analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput + :ivar display_name: Optional display name for the analysis job. + :vartype display_name: str """ _validation = { @@ -126,6 +140,16 @@ def __init__( display_name: Optional[str] = None, **kwargs ): + """ + :keyword tasks: Required. The set of tasks to execute on the input documents. Cannot specify + the same task more than once. + :paramtype tasks: ~azure.ai.textanalytics.v3_1.models.JobManifestTasks + :keyword analysis_input: Required. Contains a set of input documents to be analyzed by the + service. + :paramtype analysis_input: ~azure.ai.textanalytics.v3_1.models.MultiLanguageBatchInput + :keyword display_name: Optional display name for the analysis job. + :paramtype display_name: str + """ super(AnalyzeBatchInput, self).__init__(display_name=display_name, analysis_input=analysis_input, tasks=tasks, **kwargs) self.tasks = tasks self.analysis_input = analysis_input @@ -138,8 +162,8 @@ def __init__( class AnalyzeJobDisplayName(msrest.serialization.Model): """AnalyzeJobDisplayName. - :param display_name: - :type display_name: str + :ivar display_name: + :vartype display_name: str """ _attribute_map = { @@ -152,6 +176,10 @@ def __init__( display_name: Optional[str] = None, **kwargs ): + """ + :keyword display_name: + :paramtype display_name: str + """ super(AnalyzeJobDisplayName, self).__init__(**kwargs) self.display_name = display_name @@ -159,11 +187,11 @@ def __init__( class AnalyzeJobErrorsAndStatistics(msrest.serialization.Model): """AnalyzeJobErrorsAndStatistics. - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :ivar 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.models.RequestStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics """ _attribute_map = { @@ -178,6 +206,13 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + """ super(AnalyzeJobErrorsAndStatistics, self).__init__(**kwargs) self.errors = errors self.statistics = statistics @@ -188,17 +223,17 @@ class JobMetadata(msrest.serialization.Model): 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", + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -226,6 +261,19 @@ def __init__( expiration_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(JobMetadata, self).__init__(**kwargs) self.created_date_time = created_date_time self.expiration_date_time = expiration_date_time @@ -239,19 +287,19 @@ class AnalyzeJobMetadata(JobMetadata, AnalyzeJobDisplayName): All required parameters must be populated in order to send to Azure. - :param display_name: - :type display_name: 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", + :ivar display_name: + :vartype display_name: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -281,6 +329,21 @@ def __init__( expiration_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword display_name: + :paramtype display_name: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ 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, display_name=display_name, **kwargs) self.display_name = display_name self.created_date_time = created_date_time @@ -293,8 +356,8 @@ def __init__( class Pagination(msrest.serialization.Model): """Pagination. - :param next_link: - :type next_link: str + :ivar next_link: + :vartype next_link: str """ _attribute_map = { @@ -307,6 +370,10 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: + :paramtype next_link: str + """ super(Pagination, self).__init__(**kwargs) self.next_link = next_link @@ -316,8 +383,8 @@ class TasksState(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks + :ivar tasks: Required. + :vartype tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks """ _validation = { @@ -334,6 +401,10 @@ def __init__( tasks: "TasksStateTasks", **kwargs ): + """ + :keyword tasks: Required. + :paramtype tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks + """ super(TasksState, self).__init__(**kwargs) self.tasks = tasks @@ -343,28 +414,28 @@ class AnalyzeJobState(AnalyzeJobMetadata, TasksState, AnalyzeJobErrorsAndStatist All required parameters must be populated in order to send to Azure. - :param next_link: - :type next_link: str - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar next_link: + :vartype next_link: str + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :ivar 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.models.RequestStatistics - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks - :param display_name: - :type display_name: 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", + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar tasks: Required. + :vartype tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks + :ivar display_name: + :vartype display_name: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -403,6 +474,30 @@ def __init__( expiration_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword next_link: + :paramtype next_link: str + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword tasks: Required. + :paramtype tasks: ~azure.ai.textanalytics.v3_1.models.TasksStateTasks + :keyword display_name: + :paramtype display_name: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(AnalyzeJobState, self).__init__(display_name=display_name, 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, tasks=tasks, errors=errors, statistics=statistics, next_link=next_link, **kwargs) self.next_link = next_link self.errors = errors @@ -441,14 +536,14 @@ class DetectedLanguage(msrest.serialization.Model): 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 + :ivar name: Required. Long name of a detected language (e.g. English, French). + :vartype name: str + :ivar iso6391_name: Required. A two letter representation of the detected language according to + the ISO 639-1 standard (e.g. en, fr). + :vartype iso6391_name: str + :ivar 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 + :vartype confidence_score: float """ _validation = { @@ -471,6 +566,16 @@ def __init__( confidence_score: float, **kwargs ): + """ + :keyword name: Required. Long name of a detected language (e.g. English, French). + :paramtype name: str + :keyword iso6391_name: Required. A two letter representation of the detected language according + to the ISO 639-1 standard (e.g. en, fr). + :paramtype iso6391_name: str + :keyword confidence_score: Required. A confidence score between 0 and 1. Scores close to 1 + indicate 100% certainty that the identified language is true. + :paramtype confidence_score: float + """ super(DetectedLanguage, self).__init__(**kwargs) self.name = name self.iso6391_name = iso6391_name @@ -482,15 +587,15 @@ class DocumentEntities(msrest.serialization.Model): 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.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_1.models.Entity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -515,6 +620,17 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_1.models.Entity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(DocumentEntities, self).__init__(**kwargs) self.id = id self.entities = entities @@ -527,10 +643,10 @@ class DocumentError(msrest.serialization.Model): 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.models.TextAnalyticsError + :ivar id: Required. Document Id. + :vartype id: str + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_1.models.TextAnalyticsError """ _validation = { @@ -550,6 +666,12 @@ def __init__( error: "TextAnalyticsError", **kwargs ): + """ + :keyword id: Required. Document Id. + :paramtype id: str + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_1.models.TextAnalyticsError + """ super(DocumentError, self).__init__(**kwargs) self.id = id self.error = error @@ -560,17 +682,17 @@ class DocumentHealthcareEntities(msrest.serialization.Model): 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.models.HealthcareEntity] - :param relations: Required. Healthcare entity relations. - :type relations: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelation] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Healthcare entities. + :vartype entities: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntity] + :ivar relations: Required. Healthcare entity relations. + :vartype relations: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelation] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -598,6 +720,19 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Healthcare entities. + :paramtype entities: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntity] + :keyword relations: Required. Healthcare entity relations. + :paramtype relations: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelation] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(DocumentHealthcareEntities, self).__init__(**kwargs) self.id = id self.entities = entities @@ -611,16 +746,16 @@ class DocumentKeyPhrases(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :vartype key_phrases: list[str] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -645,6 +780,18 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword 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. + :paramtype key_phrases: list[str] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(DocumentKeyPhrases, self).__init__(**kwargs) self.id = id self.key_phrases = key_phrases @@ -657,15 +804,15 @@ class DocumentLanguage(msrest.serialization.Model): 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.models.DetectedLanguage - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar detected_language: Required. Detected Language. + :vartype detected_language: ~azure.ai.textanalytics.v3_1.models.DetectedLanguage + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -690,6 +837,17 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword detected_language: Required. Detected Language. + :paramtype detected_language: ~azure.ai.textanalytics.v3_1.models.DetectedLanguage + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(DocumentLanguage, self).__init__(**kwargs) self.id = id self.detected_language = detected_language @@ -702,15 +860,15 @@ class DocumentLinkedEntities(msrest.serialization.Model): 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.models.LinkedEntity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized well known entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_1.models.LinkedEntity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -735,6 +893,17 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized well known entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_1.models.LinkedEntity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(DocumentLinkedEntities, self).__init__(**kwargs) self.id = id self.entities = entities @@ -747,21 +916,22 @@ class DocumentSentiment(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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.models.DocumentSentimentValue - :param statistics: if showStats=true was specified in the request this field will contain + :vartype sentiment: str or ~azure.ai.textanalytics.v3_1.models.DocumentSentimentValue + :ivar 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.models.DocumentStatistics - :param confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + :ivar confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 for each sentiment class. - :type confidence_scores: ~azure.ai.textanalytics.v3_1.models.SentimentConfidenceScorePerLabel - :param sentences: Required. Sentence level sentiment analysis. - :type sentences: list[~azure.ai.textanalytics.v3_1.models.SentenceSentiment] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :vartype confidence_scores: + ~azure.ai.textanalytics.v3_1.models.SentimentConfidenceScorePerLabel + :ivar sentences: Required. Sentence level sentiment analysis. + :vartype sentences: list[~azure.ai.textanalytics.v3_1.models.SentenceSentiment] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] """ _validation = { @@ -792,6 +962,24 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword sentiment: Required. Predicted sentiment for document (Negative, Neutral, Positive, or + Mixed). Possible values include: "positive", "neutral", "negative", "mixed". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_1.models.DocumentSentimentValue + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + :keyword confidence_scores: Required. Document level sentiment confidence scores between 0 and + 1 for each sentiment class. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_1.models.SentimentConfidenceScorePerLabel + :keyword sentences: Required. Sentence level sentiment analysis. + :paramtype sentences: list[~azure.ai.textanalytics.v3_1.models.SentenceSentiment] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + """ super(DocumentSentiment, self).__init__(**kwargs) self.id = id self.sentiment = sentiment @@ -806,10 +994,10 @@ class DocumentStatistics(msrest.serialization.Model): 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 + :ivar characters_count: Required. Number of text elements recognized in the document. + :vartype characters_count: int + :ivar transactions_count: Required. Number of transactions for the document. + :vartype transactions_count: int """ _validation = { @@ -829,6 +1017,12 @@ def __init__( transactions_count: int, **kwargs ): + """ + :keyword characters_count: Required. Number of text elements recognized in the document. + :paramtype characters_count: int + :keyword transactions_count: Required. Number of transactions for the document. + :paramtype transactions_count: int + """ super(DocumentStatistics, self).__init__(**kwargs) self.characters_count = characters_count self.transactions_count = transactions_count @@ -839,15 +1033,15 @@ class EntitiesResult(msrest.serialization.Model): 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.models.DocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -872,6 +1066,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntitiesResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -882,10 +1087,10 @@ def __init__( class EntitiesTask(msrest.serialization.Model): """EntitiesTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1.models.EntitiesTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_1.models.EntitiesTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -900,6 +1105,12 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_1.models.EntitiesTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(EntitiesTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -908,13 +1119,13 @@ def __init__( class EntitiesTaskParameters(msrest.serialization.Model): """EntitiesTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + :vartype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType """ _attribute_map = { @@ -931,6 +1142,15 @@ def __init__( string_index_type: Optional[Union[str, "StringIndexType"]] = None, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + """ super(EntitiesTaskParameters, self).__init__(**kwargs) self.model_version = model_version self.logging_opt_out = logging_opt_out @@ -940,8 +1160,8 @@ def __init__( class EntitiesTaskResult(msrest.serialization.Model): """EntitiesTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult """ _attribute_map = { @@ -954,6 +1174,10 @@ def __init__( results: Optional["EntitiesResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult + """ super(EntitiesTaskResult, self).__init__(**kwargs) self.results = results @@ -963,20 +1187,20 @@ class Entity(msrest.serialization.Model): 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' + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Entity type. + :vartype category: str + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -1007,6 +1231,22 @@ def __init__( subcategory: Optional[str] = None, **kwargs ): + """ + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Entity type. + :paramtype category: str + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(Entity, self).__init__(**kwargs) self.text = text self.category = category @@ -1021,15 +1261,15 @@ class EntityLinkingResult(msrest.serialization.Model): 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.models.DocumentLinkedEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentLinkedEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1054,6 +1294,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentLinkedEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntityLinkingResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -1064,10 +1315,10 @@ def __init__( class EntityLinkingTask(msrest.serialization.Model): """EntityLinkingTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1.models.EntityLinkingTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_1.models.EntityLinkingTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -1082,6 +1333,12 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_1.models.EntityLinkingTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(EntityLinkingTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -1090,13 +1347,13 @@ def __init__( class EntityLinkingTaskParameters(msrest.serialization.Model): """EntityLinkingTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + :vartype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType """ _attribute_map = { @@ -1113,6 +1370,15 @@ def __init__( string_index_type: Optional[Union[str, "StringIndexType"]] = None, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + """ super(EntityLinkingTaskParameters, self).__init__(**kwargs) self.model_version = model_version self.logging_opt_out = logging_opt_out @@ -1122,8 +1388,8 @@ def __init__( class EntityLinkingTaskResult(msrest.serialization.Model): """EntityLinkingTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult """ _attribute_map = { @@ -1136,6 +1402,10 @@ def __init__( results: Optional["EntityLinkingResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult + """ super(EntityLinkingTaskResult, self).__init__(**kwargs) self.results = results @@ -1145,8 +1415,8 @@ class ErrorResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param error: Required. Document Error. - :type error: ~azure.ai.textanalytics.v3_1.models.TextAnalyticsError + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_1.models.TextAnalyticsError """ _validation = { @@ -1163,6 +1433,10 @@ def __init__( error: "TextAnalyticsError", **kwargs ): + """ + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_1.models.TextAnalyticsError + """ super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -1170,15 +1444,15 @@ def __init__( class HealthcareAssertion(msrest.serialization.Model): """HealthcareAssertion. - :param conditionality: Describes any conditionality on the entity. Possible values include: + :ivar conditionality: Describes any conditionality on the entity. Possible values include: "hypothetical", "conditional". - :type conditionality: str or ~azure.ai.textanalytics.v3_1.models.Conditionality - :param certainty: Describes the entities certainty and polarity. Possible values include: + :vartype conditionality: str or ~azure.ai.textanalytics.v3_1.models.Conditionality + :ivar certainty: Describes the entities certainty and polarity. Possible values include: "positive", "positivePossible", "neutralPossible", "negativePossible", "negative". - :type certainty: str or ~azure.ai.textanalytics.v3_1.models.Certainty - :param association: Describes if the entity is the subject of the text or if it describes + :vartype certainty: str or ~azure.ai.textanalytics.v3_1.models.Certainty + :ivar association: Describes if the entity is the subject of the text or if it describes someone else. Possible values include: "subject", "other". - :type association: str or ~azure.ai.textanalytics.v3_1.models.Association + :vartype association: str or ~azure.ai.textanalytics.v3_1.models.Association """ _attribute_map = { @@ -1195,6 +1469,17 @@ def __init__( association: Optional[Union[str, "Association"]] = None, **kwargs ): + """ + :keyword conditionality: Describes any conditionality on the entity. Possible values include: + "hypothetical", "conditional". + :paramtype conditionality: str or ~azure.ai.textanalytics.v3_1.models.Conditionality + :keyword certainty: Describes the entities certainty and polarity. Possible values include: + "positive", "positivePossible", "neutralPossible", "negativePossible", "negative". + :paramtype certainty: str or ~azure.ai.textanalytics.v3_1.models.Certainty + :keyword association: Describes if the entity is the subject of the text or if it describes + someone else. Possible values include: "subject", "other". + :paramtype association: str or ~azure.ai.textanalytics.v3_1.models.Association + """ super(HealthcareAssertion, self).__init__(**kwargs) self.conditionality = conditionality self.certainty = certainty @@ -1204,13 +1489,13 @@ def __init__( class HealthcareLinkingProperties(msrest.serialization.Model): """HealthcareLinkingProperties. - :param assertion: - :type assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion - :param name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + :ivar assertion: + :vartype assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion + :ivar name: Preferred name for the entity. Example: 'histologically' would have a 'name' of 'histologic'. - :type name: str - :param links: Entity references in known data sources. - :type links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] + :vartype name: str + :ivar links: Entity references in known data sources. + :vartype links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] """ _attribute_map = { @@ -1227,6 +1512,15 @@ def __init__( links: Optional[List["HealthcareEntityLink"]] = None, **kwargs ): + """ + :keyword assertion: + :paramtype assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion + :keyword name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + 'histologic'. + :paramtype name: str + :keyword links: Entity references in known data sources. + :paramtype links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] + """ super(HealthcareLinkingProperties, self).__init__(**kwargs) self.assertion = assertion self.name = name @@ -1238,25 +1532,25 @@ class HealthcareEntityProperties(msrest.serialization.Model): 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. Healthcare Entity Category. Possible values include: + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Healthcare Entity Category. Possible values include: "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". - :type category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' + :vartype category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -1287,6 +1581,27 @@ def __init__( subcategory: Optional[str] = None, **kwargs ): + """ + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Healthcare Entity Category. Possible values include: + "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", + "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", + "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", + "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", + "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". + :paramtype category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(HealthcareEntityProperties, self).__init__(**kwargs) self.text = text self.category = category @@ -1301,32 +1616,32 @@ class HealthcareEntity(HealthcareEntityProperties, HealthcareLinkingProperties): All required parameters must be populated in order to send to Azure. - :param assertion: - :type assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion - :param name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + :ivar assertion: + :vartype assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion + :ivar name: Preferred name for the entity. Example: 'histologically' would have a 'name' of 'histologic'. - :type name: str - :param links: Entity references in known data sources. - :type links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] - :param text: Required. Entity text as appears in the request. - :type text: str - :param category: Required. Healthcare Entity Category. Possible values include: + :vartype name: str + :ivar links: Entity references in known data sources. + :vartype links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Healthcare Entity Category. Possible values include: "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". - :type category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' + :vartype category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -1363,6 +1678,34 @@ def __init__( subcategory: Optional[str] = None, **kwargs ): + """ + :keyword assertion: + :paramtype assertion: ~azure.ai.textanalytics.v3_1.models.HealthcareAssertion + :keyword name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + 'histologic'. + :paramtype name: str + :keyword links: Entity references in known data sources. + :paramtype links: list[~azure.ai.textanalytics.v3_1.models.HealthcareEntityLink] + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Healthcare Entity Category. Possible values include: + "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", + "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", + "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", + "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", + "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". + :paramtype category: str or ~azure.ai.textanalytics.v3_1.models.HealthcareEntityCategory + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(HealthcareEntity, self).__init__(text=text, category=category, subcategory=subcategory, offset=offset, length=length, confidence_score=confidence_score, assertion=assertion, name=name, links=links, **kwargs) self.assertion = assertion self.name = name @@ -1380,10 +1723,10 @@ class HealthcareEntityLink(msrest.serialization.Model): 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 + :ivar data_source: Required. Entity Catalog. Examples include: UMLS, CHV, MSH, etc. + :vartype data_source: str + :ivar id: Required. Entity id in the given source catalog. + :vartype id: str """ _validation = { @@ -1403,6 +1746,12 @@ def __init__( id: str, **kwargs ): + """ + :keyword data_source: Required. Entity Catalog. Examples include: UMLS, CHV, MSH, etc. + :paramtype data_source: str + :keyword id: Required. Entity id in the given source catalog. + :paramtype id: str + """ super(HealthcareEntityLink, self).__init__(**kwargs) self.data_source = data_source self.id = id @@ -1411,10 +1760,10 @@ def __init__( class HealthcareTaskResult(msrest.serialization.Model): """HealthcareTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] """ _attribute_map = { @@ -1429,6 +1778,12 @@ def __init__( errors: Optional[List["TextAnalyticsError"]] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + """ super(HealthcareTaskResult, self).__init__(**kwargs) self.results = results self.errors = errors @@ -1439,23 +1794,23 @@ class HealthcareJobState(JobMetadata, Pagination, HealthcareTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] - :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", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :ivar next_link: + :vartype next_link: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -1489,6 +1844,25 @@ def __init__( expiration_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.HealthcareResult + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :keyword next_link: + :paramtype next_link: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ 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, results=results, errors=errors, **kwargs) self.results = results self.errors = errors @@ -1513,16 +1887,16 @@ class HealthcareRelation(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or + :ivar relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or 'FrequencyOfMedication', etc. Possible values include: "Abbreviation", "DirectionOfBodyStructure", "DirectionOfCondition", "DirectionOfExamination", "DirectionOfTreatment", "DosageOfMedication", "FormOfMedication", "FrequencyOfMedication", "FrequencyOfTreatment", "QualifierOfCondition", "RelationOfExamination", "RouteOfMedication", "TimeOfCondition", "TimeOfEvent", "TimeOfExamination", "TimeOfMedication", "TimeOfTreatment", "UnitOfCondition", "UnitOfExamination", "ValueOfCondition", "ValueOfExamination". - :type relation_type: str or ~azure.ai.textanalytics.v3_1.models.RelationType - :param entities: Required. The entities in the relation. - :type entities: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelationEntity] + :vartype relation_type: str or ~azure.ai.textanalytics.v3_1.models.RelationType + :ivar entities: Required. The entities in the relation. + :vartype entities: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelationEntity] """ _validation = { @@ -1542,6 +1916,18 @@ def __init__( entities: List["HealthcareRelationEntity"], **kwargs ): + """ + :keyword relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or + 'FrequencyOfMedication', etc. Possible values include: "Abbreviation", + "DirectionOfBodyStructure", "DirectionOfCondition", "DirectionOfExamination", + "DirectionOfTreatment", "DosageOfMedication", "FormOfMedication", "FrequencyOfMedication", + "FrequencyOfTreatment", "QualifierOfCondition", "RelationOfExamination", "RouteOfMedication", + "TimeOfCondition", "TimeOfEvent", "TimeOfExamination", "TimeOfMedication", "TimeOfTreatment", + "UnitOfCondition", "UnitOfExamination", "ValueOfCondition", "ValueOfExamination". + :paramtype relation_type: str or ~azure.ai.textanalytics.v3_1.models.RelationType + :keyword entities: Required. The entities in the relation. + :paramtype entities: list[~azure.ai.textanalytics.v3_1.models.HealthcareRelationEntity] + """ super(HealthcareRelation, self).__init__(**kwargs) self.relation_type = relation_type self.entities = entities @@ -1552,13 +1938,13 @@ class HealthcareRelationEntity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment + :ivar ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment Identifier Representation), pointing to the entity . - :type ref: str - :param role: Required. Role of entity in the relationship. For example: 'CD20-positive diffuse + :vartype ref: str + :ivar role: Required. Role of entity in the relationship. For example: 'CD20-positive diffuse large B-cell lymphoma' has the following entities with their roles in parenthesis: CD20 (GeneOrProtein), Positive (Expression), diffuse large B-cell lymphoma (Diagnosis). - :type role: str + :vartype role: str """ _validation = { @@ -1578,6 +1964,15 @@ def __init__( role: str, **kwargs ): + """ + :keyword ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment + Identifier Representation), pointing to the entity . + :paramtype ref: str + :keyword role: Required. Role of entity in the relationship. For example: 'CD20-positive + diffuse large B-cell lymphoma' has the following entities with their roles in parenthesis: + CD20 (GeneOrProtein), Positive (Expression), diffuse large B-cell lymphoma (Diagnosis). + :paramtype role: str + """ super(HealthcareRelationEntity, self).__init__(**kwargs) self.ref = ref self.role = role @@ -1588,15 +1983,15 @@ class HealthcareResult(msrest.serialization.Model): 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.models.DocumentHealthcareEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentHealthcareEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1621,6 +2016,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentHealthcareEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(HealthcareResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -1633,19 +2039,19 @@ class InnerError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "InvalidParameterValue", + :ivar 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.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.models.InnerError + :vartype code: str or ~azure.ai.textanalytics.v3_1.models.InnerErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar details: Error details. + :vartype details: dict[str, str] + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_1.models.InnerError """ _validation = { @@ -1671,6 +2077,21 @@ def __init__( innererror: Optional["InnerError"] = None, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "InvalidParameterValue", + "InvalidRequestBodyFormat", "EmptyRequest", "MissingInputRecords", "InvalidDocument", + "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", + "InvalidCountryHint". + :paramtype code: str or ~azure.ai.textanalytics.v3_1.models.InnerErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword details: Error details. + :paramtype details: dict[str, str] + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_1.models.InnerError + """ super(InnerError, self).__init__(**kwargs) self.code = code self.message = message @@ -1682,16 +2103,17 @@ def __init__( 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.models.EntitiesTask] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_1.models.PiiTask] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: list[~azure.ai.textanalytics.v3_1.models.KeyPhrasesTask] - :param entity_linking_tasks: - :type entity_linking_tasks: list[~azure.ai.textanalytics.v3_1.models.EntityLinkingTask] - :param sentiment_analysis_tasks: - :type sentiment_analysis_tasks: list[~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTask] + :ivar entity_recognition_tasks: + :vartype entity_recognition_tasks: list[~azure.ai.textanalytics.v3_1.models.EntitiesTask] + :ivar entity_recognition_pii_tasks: + :vartype entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_1.models.PiiTask] + :ivar key_phrase_extraction_tasks: + :vartype key_phrase_extraction_tasks: list[~azure.ai.textanalytics.v3_1.models.KeyPhrasesTask] + :ivar entity_linking_tasks: + :vartype entity_linking_tasks: list[~azure.ai.textanalytics.v3_1.models.EntityLinkingTask] + :ivar sentiment_analysis_tasks: + :vartype sentiment_analysis_tasks: + list[~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTask] """ _attribute_map = { @@ -1712,6 +2134,20 @@ def __init__( sentiment_analysis_tasks: Optional[List["SentimentAnalysisTask"]] = None, **kwargs ): + """ + :keyword entity_recognition_tasks: + :paramtype entity_recognition_tasks: list[~azure.ai.textanalytics.v3_1.models.EntitiesTask] + :keyword entity_recognition_pii_tasks: + :paramtype entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_1.models.PiiTask] + :keyword key_phrase_extraction_tasks: + :paramtype key_phrase_extraction_tasks: + list[~azure.ai.textanalytics.v3_1.models.KeyPhrasesTask] + :keyword entity_linking_tasks: + :paramtype entity_linking_tasks: list[~azure.ai.textanalytics.v3_1.models.EntityLinkingTask] + :keyword sentiment_analysis_tasks: + :paramtype sentiment_analysis_tasks: + list[~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTask] + """ super(JobManifestTasks, self).__init__(**kwargs) self.entity_recognition_tasks = entity_recognition_tasks self.entity_recognition_pii_tasks = entity_recognition_pii_tasks @@ -1725,15 +2161,15 @@ class KeyPhraseResult(msrest.serialization.Model): 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.models.DocumentKeyPhrases] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentKeyPhrases] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1758,6 +2194,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentKeyPhrases] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(KeyPhraseResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -1768,10 +2215,10 @@ def __init__( class KeyPhrasesTask(msrest.serialization.Model): """KeyPhrasesTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1.models.KeyPhrasesTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_1.models.KeyPhrasesTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -1786,6 +2233,12 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_1.models.KeyPhrasesTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(KeyPhrasesTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -1794,10 +2247,10 @@ def __init__( class KeyPhrasesTaskParameters(msrest.serialization.Model): """KeyPhrasesTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool """ _attribute_map = { @@ -1812,6 +2265,12 @@ def __init__( logging_opt_out: Optional[bool] = False, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + """ super(KeyPhrasesTaskParameters, self).__init__(**kwargs) self.model_version = model_version self.logging_opt_out = logging_opt_out @@ -1820,8 +2279,8 @@ def __init__( class KeyPhraseTaskResult(msrest.serialization.Model): """KeyPhraseTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult """ _attribute_map = { @@ -1834,6 +2293,10 @@ def __init__( results: Optional["KeyPhraseResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult + """ super(KeyPhraseTaskResult, self).__init__(**kwargs) self.results = results @@ -1843,8 +2306,8 @@ class LanguageBatchInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param documents: Required. - :type documents: list[~azure.ai.textanalytics.v3_1.models.LanguageInput] + :ivar documents: Required. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.LanguageInput] """ _validation = { @@ -1861,6 +2324,10 @@ def __init__( documents: List["LanguageInput"], **kwargs ): + """ + :keyword documents: Required. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.LanguageInput] + """ super(LanguageBatchInput, self).__init__(**kwargs) self.documents = documents @@ -1870,12 +2337,12 @@ class LanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. + :vartype text: str + :ivar country_hint: + :vartype country_hint: str """ _validation = { @@ -1897,6 +2364,14 @@ def __init__( country_hint: Optional[str] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. + :paramtype text: str + :keyword country_hint: + :paramtype country_hint: str + """ super(LanguageInput, self).__init__(**kwargs) self.id = id self.text = text @@ -1908,15 +2383,15 @@ class LanguageResult(msrest.serialization.Model): 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.models.DocumentLanguage] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentLanguage] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1941,6 +2416,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentLanguage] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(LanguageResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -1953,21 +2439,20 @@ class LinkedEntity(msrest.serialization.Model): 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.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 + :ivar name: Required. Entity Linking formal name. + :vartype name: str + :ivar matches: Required. List of instances this entity appears in the text. + :vartype matches: list[~azure.ai.textanalytics.v3_1.models.Match] + :ivar language: Required. Language used in the data source. + :vartype language: str + :ivar id: Unique identifier of the recognized entity from the data source. + :vartype id: str + :ivar url: Required. URL for the entity's page from the data source. + :vartype url: str + :ivar data_source: Required. Data source used to extract entity linking, such as Wiki/Bing etc. + :vartype data_source: str + :ivar bing_id: Bing Entity Search API unique identifier of the recognized entity. + :vartype bing_id: str """ _validation = { @@ -2000,6 +2485,23 @@ def __init__( bing_id: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. Entity Linking formal name. + :paramtype name: str + :keyword matches: Required. List of instances this entity appears in the text. + :paramtype matches: list[~azure.ai.textanalytics.v3_1.models.Match] + :keyword language: Required. Language used in the data source. + :paramtype language: str + :keyword id: Unique identifier of the recognized entity from the data source. + :paramtype id: str + :keyword url: Required. URL for the entity's page from the data source. + :paramtype url: str + :keyword data_source: Required. Data source used to extract entity linking, such as Wiki/Bing + etc. + :paramtype data_source: str + :keyword bing_id: Bing Entity Search API unique identifier of the recognized entity. + :paramtype bing_id: str + """ super(LinkedEntity, self).__init__(**kwargs) self.name = name self.matches = matches @@ -2015,15 +2517,15 @@ class Match(msrest.serialization.Model): 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 + :ivar confidence_score: Required. If a well known item is recognized, a decimal number denoting + the confidence level between 0 and 1 will be returned. + :vartype confidence_score: float + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar offset: Required. Start position for the entity match text. + :vartype offset: int + :ivar length: Required. Length for the entity match text. + :vartype length: int """ _validation = { @@ -2049,6 +2551,17 @@ def __init__( length: int, **kwargs ): + """ + :keyword confidence_score: Required. If a well known item is recognized, a decimal number + denoting the confidence level between 0 and 1 will be returned. + :paramtype confidence_score: float + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword offset: Required. Start position for the entity match text. + :paramtype offset: int + :keyword length: Required. Length for the entity match text. + :paramtype length: int + """ super(Match, self).__init__(**kwargs) self.confidence_score = confidence_score self.text = text @@ -2061,8 +2574,8 @@ class MultiLanguageBatchInput(msrest.serialization.Model): 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.models.MultiLanguageInput] + :ivar documents: Required. The set of documents to process as part of this batch. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.MultiLanguageInput] """ _validation = { @@ -2079,6 +2592,10 @@ def __init__( documents: List["MultiLanguageInput"], **kwargs ): + """ + :keyword documents: Required. The set of documents to process as part of this batch. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.MultiLanguageInput] + """ super(MultiLanguageBatchInput, self).__init__(**kwargs) self.documents = documents @@ -2088,14 +2605,14 @@ class MultiLanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. A unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. The input text to process. + :vartype text: str + :ivar 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 + :vartype language: str """ _validation = { @@ -2117,6 +2634,16 @@ def __init__( language: Optional[str] = None, **kwargs ): + """ + :keyword id: Required. A unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. The input text to process. + :paramtype text: str + :keyword 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. + :paramtype language: str + """ super(MultiLanguageInput, self).__init__(**kwargs) self.id = id self.text = text @@ -2128,17 +2655,17 @@ class PiiDocumentEntities(msrest.serialization.Model): 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.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar redacted_text: Required. Returns redacted text. + :vartype redacted_text: str + :ivar entities: Required. Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_1.models.Entity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :ivar 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.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics """ _validation = { @@ -2166,6 +2693,19 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword redacted_text: Required. Returns redacted text. + :paramtype redacted_text: str + :keyword entities: Required. Recognized entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_1.models.Entity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.DocumentStatistics + """ super(PiiDocumentEntities, self).__init__(**kwargs) self.id = id self.redacted_text = redacted_text @@ -2179,15 +2719,15 @@ class PiiResult(msrest.serialization.Model): 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.models.PiiDocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.PiiDocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2212,6 +2752,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.PiiDocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(PiiResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -2222,10 +2773,10 @@ def __init__( class PiiTask(msrest.serialization.Model): """PiiTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1.models.PiiTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_1.models.PiiTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -2240,6 +2791,12 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_1.models.PiiTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(PiiTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -2248,17 +2805,17 @@ def __init__( 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.models.PiiTaskParametersDomain - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param pii_categories: (Optional) describes the PII categories to return. - :type pii_categories: list[str or ~azure.ai.textanalytics.v3_1.models.PiiCategory] - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar domain: Possible values include: "phi", "none". Default value: "none". + :vartype domain: str or ~azure.ai.textanalytics.v3_1.models.PiiTaskParametersDomain + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar pii_categories: (Optional) describes the PII categories to return. + :vartype pii_categories: list[str or ~azure.ai.textanalytics.v3_1.models.PiiCategory] + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + :vartype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType """ _validation = { @@ -2283,6 +2840,19 @@ def __init__( string_index_type: Optional[Union[str, "StringIndexType"]] = None, **kwargs ): + """ + :keyword domain: Possible values include: "phi", "none". Default value: "none". + :paramtype domain: str or ~azure.ai.textanalytics.v3_1.models.PiiTaskParametersDomain + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword pii_categories: (Optional) describes the PII categories to return. + :paramtype pii_categories: list[str or ~azure.ai.textanalytics.v3_1.models.PiiCategory] + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + """ super(PiiTaskParameters, self).__init__(**kwargs) self.domain = domain self.model_version = model_version @@ -2294,8 +2864,8 @@ def __init__( class PiiTaskResult(msrest.serialization.Model): """PiiTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.PiiResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.PiiResult """ _attribute_map = { @@ -2308,6 +2878,10 @@ def __init__( results: Optional["PiiResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.PiiResult + """ super(PiiTaskResult, self).__init__(**kwargs) self.results = results @@ -2317,16 +2891,16 @@ class RequestStatistics(msrest.serialization.Model): 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, + :ivar documents_count: Required. Number of documents submitted in the request. + :vartype documents_count: int + :ivar 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, + :vartype valid_documents_count: int + :ivar 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 + :vartype erroneous_documents_count: int + :ivar transactions_count: Required. Number of transactions for the request. + :vartype transactions_count: long """ _validation = { @@ -2352,6 +2926,18 @@ def __init__( transactions_count: int, **kwargs ): + """ + :keyword documents_count: Required. Number of documents submitted in the request. + :paramtype documents_count: int + :keyword valid_documents_count: Required. Number of valid documents. This excludes empty, + over-size limit or non-supported languages documents. + :paramtype valid_documents_count: int + :keyword erroneous_documents_count: Required. Number of invalid documents. This includes empty, + over-size limit or non-supported languages documents. + :paramtype erroneous_documents_count: int + :keyword transactions_count: Required. Number of transactions for the request. + :paramtype transactions_count: long + """ super(RequestStatistics, self).__init__(**kwargs) self.documents_count = documents_count self.valid_documents_count = valid_documents_count @@ -2364,19 +2950,19 @@ class SentenceAssessment(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param sentiment: Required. Assessment sentiment in the sentence. Possible values include: + :ivar sentiment: Required. Assessment sentiment in the sentence. Possible values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue - :param confidence_scores: Required. Assessment sentiment confidence scores in the sentence. - :type confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel - :param offset: Required. The assessment offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the assessment. - :type length: int - :param text: Required. The assessment text detected. - :type text: str - :param is_negated: Required. The indicator representing if the assessment is negated. - :type is_negated: bool + :vartype sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue + :ivar confidence_scores: Required. Assessment sentiment confidence scores in the sentence. + :vartype confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel + :ivar offset: Required. The assessment offset from the start of the sentence. + :vartype offset: int + :ivar length: Required. The length of the assessment. + :vartype length: int + :ivar text: Required. The assessment text detected. + :vartype text: str + :ivar is_negated: Required. The indicator representing if the assessment is negated. + :vartype is_negated: bool """ _validation = { @@ -2408,6 +2994,21 @@ def __init__( is_negated: bool, **kwargs ): + """ + :keyword sentiment: Required. Assessment sentiment in the sentence. Possible values include: + "positive", "mixed", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue + :keyword confidence_scores: Required. Assessment sentiment confidence scores in the sentence. + :paramtype confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel + :keyword offset: Required. The assessment offset from the start of the sentence. + :paramtype offset: int + :keyword length: Required. The length of the assessment. + :paramtype length: int + :keyword text: Required. The assessment text detected. + :paramtype text: str + :keyword is_negated: Required. The indicator representing if the assessment is negated. + :paramtype is_negated: bool + """ super(SentenceAssessment, self).__init__(**kwargs) self.sentiment = sentiment self.confidence_scores = confidence_scores @@ -2422,22 +3023,23 @@ class SentenceSentiment(msrest.serialization.Model): 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: + :ivar text: Required. The sentence text. + :vartype text: str + :ivar sentiment: Required. The predicted Sentiment for the sentence. Possible values include: "positive", "neutral", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1.models.SentenceSentimentValue - :param confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + :vartype sentiment: str or ~azure.ai.textanalytics.v3_1.models.SentenceSentimentValue + :ivar 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.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 targets: The array of sentence targets for the sentence. - :type targets: list[~azure.ai.textanalytics.v3_1.models.SentenceTarget] - :param assessments: The array of assessments for the sentence. - :type assessments: list[~azure.ai.textanalytics.v3_1.models.SentenceAssessment] + :vartype confidence_scores: + ~azure.ai.textanalytics.v3_1.models.SentimentConfidenceScorePerLabel + :ivar offset: Required. The sentence offset from the start of the document. + :vartype offset: int + :ivar length: Required. The length of the sentence. + :vartype length: int + :ivar targets: The array of sentence targets for the sentence. + :vartype targets: list[~azure.ai.textanalytics.v3_1.models.SentenceTarget] + :ivar assessments: The array of assessments for the sentence. + :vartype assessments: list[~azure.ai.textanalytics.v3_1.models.SentenceAssessment] """ _validation = { @@ -2470,6 +3072,25 @@ def __init__( assessments: Optional[List["SentenceAssessment"]] = None, **kwargs ): + """ + :keyword text: Required. The sentence text. + :paramtype text: str + :keyword sentiment: Required. The predicted Sentiment for the sentence. Possible values + include: "positive", "neutral", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_1.models.SentenceSentimentValue + :keyword confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + sentence for all classes. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_1.models.SentimentConfidenceScorePerLabel + :keyword offset: Required. The sentence offset from the start of the document. + :paramtype offset: int + :keyword length: Required. The length of the sentence. + :paramtype length: int + :keyword targets: The array of sentence targets for the sentence. + :paramtype targets: list[~azure.ai.textanalytics.v3_1.models.SentenceTarget] + :keyword assessments: The array of assessments for the sentence. + :paramtype assessments: list[~azure.ai.textanalytics.v3_1.models.SentenceAssessment] + """ super(SentenceSentiment, self).__init__(**kwargs) self.text = text self.sentiment = sentiment @@ -2485,21 +3106,21 @@ class SentenceTarget(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param sentiment: Required. Targeted sentiment in the sentence. Possible values include: + :ivar sentiment: Required. Targeted sentiment in the sentence. Possible values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue - :param confidence_scores: Required. Target sentiment confidence scores for the target in the + :vartype sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue + :ivar confidence_scores: Required. Target sentiment confidence scores for the target in the sentence. - :type confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel - :param offset: Required. The target offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the target. - :type length: int - :param text: Required. The target text detected. - :type text: str - :param relations: Required. The array of either assessment or target objects which is related - to the target. - :type relations: list[~azure.ai.textanalytics.v3_1.models.TargetRelation] + :vartype confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel + :ivar offset: Required. The target offset from the start of the sentence. + :vartype offset: int + :ivar length: Required. The length of the target. + :vartype length: int + :ivar text: Required. The target text detected. + :vartype text: str + :ivar relations: Required. The array of either assessment or target objects which is related to + the target. + :vartype relations: list[~azure.ai.textanalytics.v3_1.models.TargetRelation] """ _validation = { @@ -2531,6 +3152,23 @@ def __init__( relations: List["TargetRelation"], **kwargs ): + """ + :keyword sentiment: Required. Targeted sentiment in the sentence. Possible values include: + "positive", "mixed", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_1.models.TokenSentimentValue + :keyword confidence_scores: Required. Target sentiment confidence scores for the target in the + sentence. + :paramtype confidence_scores: ~azure.ai.textanalytics.v3_1.models.TargetConfidenceScoreLabel + :keyword offset: Required. The target offset from the start of the sentence. + :paramtype offset: int + :keyword length: Required. The length of the target. + :paramtype length: int + :keyword text: Required. The target text detected. + :paramtype text: str + :keyword relations: Required. The array of either assessment or target objects which is related + to the target. + :paramtype relations: list[~azure.ai.textanalytics.v3_1.models.TargetRelation] + """ super(SentenceTarget, self).__init__(**kwargs) self.sentiment = sentiment self.confidence_scores = confidence_scores @@ -2543,10 +3181,10 @@ def __init__( class SentimentAnalysisTask(msrest.serialization.Model): """SentimentAnalysisTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -2561,6 +3199,12 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_1.models.SentimentAnalysisTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(SentimentAnalysisTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -2569,15 +3213,15 @@ def __init__( class SentimentAnalysisTaskParameters(msrest.serialization.Model): """SentimentAnalysisTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param opinion_mining: - :type opinion_mining: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar opinion_mining: + :vartype opinion_mining: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + :vartype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType """ _attribute_map = { @@ -2596,6 +3240,17 @@ def __init__( string_index_type: Optional[Union[str, "StringIndexType"]] = None, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword opinion_mining: + :paramtype opinion_mining: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType + """ super(SentimentAnalysisTaskParameters, self).__init__(**kwargs) self.model_version = model_version self.logging_opt_out = logging_opt_out @@ -2608,12 +3263,12 @@ class SentimentConfidenceScorePerLabel(msrest.serialization.Model): 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 + :ivar positive: Required. + :vartype positive: float + :ivar neutral: Required. + :vartype neutral: float + :ivar negative: Required. + :vartype negative: float """ _validation = { @@ -2636,6 +3291,14 @@ def __init__( negative: float, **kwargs ): + """ + :keyword positive: Required. + :paramtype positive: float + :keyword neutral: Required. + :paramtype neutral: float + :keyword negative: Required. + :paramtype negative: float + """ super(SentimentConfidenceScorePerLabel, self).__init__(**kwargs) self.positive = positive self.neutral = neutral @@ -2647,15 +3310,15 @@ class SentimentResponse(msrest.serialization.Model): 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.models.DocumentSentiment] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Sentiment analysis per document. + :vartype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentSentiment] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :ivar 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.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2680,6 +3343,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Sentiment analysis per document. + :paramtype documents: list[~azure.ai.textanalytics.v3_1.models.DocumentSentiment] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_1.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_1.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(SentimentResponse, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -2690,8 +3364,8 @@ def __init__( class SentimentTaskResult(msrest.serialization.Model): """SentimentTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse """ _attribute_map = { @@ -2704,6 +3378,10 @@ def __init__( results: Optional["SentimentResponse"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse + """ super(SentimentTaskResult, self).__init__(**kwargs) self.results = results @@ -2713,10 +3391,10 @@ class TargetConfidenceScoreLabel(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param positive: Required. - :type positive: float - :param negative: Required. - :type negative: float + :ivar positive: Required. + :vartype positive: float + :ivar negative: Required. + :vartype negative: float """ _validation = { @@ -2736,6 +3414,12 @@ def __init__( negative: float, **kwargs ): + """ + :keyword positive: Required. + :paramtype positive: float + :keyword negative: Required. + :paramtype negative: float + """ super(TargetConfidenceScoreLabel, self).__init__(**kwargs) self.positive = positive self.negative = negative @@ -2746,11 +3430,11 @@ class TargetRelation(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param relation_type: Required. The type related to the target. Possible values include: + :ivar relation_type: Required. The type related to the target. Possible values include: "assessment", "target". - :type relation_type: str or ~azure.ai.textanalytics.v3_1.models.TargetRelationType - :param ref: Required. The JSON pointer indicating the linked object. - :type ref: str + :vartype relation_type: str or ~azure.ai.textanalytics.v3_1.models.TargetRelationType + :ivar ref: Required. The JSON pointer indicating the linked object. + :vartype ref: str """ _validation = { @@ -2770,6 +3454,13 @@ def __init__( ref: str, **kwargs ): + """ + :keyword relation_type: Required. The type related to the target. Possible values include: + "assessment", "target". + :paramtype relation_type: str or ~azure.ai.textanalytics.v3_1.models.TargetRelationType + :keyword ref: Required. The JSON pointer indicating the linked object. + :paramtype ref: str + """ super(TargetRelation, self).__init__(**kwargs) self.relation_type = relation_type self.ref = ref @@ -2780,28 +3471,28 @@ class TasksStateTasks(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :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: + :ivar completed: Required. + :vartype completed: int + :ivar failed: Required. + :vartype failed: int + :ivar in_progress: Required. + :vartype in_progress: int + :ivar total: Required. + :vartype total: int + :ivar entity_recognition_tasks: + :vartype entity_recognition_tasks: list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityRecognitionTasksItem] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: + :ivar entity_recognition_pii_tasks: + :vartype entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityRecognitionPiiTasksItem] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: + :ivar key_phrase_extraction_tasks: + :vartype key_phrase_extraction_tasks: list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksKeyPhraseExtractionTasksItem] - :param entity_linking_tasks: - :type entity_linking_tasks: + :ivar entity_linking_tasks: + :vartype entity_linking_tasks: list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityLinkingTasksItem] - :param sentiment_analysis_tasks: - :type sentiment_analysis_tasks: + :ivar sentiment_analysis_tasks: + :vartype sentiment_analysis_tasks: list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksSentimentAnalysisTasksItem] """ @@ -2838,6 +3529,31 @@ def __init__( sentiment_analysis_tasks: Optional[List["TasksStateTasksSentimentAnalysisTasksItem"]] = None, **kwargs ): + """ + :keyword completed: Required. + :paramtype completed: int + :keyword failed: Required. + :paramtype failed: int + :keyword in_progress: Required. + :paramtype in_progress: int + :keyword total: Required. + :paramtype total: int + :keyword entity_recognition_tasks: + :paramtype entity_recognition_tasks: + list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityRecognitionTasksItem] + :keyword entity_recognition_pii_tasks: + :paramtype entity_recognition_pii_tasks: + list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityRecognitionPiiTasksItem] + :keyword key_phrase_extraction_tasks: + :paramtype key_phrase_extraction_tasks: + list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksKeyPhraseExtractionTasksItem] + :keyword entity_linking_tasks: + :paramtype entity_linking_tasks: + list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksEntityLinkingTasksItem] + :keyword sentiment_analysis_tasks: + :paramtype sentiment_analysis_tasks: + list[~azure.ai.textanalytics.v3_1.models.TasksStateTasksSentimentAnalysisTasksItem] + """ super(TasksStateTasks, self).__init__(**kwargs) self.completed = completed self.failed = failed @@ -2855,13 +3571,13 @@ class TaskState(msrest.serialization.Model): 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 task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -2884,6 +3600,15 @@ def __init__( status: Union[str, "State"], **kwargs ): + """ + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TaskState, self).__init__(**kwargs) self.last_update_date_time = last_update_date_time self.task_name = task_name @@ -2895,15 +3620,15 @@ class TasksStateTasksEntityLinkingTasksItem(TaskState, EntityLinkingTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -2928,6 +3653,17 @@ def __init__( results: Optional["EntityLinkingResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TasksStateTasksEntityLinkingTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -2940,15 +3676,15 @@ class TasksStateTasksEntityRecognitionPiiTasksItem(TaskState, PiiTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.PiiResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.PiiResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -2973,6 +3709,17 @@ def __init__( results: Optional["PiiResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.PiiResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TasksStateTasksEntityRecognitionPiiTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -2985,15 +3732,15 @@ class TasksStateTasksEntityRecognitionTasksItem(TaskState, EntitiesTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -3018,6 +3765,17 @@ def __init__( results: Optional["EntitiesResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.EntitiesResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TasksStateTasksEntityRecognitionTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -3030,15 +3788,15 @@ class TasksStateTasksKeyPhraseExtractionTasksItem(TaskState, KeyPhraseTaskResult All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -3063,6 +3821,17 @@ def __init__( results: Optional["KeyPhraseResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TasksStateTasksKeyPhraseExtractionTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -3075,15 +3844,15 @@ class TasksStateTasksSentimentAnalysisTasksItem(TaskState, SentimentTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_1.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_1.models.State """ _validation = { @@ -3108,6 +3877,17 @@ def __init__( results: Optional["SentimentResponse"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_1.models.SentimentResponse + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_1.models.State + """ super(TasksStateTasksSentimentAnalysisTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -3120,17 +3900,17 @@ class TextAnalyticsError(msrest.serialization.Model): 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.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.models.InnerError - :param details: Details about specific errors that led to this reported error. - :type details: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + :ivar code: Required. Error code. Possible values include: "InvalidRequest", "InvalidArgument", + "InternalServerError", "ServiceUnavailable", "NotFound". + :vartype code: str or ~azure.ai.textanalytics.v3_1.models.ErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_1.models.InnerError + :ivar details: Details about specific errors that led to this reported error. + :vartype details: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] """ _validation = { @@ -3156,6 +3936,19 @@ def __init__( details: Optional[List["TextAnalyticsError"]] = None, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "InvalidRequest", + "InvalidArgument", "InternalServerError", "ServiceUnavailable", "NotFound". + :paramtype code: str or ~azure.ai.textanalytics.v3_1.models.ErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_1.models.InnerError + :keyword details: Details about specific errors that led to this reported error. + :paramtype details: list[~azure.ai.textanalytics.v3_1.models.TextAnalyticsError] + """ super(TextAnalyticsError, self).__init__(**kwargs) self.code = code self.message = message @@ -3169,13 +3962,13 @@ class TextAnalyticsWarning(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "LongWordsInDocument", + :ivar code: Required. Error code. Possible values include: "LongWordsInDocument", "DocumentTruncated". - :type code: str or ~azure.ai.textanalytics.v3_1.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 + :vartype code: str or ~azure.ai.textanalytics.v3_1.models.WarningCodeValue + :ivar message: Required. Warning message. + :vartype message: str + :ivar target_ref: A JSON pointer reference indicating the target object. + :vartype target_ref: str """ _validation = { @@ -3197,6 +3990,15 @@ def __init__( target_ref: Optional[str] = None, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "LongWordsInDocument", + "DocumentTruncated". + :paramtype code: str or ~azure.ai.textanalytics.v3_1.models.WarningCodeValue + :keyword message: Required. Warning message. + :paramtype message: str + :keyword target_ref: A JSON pointer reference indicating the target object. + :paramtype target_ref: str + """ super(TextAnalyticsWarning, self).__init__(**kwargs) self.code = code self.message = message diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_text_analytics_client_enums.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_text_analytics_client_enums.py index 615a94221ab2..1f5a08ecd567 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_text_analytics_client_enums.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/models/_text_analytics_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 Association(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Association(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes if the entity is the subject of the text or if it describes someone else. """ SUBJECT = "subject" OTHER = "other" -class Certainty(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Certainty(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes the entities certainty and polarity. """ @@ -43,14 +28,14 @@ class Certainty(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NEGATIVE_POSSIBLE = "negativePossible" NEGATIVE = "negative" -class Conditionality(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Conditionality(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes any conditionality on the entity. """ HYPOTHETICAL = "hypothetical" CONDITIONAL = "conditional" -class DocumentSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DocumentSentimentValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Predicted sentiment for document (Negative, Neutral, Positive, or Mixed). """ @@ -59,7 +44,7 @@ class DocumentSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) NEGATIVE = "negative" MIXED = "mixed" -class ErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ErrorCodeValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Error code. """ @@ -69,7 +54,7 @@ class ErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SERVICE_UNAVAILABLE = "ServiceUnavailable" NOT_FOUND = "NotFound" -class HealthcareEntityCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class HealthcareEntityCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Healthcare Entity Category. """ @@ -100,7 +85,7 @@ class HealthcareEntityCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enu FAMILY_RELATION = "FAMILY_RELATION" TREATMENT_NAME = "TREATMENT_NAME" -class InnerErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class InnerErrorCodeValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Error code. """ @@ -114,7 +99,7 @@ class InnerErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UNSUPPORTED_LANGUAGE_CODE = "UnsupportedLanguageCode" INVALID_COUNTRY_HINT = "InvalidCountryHint" -class PiiCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PiiCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ABA_ROUTING_NUMBER = "ABARoutingNumber" AR_NATIONAL_IDENTITY_NUMBER = "ARNationalIdentityNumber" @@ -290,12 +275,12 @@ class PiiCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ALL = "All" DEFAULT = "Default" -class PiiTaskParametersDomain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PiiTaskParametersDomain(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): PHI = "phi" NONE = "none" -class RelationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RelationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of relation. Examples include: ``DosageOfMedication`` or 'FrequencyOfMedication', etc. """ @@ -321,7 +306,7 @@ class RelationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VALUE_OF_CONDITION = "ValueOfCondition" VALUE_OF_EXAMINATION = "ValueOfExamination" -class SentenceSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SentenceSentimentValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The predicted Sentiment for the sentence. """ @@ -329,7 +314,7 @@ class SentenceSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) NEUTRAL = "neutral" NEGATIVE = "negative" -class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class State(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): NOT_STARTED = "notStarted" RUNNING = "running" @@ -339,7 +324,7 @@ class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): CANCELLED = "cancelled" CANCELLING = "cancelling" -class StringIndexType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +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 @@ -352,14 +337,14 @@ class StringIndexType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: application is written in a language that support Unicode, for example Java, JavaScript. UTF16_CODE_UNIT = "Utf16CodeUnit" -class TargetRelationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TargetRelationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type related to the target. """ ASSESSMENT = "assessment" TARGET = "target" -class TokenSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TokenSentimentValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Targeted sentiment in the sentence. """ @@ -367,7 +352,7 @@ class TokenSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MIXED = "mixed" NEGATIVE = "negative" -class WarningCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WarningCodeValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Error code. """ diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/operations/_text_analytics_client_operations.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/operations/_text_analytics_client_operations.py index 4ce4a4ccb437..213b8704da59 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/operations/_text_analytics_client_operations.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/operations/_text_analytics_client_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from ...._lro import AnalyzeActionsLROPoller, AnalyzeActionsLROPollingMethod, 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.polling.base_polling import LROBasePolling +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,6 +29,419 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +# fmt: off + +def build_analyze_request_initial( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/analyze') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + headers=header_parameters, + **kwargs + ) + + +def build_analyze_status_request( + job_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + top = kwargs.pop('top', 20) # type: Optional[int] + skip = kwargs.pop('skip', 0) # type: Optional[int] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/analyze/jobs/{jobId}') + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if top is not None: + query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', maximum=50, minimum=1) + if skip is not None: + query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_health_status_request( + job_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + top = kwargs.pop('top', 20) # type: Optional[int] + skip = kwargs.pop('skip', 0) # type: Optional[int] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/health/jobs/{jobId}') + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if top is not None: + query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', maximum=50, minimum=1) + if skip is not None: + query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_cancel_health_job_request_initial( + job_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/health/jobs/{jobId}') + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + headers=header_parameters, + **kwargs + ) + + +def build_health_request_initial( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + string_index_type = kwargs.pop('string_index_type', None) # type: Optional[Union[str, "_models.StringIndexType"]] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/health/jobs') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if string_index_type is not None: + query_parameters['stringIndexType'] = _SERIALIZER.query("string_index_type", string_index_type, 'str') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_entities_recognition_general_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + string_index_type = kwargs.pop('string_index_type', None) # type: Optional[Union[str, "_models.StringIndexType"]] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/recognition/general') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + if string_index_type is not None: + query_parameters['stringIndexType'] = _SERIALIZER.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_entities_recognition_pii_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + domain = kwargs.pop('domain', None) # type: Optional[str] + string_index_type = kwargs.pop('string_index_type', None) # type: Optional[Union[str, "_models.StringIndexType"]] + pii_categories = kwargs.pop('pii_categories', None) # type: Optional[List[Union[str, "_models.PiiCategory"]]] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/recognition/pii') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + if domain is not None: + query_parameters['domain'] = _SERIALIZER.query("domain", domain, 'str') + if string_index_type is not None: + query_parameters['stringIndexType'] = _SERIALIZER.query("string_index_type", string_index_type, 'str') + if pii_categories is not None: + query_parameters['piiCategories'] = _SERIALIZER.query("pii_categories", pii_categories, '[str]', div=',') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_entities_linking_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + string_index_type = kwargs.pop('string_index_type', None) # type: Optional[Union[str, "_models.StringIndexType"]] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/linking') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + if string_index_type is not None: + query_parameters['stringIndexType'] = _SERIALIZER.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_key_phrases_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/keyPhrases') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_languages_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/languages') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_sentiment_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + opinion_mining = kwargs.pop('opinion_mining', None) # type: Optional[bool] + string_index_type = kwargs.pop('string_index_type', None) # type: Optional[Union[str, "_models.StringIndexType"]] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/sentiment') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + if opinion_mining is not None: + query_parameters['opinionMining'] = _SERIALIZER.query("opinion_mining", opinion_mining, 'bool') + if string_index_type is not None: + query_parameters['stringIndexType'] = _SERIALIZER.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class TextAnalyticsClientOperationsMixin(object): def _analyze_initial( @@ -37,53 +455,50 @@ def _analyze_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } 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] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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] if body is not None: - body_content = self._serialize.body(body, 'AnalyzeBatchInput') + json = 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) + json = None + + request = build_analyze_request_initial( + content_type=content_type, + json=json, + template_url=self._analyze_initial.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) - response_headers = {} deserialized = None + response_headers = {} 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 + + @distributed_trace def begin_analyze( self, body=None, # type: Optional["_models.AnalyzeBatchInput"] @@ -99,15 +514,19 @@ def begin_analyze( :type body: ~azure.ai.textanalytics.v3_1.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: By default, your polling method will be AnalyzeActionsLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AnalyzeActionsLROPollingMethod. Pass + in False for this operation to not poll, or pass in 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 AnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AnalyzeActionsLROPoller that returns either AnalyzeJobState or the + result of cls(response) :rtype: ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1.models.AnalyzeJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeJobState"] lro_delay = kwargs.pop( 'polling_interval', @@ -117,25 +536,25 @@ def begin_analyze( if cont_token is None: raw_result = self._analyze_initial( body=body, + content_type=content_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): + response = pipeline_response.http_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), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = AnalyzeActionsLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AnalyzeActionsLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -147,8 +566,10 @@ def get_long_running_output(pipeline_response): ) else: return AnalyzeActionsLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze.metadata = {'url': '/analyze'} # type: ignore + @distributed_trace def analyze_status( self, job_id, # type: str @@ -185,36 +606,27 @@ def analyze_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self.analyze_status.metadata['url'] # type: ignore + + request = build_analyze_status_request( + job_id=job_id, + show_stats=show_stats, + top=top, + skip=skip, + template_url=self.analyze_status.metadata['url'], + ) + request = _convert_request(request) 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'), + "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 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('AnalyzeJobState', pipeline_response) @@ -223,8 +635,11 @@ def analyze_status( return cls(pipeline_response, deserialized, {}) return deserialized + analyze_status.metadata = {'url': '/analyze/jobs/{jobId}'} # type: ignore + + @distributed_trace def health_status( self, job_id, # type: str @@ -259,36 +674,27 @@ def health_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self.health_status.metadata['url'] # type: ignore + + request = build_health_status_request( + job_id=job_id, + top=top, + skip=skip, + show_stats=show_stats, + template_url=self.health_status.metadata['url'], + ) + request = _convert_request(request) 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'), + "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 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('HealthcareJobState', pipeline_response) @@ -297,8 +703,10 @@ def health_status( 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 @@ -310,40 +718,36 @@ def _cancel_health_job_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self._cancel_health_job_initial.metadata['url'] # type: ignore + + request = build_cancel_health_job_request_initial( + job_id=job_id, + template_url=self._cancel_health_job_initial.metadata['url'], + ) + request = _convert_request(request) 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'), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + 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 + + @distributed_trace def begin_cancel_health_job( self, job_id, # type: str @@ -358,15 +762,17 @@ def begin_cancel_health_job( :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: By default, your polling method will be LROBasePolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in 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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -379,20 +785,18 @@ def begin_cancel_health_job( 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'), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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: @@ -404,6 +808,7 @@ def get_long_running_output(pipeline_response): ) 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( @@ -421,57 +826,50 @@ def _health_initial( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self._health_initial.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_health_request_initial( + content_type=content_type, + model_version=model_version, + string_index_type=string_index_type, + logging_opt_out=logging_opt_out, + json=json, + template_url=self._health_initial.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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') - if logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) - response_headers = {} deserialized = None + response_headers = {} 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 + + @distributed_trace def begin_health( self, documents, # type: List["_models.MultiLanguageInput"] @@ -505,15 +903,20 @@ def begin_health( :type logging_opt_out: bool :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: By default, your polling method will be AnalyzeHealthcareEntitiesLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be + AnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll, or + pass in 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.models.HealthcareJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :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.models.HealthcareJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.HealthcareJobState"] lro_delay = kwargs.pop( 'polling_interval', @@ -526,25 +929,25 @@ def begin_health( model_version=model_version, string_index_type=string_index_type, logging_opt_out=logging_opt_out, + content_type=content_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): + response = pipeline_response.http_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), + "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) + 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: @@ -556,8 +959,10 @@ def get_long_running_output(pipeline_response): ) else: return AnalyzeHealthcareEntitiesLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_health.metadata = {'url': '/entities/health/jobs'} # type: ignore + @distributed_trace def entities_recognition_general( self, documents, # type: List["_models.MultiLanguageInput"] @@ -606,43 +1011,32 @@ def entities_recognition_general( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_recognition_general.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_recognition_general_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + string_index_type=string_index_type, + json=json, + template_url=self.entities_recognition_general.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntitiesResult', pipeline_response) @@ -651,8 +1045,11 @@ def entities_recognition_general( return cls(pipeline_response, deserialized, {}) return deserialized + entities_recognition_general.metadata = {'url': '/entities/recognition/general'} # type: ignore + + @distributed_trace def entities_recognition_pii( self, documents, # type: List["_models.MultiLanguageInput"] @@ -709,47 +1106,34 @@ def entities_recognition_pii( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_recognition_pii.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_recognition_pii_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + domain=domain, + string_index_type=string_index_type, + pii_categories=pii_categories, + json=json, + template_url=self.entities_recognition_pii.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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') - if pii_categories is not None: - query_parameters['piiCategories'] = self._serialize.query("pii_categories", pii_categories, '[str]', div=',') - - # 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PiiResult', pipeline_response) @@ -758,8 +1142,11 @@ def entities_recognition_pii( return cls(pipeline_response, deserialized, {}) return deserialized + entities_recognition_pii.metadata = {'url': '/entities/recognition/pii'} # type: ignore + + @distributed_trace def entities_linking( self, documents, # type: List["_models.MultiLanguageInput"] @@ -807,43 +1194,32 @@ def entities_linking( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_linking.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_linking_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + string_index_type=string_index_type, + json=json, + template_url=self.entities_linking.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntityLinkingResult', pipeline_response) @@ -852,8 +1228,11 @@ def entities_linking( return cls(pipeline_response, deserialized, {}) return deserialized + entities_linking.metadata = {'url': '/entities/linking'} # type: ignore + + @distributed_trace def key_phrases( self, documents, # type: List["_models.MultiLanguageInput"] @@ -896,41 +1275,31 @@ def key_phrases( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.key_phrases.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_key_phrases_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + json=json, + template_url=self.key_phrases.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('KeyPhraseResult', pipeline_response) @@ -939,8 +1308,11 @@ def key_phrases( return cls(pipeline_response, deserialized, {}) return deserialized + key_phrases.metadata = {'url': '/keyPhrases'} # type: ignore + + @distributed_trace def languages( self, documents, # type: List["_models.LanguageInput"] @@ -984,41 +1356,31 @@ def languages( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.languages.metadata['url'] # type: ignore + _input = _models.LanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'LanguageBatchInput') + + request = build_languages_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + json=json, + template_url=self.languages.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('LanguageResult', pipeline_response) @@ -1027,8 +1389,11 @@ def languages( return cls(pipeline_response, deserialized, {}) return deserialized + languages.metadata = {'url': '/languages'} # type: ignore + + @distributed_trace def sentiment( self, documents, # type: List["_models.MultiLanguageInput"] @@ -1080,45 +1445,33 @@ def sentiment( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.sentiment.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_sentiment_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + opinion_mining=opinion_mining, + string_index_type=string_index_type, + json=json, + template_url=self.sentiment.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SentimentResponse', pipeline_response) @@ -1127,4 +1480,6 @@ def sentiment( 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_2_preview_2/_metadata.json b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_metadata.json index c30e3aa4ce9e..b7d22520fe4b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_metadata.json +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_metadata.json @@ -5,13 +5,13 @@ "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. Functionality for analysis of text specific to the healthcare domain and personal information are also available in the API. 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.2-preview.2\u0027", + "host_value": null, + "parameterized_host_template": "\u0027{Endpoint}/text/analytics/v3.2-preview.2\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\"]}, \"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\"]}}}" + "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\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"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": { @@ -79,45 +79,44 @@ "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, + "credential_call_sync": "policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)", "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\": [\"AnalyzeActionsLROPoller\", \"AnalyzeActionsLROPollingMethod\", \"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\"], \".....aio._lro_async\": [\"AsyncAnalyzeActionsLROPoller\", \"AsyncAnalyzeActionsLROPollingMethod\", \"AsyncAnalyzeHealthcareEntitiesLROPoller\", \"AsyncAnalyzeHealthcareEntitiesLROPollingMethod\"], \"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\"]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"List\", \"Optional\", \"Union\"]}, \"azurecore\": {\"...._lro\": [\"AnalyzeActionsLROPoller\", \"AnalyzeHealthcareEntitiesLROPoller\"], \"azure.core.polling\": [\"LROPoller\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"List\", \"Optional\", \"Union\"]}, \"azurecore\": {\".....aio._lro_async\": [\"AsyncAnalyzeActionsLROPoller\", \"AsyncAnalyzeHealthcareEntitiesLROPoller\"], \"azure.core.polling\": [\"AsyncLROPoller\"]}}}", "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_2_preview_2.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_2_preview_2.models.AnalyzeJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _analyze_initial(\n self,\n body=None, # type: Optional[\"_models.AnalyzeBatchInput\"]\n **kwargs # type: Any\n):\n # type: (...) -\u003e Optional[\"_models.AnalyzeJobState\"]\n", + "doc": "\"\"\"Submit analysis job.\n\n:param body: Collection of documents to analyze and tasks to execute.\n:type body: ~azure.ai.textanalytics.v3_2_preview_2.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_2_preview_2.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: Any\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_2_preview_2.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_2_preview_2.models.AnalyzeJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Submit analysis job.\n\n:param body: Collection of documents to analyze and tasks to execute.\n:type body: ~azure.ai.textanalytics.v3_2_preview_2.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_2_preview_2.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_2_preview_2.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: By default, your polling method will be AnalyzeActionsLROPollingMethod.\n Pass in False for this operation to not poll, or pass in 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 AnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)\n:rtype: ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.AnalyzeJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_analyze(\n self,\n body=None, # type: Optional[\"_models.AnalyzeBatchInput\"]\n **kwargs # type: Any\n):\n # type: (...) -\u003e AnalyzeActionsLROPoller[\"_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_2_preview_2.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: By default, your polling method will be AnalyzeActionsLROPollingMethod. Pass\n in False for this operation to not poll, or pass in your own initialized polling object for a\n 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\n Retry-After header is present.\n:return: An instance of AnalyzeActionsLROPoller that returns either AnalyzeJobState or the\n result of cls(response)\n:rtype:\n ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.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: Any\n) -\u003e AsyncAnalyzeActionsLROPoller[\"_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_2_preview_2.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: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod.\n Pass in False for this operation to not poll, or pass in 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 AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)\n:rtype: ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.AnalyzeJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\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_2_preview_2.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: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod.\n Pass in False for this operation to not poll, or pass in your own initialized polling object\n 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\n Retry-After header is present.\n:return: An instance of AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the\n result of cls(response)\n:rtype:\n ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.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", + "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 # type: (...) -\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_2_preview_2.models.AnalyzeJobState\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -129,7 +128,7 @@ }, "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", + "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 # type: (...) -\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_2_preview_2.models.HealthcareJobState\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -141,55 +140,55 @@ }, "_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\"\"\"" + "signature": "def _cancel_health_job_initial(\n self,\n job_id, # type: str\n **kwargs # type: Any\n):\n # type: (...) -\u003e None\n", + "doc": "\"\"\"Cancel 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: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: Any\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\"\"\"" + "doc": "\"\"\"Cancel 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: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: By default, your polling method will be LROBasePolling.\n Pass in False for this operation to not poll, or pass in 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\"\"\"" + "signature": "def begin_cancel_health_job(\n self,\n job_id, # type: str\n **kwargs # type: Any\n):\n # type: (...) -\u003e LROPoller[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: By default, your polling method will be LROBasePolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n 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\n 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: Any\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: By default, your polling method will be AsyncLROBasePolling.\n Pass in False for this operation to not poll, or pass in 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\"\"\"" + "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: By default, your polling method will be AsyncLROBasePolling. Pass in False\n for this operation to not poll, or pass in your own initialized polling object for a personal\n 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\n 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=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n logging_opt_out=None, # type: Optional[bool]\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_2_preview_2.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_2_preview_2.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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_2_preview_2.models.HealthcareJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _health_initial(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n # type: (...) -\u003e Optional[\"_models.HealthcareJobState\"]\n", + "doc": "\"\"\"Submit healthcare analysis job.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_2_preview_2.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_2_preview_2.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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_2_preview_2.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\"]] = None,\n logging_opt_out: Optional[bool] = None,\n **kwargs: Any\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_2_preview_2.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_2_preview_2.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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_2_preview_2.models.HealthcareJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Submit healthcare analysis job.\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_2_preview_2.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_2_preview_2.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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_2_preview_2.models.HealthcareJobState or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "documents, model_version, string_index_type, logging_opt_out" }, "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=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n logging_opt_out=None, # type: Optional[bool]\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_2_preview_2.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_2_preview_2.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: bool\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: By default, your polling method will be AnalyzeHealthcareEntitiesLROPollingMethod.\n Pass in False for this operation to not poll, or pass in 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_2_preview_2.models.HealthcareJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_health(\n self,\n documents, # type: List[\"_models.MultiLanguageInput\"]\n model_version=None, # type: Optional[str]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n # type: (...) -\u003e AnalyzeHealthcareEntitiesLROPoller[\"_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_2_preview_2.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_2_preview_2.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: bool\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: By default, your polling method will be\n AnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll, or\n pass in 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\n Retry-After header is present.\n:return: An instance of AnalyzeHealthcareEntitiesLROPoller that returns either\n HealthcareJobState or the result of cls(response)\n:rtype:\n ~...._lro.AnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_2_preview_2.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\"]] = None,\n logging_opt_out: Optional[bool] = None,\n **kwargs: Any\n) -\u003e AsyncAnalyzeHealthcareEntitiesLROPoller[\"_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_2_preview_2.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_2_preview_2.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: bool\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: By default, your polling method will be AsyncAnalyzeHealthcareEntitiesLROPollingMethod.\n Pass in False for this operation to not poll, or pass in 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 AsyncAnalyzeHealthcareEntitiesLROPoller that returns either HealthcareJobState or the result of cls(response)\n:rtype: ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareJobState]\n:raises ~azure.core.exceptions.HttpResponseError:\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_2_preview_2.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_2_preview_2.models.StringIndexType\n:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: bool\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: By default, your polling method will be\n AsyncAnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll,\n or pass in 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\n Retry-After header is present.\n:return: An instance of AsyncAnalyzeHealthcareEntitiesLROPoller that returns either\n HealthcareJobState or the result of cls(response)\n:rtype:\n ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareJobState]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "documents, model_version, string_index_type, logging_opt_out" }, "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 logging_opt_out=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n # type: (...) -\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_2_preview_2.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 logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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_2_preview_2.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_2_preview_2.models.EntitiesResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -201,7 +200,7 @@ }, "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 logging_opt_out=None, # type: Optional[bool]\n domain=None, # type: Optional[str]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n pii_categories=None, # type: Optional[List[Union[str, \"_models.PiiCategory\"]]]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n domain=None, # type: Optional[str]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n pii_categories=None, # type: Optional[List[Union[str, \"_models.PiiCategory\"]]]\n **kwargs # type: Any\n):\n # type: (...) -\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_2_preview_2.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 logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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_2_preview_2.models.StringIndexType\n:param pii_categories: (Optional) describes the PII categories to return.\n:type pii_categories: list[str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiCategory]\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_2_preview_2.models.PiiResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -213,7 +212,7 @@ }, "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 logging_opt_out=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n # type: (...) -\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_2_preview_2.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 logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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_2_preview_2.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_2_preview_2.models.EntityLinkingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -225,7 +224,7 @@ }, "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 logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n # type: (...) -\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_2_preview_2.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 logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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_2_preview_2.models.KeyPhraseResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -237,7 +236,7 @@ }, "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 logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n # type: (...) -\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_2_preview_2.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:param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: 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_2_preview_2.models.LanguageResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -249,7 +248,7 @@ }, "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 logging_opt_out=None, # type: Optional[bool]\n opinion_mining=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n", + "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 logging_opt_out=None, # type: Optional[bool]\n opinion_mining=None, # type: Optional[bool]\n string_index_type=None, # type: Optional[Union[str, \"_models.StringIndexType\"]]\n **kwargs # type: Any\n):\n # type: (...) -\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(targets and assessments).\n\n:param documents: The set of documents to process as part of this batch.\n:type documents: list[~azure.ai.textanalytics.v3_2_preview_2.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 logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged\n for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to\n allow for troubleshooting issues in providing you with the Text Analytics natural language\n processing functions. Setting this parameter to true, disables input logging and may limit our\n ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy\n notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI\n principles at https://www.microsoft.com/en-us/ai/responsible-ai.\n:type logging_opt_out: bool\n:param opinion_mining: (Optional) if set to true, response will contain not only sentiment\n prediction but also opinion mining (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_2_preview_2.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_2_preview_2.models.SentimentResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_text_analytics_client.py index 59716e7b2f9d..3acee814d2ea 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_text_analytics_client.py @@ -6,31 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from copy import deepcopy from typing import TYPE_CHECKING from azure.core import PipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import TextAnalyticsClientConfiguration +from .operations import TextAnalyticsClientOperationsMixin + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports 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 -from . import models - + from azure.core.rest import HttpRequest, HttpResponse 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. Functionality for analysis of text specific to the healthcare domain and personal information are also available in the API. 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). + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( @@ -40,33 +42,46 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - base_url = '{Endpoint}/text/analytics/v3.2-preview.2' + _base_url = '{Endpoint}/text/analytics/v3.2-preview.2' self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs) - self._client = PipelineClient(base_url=base_url, config=self._config, **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) + self._serialize.client_side_validation = False - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs # type: Any + ): + # type: (...) -> 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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ + + request_copy = deepcopy(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_vendor.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# 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.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/aio/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/aio/_text_analytics_client.py index 221b9ec9f1d9..31b7cf350a6c 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/aio/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/aio/_text_analytics_client.py @@ -6,29 +6,31 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING from azure.core import AsyncPipelineClient -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from msrest import Deserializer, Serializer -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - +from .. import models from ._configuration import TextAnalyticsClientConfiguration from .operations import TextAnalyticsClientOperationsMixin -from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential 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. Functionality for analysis of text specific to the healthcare domain and personal information are also available in the API. 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). + :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. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( @@ -37,32 +39,45 @@ def __init__( endpoint: str, **kwargs: Any ) -> None: - base_url = '{Endpoint}/text/analytics/v3.2-preview.2' + _base_url = '{Endpoint}/text/analytics/v3.2-preview.2' self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs) - self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **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) + self._serialize.client_side_validation = False - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[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. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ + + request_copy = deepcopy(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/aio/operations/_text_analytics_client_operations.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/aio/operations/_text_analytics_client_operations.py index e575cdc93bb5..d497f4f9fe59 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/aio/operations/_text_analytics_client_operations.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/aio/operations/_text_analytics_client_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings from .....aio._lro_async import AsyncAnalyzeActionsLROPoller, AsyncAnalyzeActionsLROPollingMethod, AsyncAnalyzeHealthcareEntitiesLROPoller, AsyncAnalyzeHealthcareEntitiesLROPollingMethod 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.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.polling.async_base_polling import AsyncLROBasePolling +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from ... import models as _models +from ..._vendor import _convert_request +from ...operations._text_analytics_client_operations import build_analyze_request_initial, build_analyze_status_request, build_cancel_health_job_request_initial, build_entities_linking_request, build_entities_recognition_general_request, build_entities_recognition_pii_request, build_health_request_initial, build_health_status_request, build_key_phrases_request, build_languages_request, build_sentiment_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,53 +37,50 @@ async def _analyze_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } 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] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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] if body is not None: - body_content = self._serialize.body(body, 'AnalyzeBatchInput') + json = 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) + json = None + + request = build_analyze_request_initial( + content_type=content_type, + json=json, + template_url=self._analyze_initial.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) - response_headers = {} deserialized = None + response_headers = {} 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 + + @distributed_trace_async async def begin_analyze( self, body: Optional["_models.AnalyzeBatchInput"] = None, @@ -94,14 +96,19 @@ async def begin_analyze( :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: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + Pass in False for this operation to not poll, or pass in 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 AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response) - :rtype: ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.AnalyzeJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the + result of cls(response) + :rtype: + ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.AnalyzeJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeJobState"] lro_delay = kwargs.pop( 'polling_interval', @@ -111,25 +118,25 @@ async def begin_analyze( if cont_token is None: raw_result = await self._analyze_initial( body=body, + content_type=content_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): + response = pipeline_response.http_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), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = AsyncAnalyzeActionsLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncAnalyzeActionsLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -141,8 +148,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncAnalyzeActionsLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze.metadata = {'url': '/analyze'} # type: ignore + @distributed_trace_async async def analyze_status( self, job_id: str, @@ -178,36 +187,27 @@ async def analyze_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self.analyze_status.metadata['url'] # type: ignore + + request = build_analyze_status_request( + job_id=job_id, + show_stats=show_stats, + top=top, + skip=skip, + template_url=self.analyze_status.metadata['url'], + ) + request = _convert_request(request) 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'), + "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 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('AnalyzeJobState', pipeline_response) @@ -216,8 +216,11 @@ async def analyze_status( return cls(pipeline_response, deserialized, {}) return deserialized + analyze_status.metadata = {'url': '/analyze/jobs/{jobId}'} # type: ignore + + @distributed_trace_async async def health_status( self, job_id: str, @@ -251,36 +254,27 @@ async def health_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self.health_status.metadata['url'] # type: ignore + + request = build_health_status_request( + job_id=job_id, + top=top, + skip=skip, + show_stats=show_stats, + template_url=self.health_status.metadata['url'], + ) + request = _convert_request(request) 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'), + "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 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('HealthcareJobState', pipeline_response) @@ -289,8 +283,10 @@ async def health_status( 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, @@ -301,40 +297,36 @@ async def _cancel_health_job_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self._cancel_health_job_initial.metadata['url'] # type: ignore + + request = build_cancel_health_job_request_initial( + job_id=job_id, + template_url=self._cancel_health_job_initial.metadata['url'], + ) + request = _convert_request(request) 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'), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + 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 + + @distributed_trace_async async def begin_cancel_health_job( self, job_id: str, @@ -348,15 +340,17 @@ async def begin_cancel_health_job( :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: By default, your polling method will be AsyncLROBasePolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False + for this operation to not poll, or pass in 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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -369,20 +363,18 @@ async def begin_cancel_health_job( 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'), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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: @@ -394,6 +386,7 @@ def get_long_running_output(pipeline_response): ) 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( @@ -410,57 +403,50 @@ async def _health_initial( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self._health_initial.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_health_request_initial( + content_type=content_type, + model_version=model_version, + string_index_type=string_index_type, + logging_opt_out=logging_opt_out, + json=json, + template_url=self._health_initial.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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') - if logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) - response_headers = {} deserialized = None + response_headers = {} 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 + + @distributed_trace_async async def begin_health( self, documents: List["_models.MultiLanguageInput"], @@ -493,15 +479,20 @@ async def begin_health( :type logging_opt_out: bool :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: By default, your polling method will be AsyncAnalyzeHealthcareEntitiesLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be + AsyncAnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll, + or pass in 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 AsyncAnalyzeHealthcareEntitiesLROPoller that returns either HealthcareJobState or the result of cls(response) - :rtype: ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncAnalyzeHealthcareEntitiesLROPoller that returns either + HealthcareJobState or the result of cls(response) + :rtype: + ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.HealthcareJobState"] lro_delay = kwargs.pop( 'polling_interval', @@ -514,25 +505,25 @@ async def begin_health( model_version=model_version, string_index_type=string_index_type, logging_opt_out=logging_opt_out, + content_type=content_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): + response = pipeline_response.http_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), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = AsyncAnalyzeHealthcareEntitiesLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncAnalyzeHealthcareEntitiesLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -544,8 +535,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncAnalyzeHealthcareEntitiesLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_health.metadata = {'url': '/entities/health/jobs'} # type: ignore + @distributed_trace_async async def entities_recognition_general( self, documents: List["_models.MultiLanguageInput"], @@ -593,43 +586,32 @@ async def entities_recognition_general( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_recognition_general.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_recognition_general_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + string_index_type=string_index_type, + json=json, + template_url=self.entities_recognition_general.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntitiesResult', pipeline_response) @@ -638,8 +620,11 @@ async def entities_recognition_general( return cls(pipeline_response, deserialized, {}) return deserialized + entities_recognition_general.metadata = {'url': '/entities/recognition/general'} # type: ignore + + @distributed_trace_async async def entities_recognition_pii( self, documents: List["_models.MultiLanguageInput"], @@ -695,47 +680,34 @@ async def entities_recognition_pii( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_recognition_pii.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_recognition_pii_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + domain=domain, + string_index_type=string_index_type, + pii_categories=pii_categories, + json=json, + template_url=self.entities_recognition_pii.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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') - if pii_categories is not None: - query_parameters['piiCategories'] = self._serialize.query("pii_categories", pii_categories, '[str]', div=',') - - # 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PiiResult', pipeline_response) @@ -744,8 +716,11 @@ async def entities_recognition_pii( return cls(pipeline_response, deserialized, {}) return deserialized + entities_recognition_pii.metadata = {'url': '/entities/recognition/pii'} # type: ignore + + @distributed_trace_async async def entities_linking( self, documents: List["_models.MultiLanguageInput"], @@ -792,43 +767,32 @@ async def entities_linking( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_linking.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_linking_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + string_index_type=string_index_type, + json=json, + template_url=self.entities_linking.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntityLinkingResult', pipeline_response) @@ -837,8 +801,11 @@ async def entities_linking( return cls(pipeline_response, deserialized, {}) return deserialized + entities_linking.metadata = {'url': '/entities/linking'} # type: ignore + + @distributed_trace_async async def key_phrases( self, documents: List["_models.MultiLanguageInput"], @@ -880,41 +847,31 @@ async def key_phrases( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.key_phrases.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_key_phrases_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + json=json, + template_url=self.key_phrases.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('KeyPhraseResult', pipeline_response) @@ -923,8 +880,11 @@ async def key_phrases( return cls(pipeline_response, deserialized, {}) return deserialized + key_phrases.metadata = {'url': '/keyPhrases'} # type: ignore + + @distributed_trace_async async def languages( self, documents: List["_models.LanguageInput"], @@ -967,41 +927,31 @@ async def languages( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.languages.metadata['url'] # type: ignore + _input = _models.LanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'LanguageBatchInput') + + request = build_languages_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + json=json, + template_url=self.languages.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('LanguageResult', pipeline_response) @@ -1010,8 +960,11 @@ async def languages( return cls(pipeline_response, deserialized, {}) return deserialized + languages.metadata = {'url': '/languages'} # type: ignore + + @distributed_trace_async async def sentiment( self, documents: List["_models.MultiLanguageInput"], @@ -1062,45 +1015,33 @@ async def sentiment( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.sentiment.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_sentiment_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + opinion_mining=opinion_mining, + string_index_type=string_index_type, + json=json, + template_url=self.sentiment.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SentimentResponse', pipeline_response) @@ -1109,4 +1050,6 @@ async def sentiment( 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_2_preview_2/models/_models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_models.py index 064374a6b1e5..92e61a935ee7 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_models.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_models.py @@ -15,9 +15,9 @@ class AnalysisInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param analysis_input: Required. Contains a set of input documents to be analyzed by the + :ivar analysis_input: Required. Contains a set of input documents to be analyzed by the service. - :type analysis_input: ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput + :vartype analysis_input: ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput """ _validation = { @@ -32,6 +32,12 @@ def __init__( self, **kwargs ): + """ + :keyword analysis_input: Required. Contains a set of input documents to be analyzed by the + service. + :paramtype analysis_input: + ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput + """ super(AnalysisInput, self).__init__(**kwargs) self.analysis_input = kwargs['analysis_input'] @@ -41,9 +47,9 @@ class JobManifest(msrest.serialization.Model): 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 + :ivar 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_2_preview_2.models.JobManifestTasks + :vartype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.JobManifestTasks """ _validation = { @@ -58,6 +64,11 @@ def __init__( self, **kwargs ): + """ + :keyword tasks: Required. The set of tasks to execute on the input documents. Cannot specify + the same task more than once. + :paramtype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.JobManifestTasks + """ super(JobManifest, self).__init__(**kwargs) self.tasks = kwargs['tasks'] @@ -65,8 +76,8 @@ def __init__( class JobDescriptor(msrest.serialization.Model): """JobDescriptor. - :param display_name: Optional display name for the analysis job. - :type display_name: str + :ivar display_name: Optional display name for the analysis job. + :vartype display_name: str """ _attribute_map = { @@ -77,6 +88,10 @@ def __init__( self, **kwargs ): + """ + :keyword display_name: Optional display name for the analysis job. + :paramtype display_name: str + """ super(JobDescriptor, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) @@ -86,14 +101,14 @@ class AnalyzeBatchInput(JobDescriptor, AnalysisInput, 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 + :ivar 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_2_preview_2.models.JobManifestTasks - :param analysis_input: Required. Contains a set of input documents to be analyzed by the + :vartype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.JobManifestTasks + :ivar analysis_input: Required. Contains a set of input documents to be analyzed by the service. - :type analysis_input: ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput - :param display_name: Optional display name for the analysis job. - :type display_name: str + :vartype analysis_input: ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput + :ivar display_name: Optional display name for the analysis job. + :vartype display_name: str """ _validation = { @@ -111,6 +126,17 @@ def __init__( self, **kwargs ): + """ + :keyword tasks: Required. The set of tasks to execute on the input documents. Cannot specify + the same task more than once. + :paramtype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.JobManifestTasks + :keyword analysis_input: Required. Contains a set of input documents to be analyzed by the + service. + :paramtype analysis_input: + ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput + :keyword display_name: Optional display name for the analysis job. + :paramtype display_name: str + """ super(AnalyzeBatchInput, self).__init__(**kwargs) self.tasks = kwargs['tasks'] self.analysis_input = kwargs['analysis_input'] @@ -123,8 +149,8 @@ def __init__( class AnalyzeJobDisplayName(msrest.serialization.Model): """AnalyzeJobDisplayName. - :param display_name: - :type display_name: str + :ivar display_name: + :vartype display_name: str """ _attribute_map = { @@ -135,6 +161,10 @@ def __init__( self, **kwargs ): + """ + :keyword display_name: + :paramtype display_name: str + """ super(AnalyzeJobDisplayName, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) @@ -142,11 +172,11 @@ def __init__( class AnalyzeJobErrorsAndStatistics(msrest.serialization.Model): """AnalyzeJobErrorsAndStatistics. - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics """ _attribute_map = { @@ -158,6 +188,13 @@ def __init__( self, **kwargs ): + """ + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + """ super(AnalyzeJobErrorsAndStatistics, self).__init__(**kwargs) self.errors = kwargs.get('errors', None) self.statistics = kwargs.get('statistics', None) @@ -168,17 +205,17 @@ class JobMetadata(msrest.serialization.Model): 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", + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -200,6 +237,19 @@ def __init__( self, **kwargs ): + """ + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(JobMetadata, self).__init__(**kwargs) self.created_date_time = kwargs['created_date_time'] self.expiration_date_time = kwargs.get('expiration_date_time', None) @@ -213,19 +263,19 @@ class AnalyzeJobMetadata(JobMetadata, AnalyzeJobDisplayName): All required parameters must be populated in order to send to Azure. - :param display_name: - :type display_name: 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", + :ivar display_name: + :vartype display_name: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -248,6 +298,21 @@ def __init__( self, **kwargs ): + """ + :keyword display_name: + :paramtype display_name: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(AnalyzeJobMetadata, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) self.created_date_time = kwargs['created_date_time'] @@ -260,8 +325,8 @@ def __init__( class Pagination(msrest.serialization.Model): """Pagination. - :param next_link: - :type next_link: str + :ivar next_link: + :vartype next_link: str """ _attribute_map = { @@ -272,6 +337,10 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: + :paramtype next_link: str + """ super(Pagination, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) @@ -281,8 +350,8 @@ class TasksState(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks + :ivar tasks: Required. + :vartype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks """ _validation = { @@ -297,6 +366,10 @@ def __init__( self, **kwargs ): + """ + :keyword tasks: Required. + :paramtype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks + """ super(TasksState, self).__init__(**kwargs) self.tasks = kwargs['tasks'] @@ -306,28 +379,28 @@ class AnalyzeJobState(AnalyzeJobMetadata, TasksState, AnalyzeJobErrorsAndStatist All required parameters must be populated in order to send to Azure. - :param next_link: - :type next_link: str - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar next_link: + :vartype next_link: str + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks - :param display_name: - :type display_name: 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", + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar tasks: Required. + :vartype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks + :ivar display_name: + :vartype display_name: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -355,6 +428,30 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: + :paramtype next_link: str + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword tasks: Required. + :paramtype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks + :keyword display_name: + :paramtype display_name: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(AnalyzeJobState, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) self.errors = kwargs.get('errors', None) @@ -393,11 +490,11 @@ class ClassificationResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param category: Required. Classification type. - :type category: str - :param confidence_score: Required. Confidence score between 0 and 1 of the recognized + :ivar category: Required. Classification type. + :vartype category: str + :ivar confidence_score: Required. Confidence score between 0 and 1 of the recognized classification. - :type confidence_score: float + :vartype confidence_score: float """ _validation = { @@ -414,6 +511,13 @@ def __init__( self, **kwargs ): + """ + :keyword category: Required. Classification type. + :paramtype category: str + :keyword confidence_score: Required. Confidence score between 0 and 1 of the recognized + classification. + :paramtype confidence_score: float + """ super(ClassificationResult, self).__init__(**kwargs) self.category = kwargs['category'] self.confidence_score = kwargs['confidence_score'] @@ -424,17 +528,17 @@ class CustomEntitiesResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param project_name: Required. This field indicates the project name for the model. - :type project_name: str - :param deployment_name: Required. This field indicates the deployment name for the model. - :type deployment_name: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar project_name: Required. This field indicates the project name for the model. + :vartype project_name: str + :ivar deployment_name: Required. This field indicates the deployment name for the model. + :vartype deployment_name: str """ _validation = { @@ -456,6 +560,19 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword project_name: Required. This field indicates the project name for the model. + :paramtype project_name: str + :keyword deployment_name: Required. This field indicates the deployment name for the model. + :paramtype deployment_name: str + """ super(CustomEntitiesResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -467,10 +584,10 @@ def __init__( class CustomEntitiesTask(msrest.serialization.Model): """CustomEntitiesTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -482,6 +599,13 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(CustomEntitiesTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -492,15 +616,16 @@ class CustomEntitiesTaskParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param project_name: Required. - :type project_name: str - :param deployment_name: Required. - :type deployment_name: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar project_name: Required. + :vartype project_name: str + :ivar deployment_name: Required. + :vartype deployment_name: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType """ _validation = { @@ -509,8 +634,8 @@ class CustomEntitiesTaskParameters(msrest.serialization.Model): } _attribute_map = { - 'project_name': {'key': 'projectName', 'type': 'str'}, - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + 'project_name': {'key': 'project-name', 'type': 'str'}, + 'deployment_name': {'key': 'deployment-name', 'type': 'str'}, 'logging_opt_out': {'key': 'loggingOptOut', 'type': 'bool'}, 'string_index_type': {'key': 'stringIndexType', 'type': 'str'}, } @@ -519,6 +644,18 @@ def __init__( self, **kwargs ): + """ + :keyword project_name: Required. + :paramtype project_name: str + :keyword deployment_name: Required. + :paramtype deployment_name: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + """ super(CustomEntitiesTaskParameters, self).__init__(**kwargs) self.project_name = kwargs['project_name'] self.deployment_name = kwargs['deployment_name'] @@ -529,8 +666,8 @@ def __init__( class CustomEntitiesTaskResult(msrest.serialization.Model): """CustomEntitiesTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult """ _attribute_map = { @@ -541,6 +678,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult + """ super(CustomEntitiesTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -550,18 +691,18 @@ class CustomMultiClassificationResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param documents: Required. Response by document. - :type documents: + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.MultiClassificationDocument] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param project_name: Required. This field indicates the project name for the model. - :type project_name: str - :param deployment_name: Required. This field indicates the deployment name for the model. - :type deployment_name: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar project_name: Required. This field indicates the project name for the model. + :vartype project_name: str + :ivar deployment_name: Required. This field indicates the deployment name for the model. + :vartype deployment_name: str """ _validation = { @@ -583,6 +724,20 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.MultiClassificationDocument] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword project_name: Required. This field indicates the project name for the model. + :paramtype project_name: str + :keyword deployment_name: Required. This field indicates the deployment name for the model. + :paramtype deployment_name: str + """ super(CustomMultiClassificationResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -594,11 +749,11 @@ def __init__( class CustomMultiClassificationTask(msrest.serialization.Model): """CustomMultiClassificationTask. - :param parameters: - :type parameters: + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationTaskParameters - :param task_name: - :type task_name: str + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -610,6 +765,13 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(CustomMultiClassificationTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -620,12 +782,12 @@ class CustomMultiClassificationTaskParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param project_name: Required. - :type project_name: str - :param deployment_name: Required. - :type deployment_name: str - :param logging_opt_out: - :type logging_opt_out: bool + :ivar project_name: Required. + :vartype project_name: str + :ivar deployment_name: Required. + :vartype deployment_name: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool """ _validation = { @@ -634,8 +796,8 @@ class CustomMultiClassificationTaskParameters(msrest.serialization.Model): } _attribute_map = { - 'project_name': {'key': 'projectName', 'type': 'str'}, - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + 'project_name': {'key': 'project-name', 'type': 'str'}, + 'deployment_name': {'key': 'deployment-name', 'type': 'str'}, 'logging_opt_out': {'key': 'loggingOptOut', 'type': 'bool'}, } @@ -643,6 +805,14 @@ def __init__( self, **kwargs ): + """ + :keyword project_name: Required. + :paramtype project_name: str + :keyword deployment_name: Required. + :paramtype deployment_name: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + """ super(CustomMultiClassificationTaskParameters, self).__init__(**kwargs) self.project_name = kwargs['project_name'] self.deployment_name = kwargs['deployment_name'] @@ -652,8 +822,8 @@ def __init__( class CustomMultiClassificationTaskResult(msrest.serialization.Model): """CustomMultiClassificationTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult """ _attribute_map = { @@ -664,6 +834,11 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult + """ super(CustomMultiClassificationTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -673,18 +848,18 @@ class CustomSingleClassificationResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param documents: Required. Response by document. - :type documents: + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.SingleClassificationDocument] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param project_name: Required. This field indicates the project name for the model. - :type project_name: str - :param deployment_name: Required. This field indicates the deployment name for the model. - :type deployment_name: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar project_name: Required. This field indicates the project name for the model. + :vartype project_name: str + :ivar deployment_name: Required. This field indicates the deployment name for the model. + :vartype deployment_name: str """ _validation = { @@ -706,6 +881,20 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.SingleClassificationDocument] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword project_name: Required. This field indicates the project name for the model. + :paramtype project_name: str + :keyword deployment_name: Required. This field indicates the deployment name for the model. + :paramtype deployment_name: str + """ super(CustomSingleClassificationResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -717,11 +906,11 @@ def __init__( class CustomSingleClassificationTask(msrest.serialization.Model): """CustomSingleClassificationTask. - :param parameters: - :type parameters: + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationTaskParameters - :param task_name: - :type task_name: str + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -733,6 +922,13 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(CustomSingleClassificationTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -743,12 +939,12 @@ class CustomSingleClassificationTaskParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param project_name: Required. - :type project_name: str - :param deployment_name: Required. - :type deployment_name: str - :param logging_opt_out: - :type logging_opt_out: bool + :ivar project_name: Required. + :vartype project_name: str + :ivar deployment_name: Required. + :vartype deployment_name: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool """ _validation = { @@ -757,8 +953,8 @@ class CustomSingleClassificationTaskParameters(msrest.serialization.Model): } _attribute_map = { - 'project_name': {'key': 'projectName', 'type': 'str'}, - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + 'project_name': {'key': 'project-name', 'type': 'str'}, + 'deployment_name': {'key': 'deployment-name', 'type': 'str'}, 'logging_opt_out': {'key': 'loggingOptOut', 'type': 'bool'}, } @@ -766,6 +962,14 @@ def __init__( self, **kwargs ): + """ + :keyword project_name: Required. + :paramtype project_name: str + :keyword deployment_name: Required. + :paramtype deployment_name: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + """ super(CustomSingleClassificationTaskParameters, self).__init__(**kwargs) self.project_name = kwargs['project_name'] self.deployment_name = kwargs['deployment_name'] @@ -775,8 +979,9 @@ def __init__( class CustomSingleClassificationTaskResult(msrest.serialization.Model): """CustomSingleClassificationTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult + :ivar results: + :vartype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult """ _attribute_map = { @@ -787,6 +992,11 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult + """ super(CustomSingleClassificationTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -796,14 +1006,14 @@ class DetectedLanguage(msrest.serialization.Model): 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 + :ivar name: Required. Long name of a detected language (e.g. English, French). + :vartype name: str + :ivar iso6391_name: Required. A two letter representation of the detected language according to + the ISO 639-1 standard (e.g. en, fr). + :vartype iso6391_name: str + :ivar 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 + :vartype confidence_score: float """ _validation = { @@ -822,6 +1032,16 @@ def __init__( self, **kwargs ): + """ + :keyword name: Required. Long name of a detected language (e.g. English, French). + :paramtype name: str + :keyword iso6391_name: Required. A two letter representation of the detected language according + to the ISO 639-1 standard (e.g. en, fr). + :paramtype iso6391_name: str + :keyword confidence_score: Required. A confidence score between 0 and 1. Scores close to 1 + indicate 100% certainty that the identified language is true. + :paramtype confidence_score: float + """ super(DetectedLanguage, self).__init__(**kwargs) self.name = kwargs['name'] self.iso6391_name = kwargs['iso6391_name'] @@ -833,15 +1053,15 @@ class DocumentEntities(msrest.serialization.Model): 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_2_preview_2.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.Entity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -861,6 +1081,17 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.Entity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(DocumentEntities, self).__init__(**kwargs) self.id = kwargs['id'] self.entities = kwargs['entities'] @@ -873,10 +1104,10 @@ class DocumentError(msrest.serialization.Model): 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_2_preview_2.models.TextAnalyticsError + :ivar id: Required. Document Id. + :vartype id: str + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError """ _validation = { @@ -893,6 +1124,12 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Document Id. + :paramtype id: str + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError + """ super(DocumentError, self).__init__(**kwargs) self.id = kwargs['id'] self.error = kwargs['error'] @@ -903,17 +1140,17 @@ class DocumentHealthcareEntities(msrest.serialization.Model): 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_2_preview_2.models.HealthcareEntity] - :param relations: Required. Healthcare entity relations. - :type relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelation] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Healthcare entities. + :vartype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntity] + :ivar relations: Required. Healthcare entity relations. + :vartype relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelation] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -935,6 +1172,19 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Healthcare entities. + :paramtype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntity] + :keyword relations: Required. Healthcare entity relations. + :paramtype relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelation] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(DocumentHealthcareEntities, self).__init__(**kwargs) self.id = kwargs['id'] self.entities = kwargs['entities'] @@ -948,16 +1198,16 @@ class DocumentKeyPhrases(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :vartype key_phrases: list[str] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -977,6 +1227,18 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword 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. + :paramtype key_phrases: list[str] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(DocumentKeyPhrases, self).__init__(**kwargs) self.id = kwargs['id'] self.key_phrases = kwargs['key_phrases'] @@ -989,15 +1251,15 @@ class DocumentLanguage(msrest.serialization.Model): 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_2_preview_2.models.DetectedLanguage - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar detected_language: Required. Detected Language. + :vartype detected_language: ~azure.ai.textanalytics.v3_2_preview_2.models.DetectedLanguage + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -1017,6 +1279,17 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword detected_language: Required. Detected Language. + :paramtype detected_language: ~azure.ai.textanalytics.v3_2_preview_2.models.DetectedLanguage + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(DocumentLanguage, self).__init__(**kwargs) self.id = kwargs['id'] self.detected_language = kwargs['detected_language'] @@ -1029,15 +1302,15 @@ class DocumentLinkedEntities(msrest.serialization.Model): 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_2_preview_2.models.LinkedEntity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized well known entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.LinkedEntity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -1057,6 +1330,17 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized well known entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.LinkedEntity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(DocumentLinkedEntities, self).__init__(**kwargs) self.id = kwargs['id'] self.entities = kwargs['entities'] @@ -1069,22 +1353,22 @@ class DocumentSentiment(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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_2_preview_2.models.DocumentSentimentValue - :param statistics: if showStats=true was specified in the request this field will contain + :vartype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentSentimentValue + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics - :param confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :ivar confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 for each sentiment class. - :type confidence_scores: + :vartype confidence_scores: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentConfidenceScorePerLabel - :param sentences: Required. Sentence level sentiment analysis. - :type sentences: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentiment] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar sentences: Required. Sentence level sentiment analysis. + :vartype sentences: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentiment] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] """ _validation = { @@ -1108,6 +1392,25 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword sentiment: Required. Predicted sentiment for document (Negative, Neutral, Positive, or + Mixed). Possible values include: "positive", "neutral", "negative", "mixed". + :paramtype sentiment: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentSentimentValue + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :keyword confidence_scores: Required. Document level sentiment confidence scores between 0 and + 1 for each sentiment class. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentConfidenceScorePerLabel + :keyword sentences: Required. Sentence level sentiment analysis. + :paramtype sentences: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentiment] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + """ super(DocumentSentiment, self).__init__(**kwargs) self.id = kwargs['id'] self.sentiment = kwargs['sentiment'] @@ -1122,10 +1425,10 @@ class DocumentStatistics(msrest.serialization.Model): 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 + :ivar characters_count: Required. Number of text elements recognized in the document. + :vartype characters_count: int + :ivar transactions_count: Required. Number of transactions for the document. + :vartype transactions_count: int """ _validation = { @@ -1142,6 +1445,12 @@ def __init__( self, **kwargs ): + """ + :keyword characters_count: Required. Number of text elements recognized in the document. + :paramtype characters_count: int + :keyword transactions_count: Required. Number of transactions for the document. + :paramtype transactions_count: int + """ super(DocumentStatistics, self).__init__(**kwargs) self.characters_count = kwargs['characters_count'] self.transactions_count = kwargs['transactions_count'] @@ -1152,15 +1461,15 @@ class EntitiesResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1180,6 +1489,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntitiesResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -1190,10 +1510,10 @@ def __init__( class EntitiesTask(msrest.serialization.Model): """EntitiesTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -1205,6 +1525,12 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(EntitiesTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -1213,13 +1539,14 @@ def __init__( class EntitiesTaskParameters(msrest.serialization.Model): """EntitiesTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType """ _attribute_map = { @@ -1232,6 +1559,16 @@ def __init__( self, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + """ super(EntitiesTaskParameters, self).__init__(**kwargs) self.model_version = kwargs.get('model_version', "latest") self.logging_opt_out = kwargs.get('logging_opt_out', False) @@ -1241,8 +1578,8 @@ def __init__( class EntitiesTaskResult(msrest.serialization.Model): """EntitiesTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult """ _attribute_map = { @@ -1253,6 +1590,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult + """ super(EntitiesTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -1262,20 +1603,20 @@ class Entity(msrest.serialization.Model): 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' + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Entity type. + :vartype category: str + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -1299,6 +1640,22 @@ def __init__( self, **kwargs ): + """ + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Entity type. + :paramtype category: str + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(Entity, self).__init__(**kwargs) self.text = kwargs['text'] self.category = kwargs['category'] @@ -1313,15 +1670,15 @@ class EntityLinkingResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentLinkedEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentLinkedEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1341,6 +1698,18 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentLinkedEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntityLinkingResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -1351,10 +1720,10 @@ def __init__( class EntityLinkingTask(msrest.serialization.Model): """EntityLinkingTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -1366,6 +1735,13 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(EntityLinkingTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -1374,13 +1750,14 @@ def __init__( class EntityLinkingTaskParameters(msrest.serialization.Model): """EntityLinkingTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType """ _attribute_map = { @@ -1393,6 +1770,16 @@ def __init__( self, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + """ super(EntityLinkingTaskParameters, self).__init__(**kwargs) self.model_version = kwargs.get('model_version', "latest") self.logging_opt_out = kwargs.get('logging_opt_out', False) @@ -1402,8 +1789,8 @@ def __init__( class EntityLinkingTaskResult(msrest.serialization.Model): """EntityLinkingTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult """ _attribute_map = { @@ -1414,6 +1801,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult + """ super(EntityLinkingTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -1423,8 +1814,8 @@ class ErrorResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param error: Required. Document Error. - :type error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError """ _validation = { @@ -1439,6 +1830,10 @@ def __init__( self, **kwargs ): + """ + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError + """ super(ErrorResponse, self).__init__(**kwargs) self.error = kwargs['error'] @@ -1448,15 +1843,16 @@ class ExtractedDocumentSummary(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param sentences: Required. A ranked list of sentences representing the extracted summary. - :type sentences: list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractedSummarySentence] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar sentences: Required. A ranked list of sentences representing the extracted summary. + :vartype sentences: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractedSummarySentence] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -1476,6 +1872,18 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword sentences: Required. A ranked list of sentences representing the extracted summary. + :paramtype sentences: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractedSummarySentence] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(ExtractedDocumentSummary, self).__init__(**kwargs) self.id = kwargs['id'] self.sentences = kwargs['sentences'] @@ -1488,16 +1896,16 @@ class ExtractedSummarySentence(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param text: Required. The extracted sentence text. - :type text: str - :param rank_score: Required. A double value representing the relevance of the sentence within + :ivar text: Required. The extracted sentence text. + :vartype text: str + :ivar rank_score: Required. A double value representing the relevance of the sentence within the summary. Higher values indicate higher importance. - :type rank_score: float - :param offset: Required. The sentence offset from the start of the document, based on the value + :vartype rank_score: float + :ivar offset: Required. The sentence offset from the start of the document, based on the value of the parameter StringIndexType. - :type offset: int - :param length: Required. The length of the sentence. - :type length: int + :vartype offset: int + :ivar length: Required. The length of the sentence. + :vartype length: int """ _validation = { @@ -1518,6 +1926,18 @@ def __init__( self, **kwargs ): + """ + :keyword text: Required. The extracted sentence text. + :paramtype text: str + :keyword rank_score: Required. A double value representing the relevance of the sentence within + the summary. Higher values indicate higher importance. + :paramtype rank_score: float + :keyword offset: Required. The sentence offset from the start of the document, based on the + value of the parameter StringIndexType. + :paramtype offset: int + :keyword length: Required. The length of the sentence. + :paramtype length: int + """ super(ExtractedSummarySentence, self).__init__(**kwargs) self.text = kwargs['text'] self.rank_score = kwargs['rank_score'] @@ -1530,15 +1950,16 @@ class ExtractiveSummarizationResult(msrest.serialization.Model): 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_2_preview_2.models.ExtractedDocumentSummary] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractedDocumentSummary] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1558,6 +1979,18 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractedDocumentSummary] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(ExtractiveSummarizationResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -1568,11 +2001,11 @@ def __init__( class ExtractiveSummarizationTask(msrest.serialization.Model): """ExtractiveSummarizationTask. - :param parameters: - :type parameters: + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTaskParameters - :param task_name: - :type task_name: str + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -1584,6 +2017,13 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(ExtractiveSummarizationTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -1592,17 +2032,18 @@ def __init__( class ExtractiveSummarizationTaskParameters(msrest.serialization.Model): """ExtractiveSummarizationTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType - :param sentence_count: - :type sentence_count: int - :param sort_by: Possible values include: "Offset", "Rank". Default value: "Offset". - :type sort_by: str or + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :ivar sentence_count: + :vartype sentence_count: int + :ivar sort_by: Possible values include: "Offset", "Rank". Default value: "Offset". + :vartype sort_by: str or ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTaskParametersSortBy """ @@ -1618,6 +2059,21 @@ def __init__( self, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :keyword sentence_count: + :paramtype sentence_count: int + :keyword sort_by: Possible values include: "Offset", "Rank". Default value: "Offset". + :paramtype sort_by: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTaskParametersSortBy + """ super(ExtractiveSummarizationTaskParameters, self).__init__(**kwargs) self.model_version = kwargs.get('model_version', "latest") self.logging_opt_out = kwargs.get('logging_opt_out', False) @@ -1629,8 +2085,8 @@ def __init__( class ExtractiveSummarizationTaskResult(msrest.serialization.Model): """ExtractiveSummarizationTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult """ _attribute_map = { @@ -1641,6 +2097,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult + """ super(ExtractiveSummarizationTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -1648,15 +2108,15 @@ def __init__( class HealthcareAssertion(msrest.serialization.Model): """HealthcareAssertion. - :param conditionality: Describes any conditionality on the entity. Possible values include: + :ivar conditionality: Describes any conditionality on the entity. Possible values include: "hypothetical", "conditional". - :type conditionality: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Conditionality - :param certainty: Describes the entities certainty and polarity. Possible values include: + :vartype conditionality: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Conditionality + :ivar certainty: Describes the entities certainty and polarity. Possible values include: "positive", "positivePossible", "neutralPossible", "negativePossible", "negative". - :type certainty: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Certainty - :param association: Describes if the entity is the subject of the text or if it describes + :vartype certainty: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Certainty + :ivar association: Describes if the entity is the subject of the text or if it describes someone else. Possible values include: "subject", "other". - :type association: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Association + :vartype association: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Association """ _attribute_map = { @@ -1669,6 +2129,17 @@ def __init__( self, **kwargs ): + """ + :keyword conditionality: Describes any conditionality on the entity. Possible values include: + "hypothetical", "conditional". + :paramtype conditionality: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Conditionality + :keyword certainty: Describes the entities certainty and polarity. Possible values include: + "positive", "positivePossible", "neutralPossible", "negativePossible", "negative". + :paramtype certainty: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Certainty + :keyword association: Describes if the entity is the subject of the text or if it describes + someone else. Possible values include: "subject", "other". + :paramtype association: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Association + """ super(HealthcareAssertion, self).__init__(**kwargs) self.conditionality = kwargs.get('conditionality', None) self.certainty = kwargs.get('certainty', None) @@ -1678,13 +2149,13 @@ def __init__( class HealthcareLinkingProperties(msrest.serialization.Model): """HealthcareLinkingProperties. - :param assertion: - :type assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion - :param name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + :ivar assertion: + :vartype assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion + :ivar name: Preferred name for the entity. Example: 'histologically' would have a 'name' of 'histologic'. - :type name: str - :param links: Entity references in known data sources. - :type links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] + :vartype name: str + :ivar links: Entity references in known data sources. + :vartype links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] """ _attribute_map = { @@ -1697,6 +2168,15 @@ def __init__( self, **kwargs ): + """ + :keyword assertion: + :paramtype assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion + :keyword name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + 'histologic'. + :paramtype name: str + :keyword links: Entity references in known data sources. + :paramtype links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] + """ super(HealthcareLinkingProperties, self).__init__(**kwargs) self.assertion = kwargs.get('assertion', None) self.name = kwargs.get('name', None) @@ -1708,25 +2188,26 @@ class HealthcareEntityProperties(msrest.serialization.Model): 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. Healthcare Entity Category. Possible values include: + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Healthcare Entity Category. Possible values include: "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". - :type category: str or ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' + :vartype category: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -1750,6 +2231,28 @@ def __init__( self, **kwargs ): + """ + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Healthcare Entity Category. Possible values include: + "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", + "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", + "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", + "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", + "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". + :paramtype category: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(HealthcareEntityProperties, self).__init__(**kwargs) self.text = kwargs['text'] self.category = kwargs['category'] @@ -1764,32 +2267,33 @@ class HealthcareEntity(HealthcareEntityProperties, HealthcareLinkingProperties): All required parameters must be populated in order to send to Azure. - :param assertion: - :type assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion - :param name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + :ivar assertion: + :vartype assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion + :ivar name: Preferred name for the entity. Example: 'histologically' would have a 'name' of 'histologic'. - :type name: str - :param links: Entity references in known data sources. - :type links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] - :param text: Required. Entity text as appears in the request. - :type text: str - :param category: Required. Healthcare Entity Category. Possible values include: + :vartype name: str + :ivar links: Entity references in known data sources. + :vartype links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Healthcare Entity Category. Possible values include: "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". - :type category: str or ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' + :vartype category: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -1816,6 +2320,35 @@ def __init__( self, **kwargs ): + """ + :keyword assertion: + :paramtype assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion + :keyword name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + 'histologic'. + :paramtype name: str + :keyword links: Entity references in known data sources. + :paramtype links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Healthcare Entity Category. Possible values include: + "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", + "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", + "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", + "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", + "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". + :paramtype category: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(HealthcareEntity, self).__init__(**kwargs) self.assertion = kwargs.get('assertion', None) self.name = kwargs.get('name', None) @@ -1833,10 +2366,10 @@ class HealthcareEntityLink(msrest.serialization.Model): 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 + :ivar data_source: Required. Entity Catalog. Examples include: UMLS, CHV, MSH, etc. + :vartype data_source: str + :ivar id: Required. Entity id in the given source catalog. + :vartype id: str """ _validation = { @@ -1853,6 +2386,12 @@ def __init__( self, **kwargs ): + """ + :keyword data_source: Required. Entity Catalog. Examples include: UMLS, CHV, MSH, etc. + :paramtype data_source: str + :keyword id: Required. Entity id in the given source catalog. + :paramtype id: str + """ super(HealthcareEntityLink, self).__init__(**kwargs) self.data_source = kwargs['data_source'] self.id = kwargs['id'] @@ -1861,10 +2400,10 @@ def __init__( class HealthcareTaskResult(msrest.serialization.Model): """HealthcareTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] """ _attribute_map = { @@ -1876,6 +2415,12 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + """ super(HealthcareTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.errors = kwargs.get('errors', None) @@ -1886,23 +2431,23 @@ class HealthcareJobState(JobMetadata, Pagination, HealthcareTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] - :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", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :ivar next_link: + :vartype next_link: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -1927,6 +2472,25 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :keyword next_link: + :paramtype next_link: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(HealthcareJobState, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.errors = kwargs.get('errors', None) @@ -1951,16 +2515,16 @@ class HealthcareRelation(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or + :ivar relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or 'FrequencyOfMedication', etc. Possible values include: "Abbreviation", "DirectionOfBodyStructure", "DirectionOfCondition", "DirectionOfExamination", "DirectionOfTreatment", "DosageOfMedication", "FormOfMedication", "FrequencyOfMedication", "FrequencyOfTreatment", "QualifierOfCondition", "RelationOfExamination", "RouteOfMedication", "TimeOfCondition", "TimeOfEvent", "TimeOfExamination", "TimeOfMedication", "TimeOfTreatment", "UnitOfCondition", "UnitOfExamination", "ValueOfCondition", "ValueOfExamination". - :type relation_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.RelationType - :param entities: Required. The entities in the relation. - :type entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelationEntity] + :vartype relation_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.RelationType + :ivar entities: Required. The entities in the relation. + :vartype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelationEntity] """ _validation = { @@ -1977,6 +2541,19 @@ def __init__( self, **kwargs ): + """ + :keyword relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or + 'FrequencyOfMedication', etc. Possible values include: "Abbreviation", + "DirectionOfBodyStructure", "DirectionOfCondition", "DirectionOfExamination", + "DirectionOfTreatment", "DosageOfMedication", "FormOfMedication", "FrequencyOfMedication", + "FrequencyOfTreatment", "QualifierOfCondition", "RelationOfExamination", "RouteOfMedication", + "TimeOfCondition", "TimeOfEvent", "TimeOfExamination", "TimeOfMedication", "TimeOfTreatment", + "UnitOfCondition", "UnitOfExamination", "ValueOfCondition", "ValueOfExamination". + :paramtype relation_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.RelationType + :keyword entities: Required. The entities in the relation. + :paramtype entities: + list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelationEntity] + """ super(HealthcareRelation, self).__init__(**kwargs) self.relation_type = kwargs['relation_type'] self.entities = kwargs['entities'] @@ -1987,13 +2564,13 @@ class HealthcareRelationEntity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment + :ivar ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment Identifier Representation), pointing to the entity . - :type ref: str - :param role: Required. Role of entity in the relationship. For example: 'CD20-positive diffuse + :vartype ref: str + :ivar role: Required. Role of entity in the relationship. For example: 'CD20-positive diffuse large B-cell lymphoma' has the following entities with their roles in parenthesis: CD20 (GeneOrProtein), Positive (Expression), diffuse large B-cell lymphoma (Diagnosis). - :type role: str + :vartype role: str """ _validation = { @@ -2010,6 +2587,15 @@ def __init__( self, **kwargs ): + """ + :keyword ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment + Identifier Representation), pointing to the entity . + :paramtype ref: str + :keyword role: Required. Role of entity in the relationship. For example: 'CD20-positive + diffuse large B-cell lymphoma' has the following entities with their roles in parenthesis: + CD20 (GeneOrProtein), Positive (Expression), diffuse large B-cell lymphoma (Diagnosis). + :paramtype role: str + """ super(HealthcareRelationEntity, self).__init__(**kwargs) self.ref = kwargs['ref'] self.role = kwargs['role'] @@ -2020,15 +2606,16 @@ class HealthcareResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentHealthcareEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentHealthcareEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2048,6 +2635,18 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentHealthcareEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(HealthcareResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -2060,19 +2659,19 @@ class InnerError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "InvalidParameterValue", + :ivar code: Required. Error code. Possible values include: "InvalidParameterValue", "InvalidRequestBodyFormat", "EmptyRequest", "MissingInputRecords", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", "InvalidCountryHint". - :type code: str or ~azure.ai.textanalytics.v3_2_preview_2.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_2_preview_2.models.InnerError + :vartype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.InnerErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar details: Error details. + :vartype details: dict[str, str] + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_2_preview_2.models.InnerError """ _validation = { @@ -2092,6 +2691,21 @@ def __init__( self, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "InvalidParameterValue", + "InvalidRequestBodyFormat", "EmptyRequest", "MissingInputRecords", "InvalidDocument", + "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", + "InvalidCountryHint". + :paramtype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.InnerErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword details: Error details. + :paramtype details: dict[str, str] + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_2_preview_2.models.InnerError + """ super(InnerError, self).__init__(**kwargs) self.code = kwargs['code'] self.message = kwargs['message'] @@ -2103,31 +2717,32 @@ def __init__( 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: + :ivar entity_recognition_tasks: + :vartype entity_recognition_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesTask] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.PiiTask] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: + :ivar entity_recognition_pii_tasks: + :vartype entity_recognition_pii_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.PiiTask] + :ivar key_phrase_extraction_tasks: + :vartype key_phrase_extraction_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhrasesTask] - :param entity_linking_tasks: - :type entity_linking_tasks: + :ivar entity_linking_tasks: + :vartype entity_linking_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingTask] - :param sentiment_analysis_tasks: - :type sentiment_analysis_tasks: + :ivar sentiment_analysis_tasks: + :vartype sentiment_analysis_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentimentAnalysisTask] - :param extractive_summarization_tasks: - :type extractive_summarization_tasks: + :ivar extractive_summarization_tasks: + :vartype extractive_summarization_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTask] - :param custom_entity_recognition_tasks: - :type custom_entity_recognition_tasks: + :ivar custom_entity_recognition_tasks: + :vartype custom_entity_recognition_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesTask] - :param custom_single_classification_tasks: - :type custom_single_classification_tasks: + :ivar custom_single_classification_tasks: + :vartype custom_single_classification_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationTask] - :param custom_multi_classification_tasks: - :type custom_multi_classification_tasks: + :ivar custom_multi_classification_tasks: + :vartype custom_multi_classification_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationTask] """ @@ -2147,6 +2762,35 @@ def __init__( self, **kwargs ): + """ + :keyword entity_recognition_tasks: + :paramtype entity_recognition_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesTask] + :keyword entity_recognition_pii_tasks: + :paramtype entity_recognition_pii_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.PiiTask] + :keyword key_phrase_extraction_tasks: + :paramtype key_phrase_extraction_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhrasesTask] + :keyword entity_linking_tasks: + :paramtype entity_linking_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingTask] + :keyword sentiment_analysis_tasks: + :paramtype sentiment_analysis_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.SentimentAnalysisTask] + :keyword extractive_summarization_tasks: + :paramtype extractive_summarization_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTask] + :keyword custom_entity_recognition_tasks: + :paramtype custom_entity_recognition_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesTask] + :keyword custom_single_classification_tasks: + :paramtype custom_single_classification_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationTask] + :keyword custom_multi_classification_tasks: + :paramtype custom_multi_classification_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationTask] + """ 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) @@ -2164,15 +2808,15 @@ class KeyPhraseResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentKeyPhrases] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentKeyPhrases] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2192,6 +2836,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentKeyPhrases] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(KeyPhraseResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -2202,10 +2857,10 @@ def __init__( class KeyPhrasesTask(msrest.serialization.Model): """KeyPhrasesTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhrasesTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhrasesTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -2217,6 +2872,12 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhrasesTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(KeyPhrasesTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -2225,10 +2886,10 @@ def __init__( class KeyPhrasesTaskParameters(msrest.serialization.Model): """KeyPhrasesTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool """ _attribute_map = { @@ -2240,6 +2901,12 @@ def __init__( self, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + """ super(KeyPhrasesTaskParameters, self).__init__(**kwargs) self.model_version = kwargs.get('model_version', "latest") self.logging_opt_out = kwargs.get('logging_opt_out', False) @@ -2248,8 +2915,8 @@ def __init__( class KeyPhraseTaskResult(msrest.serialization.Model): """KeyPhraseTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult """ _attribute_map = { @@ -2260,6 +2927,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult + """ super(KeyPhraseTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -2269,8 +2940,8 @@ class LanguageBatchInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param documents: Required. - :type documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.LanguageInput] + :ivar documents: Required. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.LanguageInput] """ _validation = { @@ -2285,6 +2956,10 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.LanguageInput] + """ super(LanguageBatchInput, self).__init__(**kwargs) self.documents = kwargs['documents'] @@ -2294,12 +2969,12 @@ class LanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. + :vartype text: str + :ivar country_hint: + :vartype country_hint: str """ _validation = { @@ -2317,6 +2992,14 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. + :paramtype text: str + :keyword country_hint: + :paramtype country_hint: str + """ super(LanguageInput, self).__init__(**kwargs) self.id = kwargs['id'] self.text = kwargs['text'] @@ -2328,15 +3011,15 @@ class LanguageResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentLanguage] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentLanguage] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2356,6 +3039,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentLanguage] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(LanguageResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -2368,21 +3062,20 @@ class LinkedEntity(msrest.serialization.Model): 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_2_preview_2.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 + :ivar name: Required. Entity Linking formal name. + :vartype name: str + :ivar matches: Required. List of instances this entity appears in the text. + :vartype matches: list[~azure.ai.textanalytics.v3_2_preview_2.models.Match] + :ivar language: Required. Language used in the data source. + :vartype language: str + :ivar id: Unique identifier of the recognized entity from the data source. + :vartype id: str + :ivar url: Required. URL for the entity's page from the data source. + :vartype url: str + :ivar data_source: Required. Data source used to extract entity linking, such as Wiki/Bing etc. + :vartype data_source: str + :ivar bing_id: Bing Entity Search API unique identifier of the recognized entity. + :vartype bing_id: str """ _validation = { @@ -2407,6 +3100,23 @@ def __init__( self, **kwargs ): + """ + :keyword name: Required. Entity Linking formal name. + :paramtype name: str + :keyword matches: Required. List of instances this entity appears in the text. + :paramtype matches: list[~azure.ai.textanalytics.v3_2_preview_2.models.Match] + :keyword language: Required. Language used in the data source. + :paramtype language: str + :keyword id: Unique identifier of the recognized entity from the data source. + :paramtype id: str + :keyword url: Required. URL for the entity's page from the data source. + :paramtype url: str + :keyword data_source: Required. Data source used to extract entity linking, such as Wiki/Bing + etc. + :paramtype data_source: str + :keyword bing_id: Bing Entity Search API unique identifier of the recognized entity. + :paramtype bing_id: str + """ super(LinkedEntity, self).__init__(**kwargs) self.name = kwargs['name'] self.matches = kwargs['matches'] @@ -2422,15 +3132,15 @@ class Match(msrest.serialization.Model): 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 + :ivar confidence_score: Required. If a well known item is recognized, a decimal number denoting + the confidence level between 0 and 1 will be returned. + :vartype confidence_score: float + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar offset: Required. Start position for the entity match text. + :vartype offset: int + :ivar length: Required. Length for the entity match text. + :vartype length: int """ _validation = { @@ -2451,6 +3161,17 @@ def __init__( self, **kwargs ): + """ + :keyword confidence_score: Required. If a well known item is recognized, a decimal number + denoting the confidence level between 0 and 1 will be returned. + :paramtype confidence_score: float + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword offset: Required. Start position for the entity match text. + :paramtype offset: int + :keyword length: Required. Length for the entity match text. + :paramtype length: int + """ super(Match, self).__init__(**kwargs) self.confidence_score = kwargs['confidence_score'] self.text = kwargs['text'] @@ -2463,15 +3184,16 @@ class MultiClassificationDocument(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param classifications: Required. Recognized classification results in the document. - :type classifications: list[~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar classifications: Required. Recognized classification results in the document. + :vartype classifications: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -2491,6 +3213,18 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword classifications: Required. Recognized classification results in the document. + :paramtype classifications: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(MultiClassificationDocument, self).__init__(**kwargs) self.id = kwargs['id'] self.classifications = kwargs['classifications'] @@ -2503,8 +3237,8 @@ class MultiLanguageBatchInput(msrest.serialization.Model): 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_2_preview_2.models.MultiLanguageInput] + :ivar documents: Required. The set of documents to process as part of this batch. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageInput] """ _validation = { @@ -2519,6 +3253,10 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. The set of documents to process as part of this batch. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageInput] + """ super(MultiLanguageBatchInput, self).__init__(**kwargs) self.documents = kwargs['documents'] @@ -2528,14 +3266,14 @@ class MultiLanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. A unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. The input text to process. + :vartype text: str + :ivar 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 + :vartype language: str """ _validation = { @@ -2553,6 +3291,16 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. A unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. The input text to process. + :paramtype text: str + :keyword 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. + :paramtype language: str + """ super(MultiLanguageInput, self).__init__(**kwargs) self.id = kwargs['id'] self.text = kwargs['text'] @@ -2564,17 +3312,17 @@ class PiiDocumentEntities(msrest.serialization.Model): 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_2_preview_2.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar redacted_text: Required. Returns redacted text. + :vartype redacted_text: str + :ivar entities: Required. Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.Entity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -2596,6 +3344,19 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword redacted_text: Required. Returns redacted text. + :paramtype redacted_text: str + :keyword entities: Required. Recognized entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.Entity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(PiiDocumentEntities, self).__init__(**kwargs) self.id = kwargs['id'] self.redacted_text = kwargs['redacted_text'] @@ -2609,15 +3370,15 @@ class PiiResult(msrest.serialization.Model): 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_2_preview_2.models.PiiDocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.PiiDocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2637,6 +3398,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.PiiDocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(PiiResult, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -2647,10 +3419,10 @@ def __init__( class PiiTask(msrest.serialization.Model): """PiiTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -2662,6 +3434,12 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(PiiTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -2670,17 +3448,18 @@ def __init__( class PiiTaskParameters(msrest.serialization.Model): """PiiTaskParameters. - :param domain: Possible values include: "phi", "none". Default value: "none". - :type domain: str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParametersDomain - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param pii_categories: (Optional) describes the PII categories to return. - :type pii_categories: list[str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiCategory] - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar domain: Possible values include: "phi", "none". Default value: "none". + :vartype domain: str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParametersDomain + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar pii_categories: (Optional) describes the PII categories to return. + :vartype pii_categories: list[str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiCategory] + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType """ _validation = { @@ -2699,6 +3478,21 @@ def __init__( self, **kwargs ): + """ + :keyword domain: Possible values include: "phi", "none". Default value: "none". + :paramtype domain: str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParametersDomain + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword pii_categories: (Optional) describes the PII categories to return. + :paramtype pii_categories: list[str or + ~azure.ai.textanalytics.v3_2_preview_2.models.PiiCategory] + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + """ super(PiiTaskParameters, self).__init__(**kwargs) self.domain = kwargs.get('domain', "none") self.model_version = kwargs.get('model_version', "latest") @@ -2710,8 +3504,8 @@ def __init__( class PiiTaskResult(msrest.serialization.Model): """PiiTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult """ _attribute_map = { @@ -2722,6 +3516,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult + """ super(PiiTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -2731,16 +3529,16 @@ class RequestStatistics(msrest.serialization.Model): 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, + :ivar documents_count: Required. Number of documents submitted in the request. + :vartype documents_count: int + :ivar 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, + :vartype valid_documents_count: int + :ivar 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 + :vartype erroneous_documents_count: int + :ivar transactions_count: Required. Number of transactions for the request. + :vartype transactions_count: long """ _validation = { @@ -2761,6 +3559,18 @@ def __init__( self, **kwargs ): + """ + :keyword documents_count: Required. Number of documents submitted in the request. + :paramtype documents_count: int + :keyword valid_documents_count: Required. Number of valid documents. This excludes empty, + over-size limit or non-supported languages documents. + :paramtype valid_documents_count: int + :keyword erroneous_documents_count: Required. Number of invalid documents. This includes empty, + over-size limit or non-supported languages documents. + :paramtype erroneous_documents_count: int + :keyword transactions_count: Required. Number of transactions for the request. + :paramtype transactions_count: long + """ super(RequestStatistics, self).__init__(**kwargs) self.documents_count = kwargs['documents_count'] self.valid_documents_count = kwargs['valid_documents_count'] @@ -2773,20 +3583,20 @@ class SentenceAssessment(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param sentiment: Required. Assessment sentiment in the sentence. Possible values include: + :ivar sentiment: Required. Assessment sentiment in the sentence. Possible values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue - :param confidence_scores: Required. Assessment sentiment confidence scores in the sentence. - :type confidence_scores: + :vartype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue + :ivar confidence_scores: Required. Assessment sentiment confidence scores in the sentence. + :vartype confidence_scores: ~azure.ai.textanalytics.v3_2_preview_2.models.TargetConfidenceScoreLabel - :param offset: Required. The assessment offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the assessment. - :type length: int - :param text: Required. The assessment text detected. - :type text: str - :param is_negated: Required. The indicator representing if the assessment is negated. - :type is_negated: bool + :ivar offset: Required. The assessment offset from the start of the sentence. + :vartype offset: int + :ivar length: Required. The length of the assessment. + :vartype length: int + :ivar text: Required. The assessment text detected. + :vartype text: str + :ivar is_negated: Required. The indicator representing if the assessment is negated. + :vartype is_negated: bool """ _validation = { @@ -2811,6 +3621,22 @@ def __init__( self, **kwargs ): + """ + :keyword sentiment: Required. Assessment sentiment in the sentence. Possible values include: + "positive", "mixed", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue + :keyword confidence_scores: Required. Assessment sentiment confidence scores in the sentence. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_2_preview_2.models.TargetConfidenceScoreLabel + :keyword offset: Required. The assessment offset from the start of the sentence. + :paramtype offset: int + :keyword length: Required. The length of the assessment. + :paramtype length: int + :keyword text: Required. The assessment text detected. + :paramtype text: str + :keyword is_negated: Required. The indicator representing if the assessment is negated. + :paramtype is_negated: bool + """ super(SentenceAssessment, self).__init__(**kwargs) self.sentiment = kwargs['sentiment'] self.confidence_scores = kwargs['confidence_scores'] @@ -2825,23 +3651,23 @@ class SentenceSentiment(msrest.serialization.Model): 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: + :ivar text: Required. The sentence text. + :vartype text: str + :ivar sentiment: Required. The predicted Sentiment for the sentence. Possible values include: "positive", "neutral", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentimentValue - :param confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + :vartype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentimentValue + :ivar confidence_scores: Required. The sentiment confidence score between 0 and 1 for the sentence for all classes. - :type confidence_scores: + :vartype confidence_scores: ~azure.ai.textanalytics.v3_2_preview_2.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 targets: The array of sentence targets for the sentence. - :type targets: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceTarget] - :param assessments: The array of assessments for the sentence. - :type assessments: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceAssessment] + :ivar offset: Required. The sentence offset from the start of the document. + :vartype offset: int + :ivar length: Required. The length of the sentence. + :vartype length: int + :ivar targets: The array of sentence targets for the sentence. + :vartype targets: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceTarget] + :ivar assessments: The array of assessments for the sentence. + :vartype assessments: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceAssessment] """ _validation = { @@ -2866,6 +3692,26 @@ def __init__( self, **kwargs ): + """ + :keyword text: Required. The sentence text. + :paramtype text: str + :keyword sentiment: Required. The predicted Sentiment for the sentence. Possible values + include: "positive", "neutral", "negative". + :paramtype sentiment: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentimentValue + :keyword confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + sentence for all classes. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentConfidenceScorePerLabel + :keyword offset: Required. The sentence offset from the start of the document. + :paramtype offset: int + :keyword length: Required. The length of the sentence. + :paramtype length: int + :keyword targets: The array of sentence targets for the sentence. + :paramtype targets: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceTarget] + :keyword assessments: The array of assessments for the sentence. + :paramtype assessments: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceAssessment] + """ super(SentenceSentiment, self).__init__(**kwargs) self.text = kwargs['text'] self.sentiment = kwargs['sentiment'] @@ -2881,22 +3727,22 @@ class SentenceTarget(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param sentiment: Required. Targeted sentiment in the sentence. Possible values include: + :ivar sentiment: Required. Targeted sentiment in the sentence. Possible values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue - :param confidence_scores: Required. Target sentiment confidence scores for the target in the + :vartype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue + :ivar confidence_scores: Required. Target sentiment confidence scores for the target in the sentence. - :type confidence_scores: + :vartype confidence_scores: ~azure.ai.textanalytics.v3_2_preview_2.models.TargetConfidenceScoreLabel - :param offset: Required. The target offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the target. - :type length: int - :param text: Required. The target text detected. - :type text: str - :param relations: Required. The array of either assessment or target objects which is related - to the target. - :type relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelation] + :ivar offset: Required. The target offset from the start of the sentence. + :vartype offset: int + :ivar length: Required. The length of the target. + :vartype length: int + :ivar text: Required. The target text detected. + :vartype text: str + :ivar relations: Required. The array of either assessment or target objects which is related to + the target. + :vartype relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelation] """ _validation = { @@ -2921,6 +3767,24 @@ def __init__( self, **kwargs ): + """ + :keyword sentiment: Required. Targeted sentiment in the sentence. Possible values include: + "positive", "mixed", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue + :keyword confidence_scores: Required. Target sentiment confidence scores for the target in the + sentence. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_2_preview_2.models.TargetConfidenceScoreLabel + :keyword offset: Required. The target offset from the start of the sentence. + :paramtype offset: int + :keyword length: Required. The length of the target. + :paramtype length: int + :keyword text: Required. The target text detected. + :paramtype text: str + :keyword relations: Required. The array of either assessment or target objects which is related + to the target. + :paramtype relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelation] + """ super(SentenceTarget, self).__init__(**kwargs) self.sentiment = kwargs['sentiment'] self.confidence_scores = kwargs['confidence_scores'] @@ -2933,10 +3797,11 @@ def __init__( class SentimentAnalysisTask(msrest.serialization.Model): """SentimentAnalysisTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentAnalysisTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentAnalysisTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -2948,6 +3813,13 @@ def __init__( self, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentAnalysisTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(SentimentAnalysisTask, self).__init__(**kwargs) self.parameters = kwargs.get('parameters', None) self.task_name = kwargs.get('task_name', None) @@ -2956,15 +3828,16 @@ def __init__( class SentimentAnalysisTaskParameters(msrest.serialization.Model): """SentimentAnalysisTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param opinion_mining: - :type opinion_mining: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar opinion_mining: + :vartype opinion_mining: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType """ _attribute_map = { @@ -2978,6 +3851,18 @@ def __init__( self, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword opinion_mining: + :paramtype opinion_mining: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + """ super(SentimentAnalysisTaskParameters, self).__init__(**kwargs) self.model_version = kwargs.get('model_version', "latest") self.logging_opt_out = kwargs.get('logging_opt_out', False) @@ -2990,12 +3875,12 @@ class SentimentConfidenceScorePerLabel(msrest.serialization.Model): 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 + :ivar positive: Required. + :vartype positive: float + :ivar neutral: Required. + :vartype neutral: float + :ivar negative: Required. + :vartype negative: float """ _validation = { @@ -3014,6 +3899,14 @@ def __init__( self, **kwargs ): + """ + :keyword positive: Required. + :paramtype positive: float + :keyword neutral: Required. + :paramtype neutral: float + :keyword negative: Required. + :paramtype negative: float + """ super(SentimentConfidenceScorePerLabel, self).__init__(**kwargs) self.positive = kwargs['positive'] self.neutral = kwargs['neutral'] @@ -3025,15 +3918,15 @@ class SentimentResponse(msrest.serialization.Model): 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_2_preview_2.models.DocumentSentiment] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Sentiment analysis per document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentSentiment] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -3053,6 +3946,17 @@ def __init__( self, **kwargs ): + """ + :keyword documents: Required. Sentiment analysis per document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentSentiment] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(SentimentResponse, self).__init__(**kwargs) self.documents = kwargs['documents'] self.errors = kwargs['errors'] @@ -3063,8 +3967,8 @@ def __init__( class SentimentTaskResult(msrest.serialization.Model): """SentimentTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse """ _attribute_map = { @@ -3075,6 +3979,10 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse + """ super(SentimentTaskResult, self).__init__(**kwargs) self.results = kwargs.get('results', None) @@ -3084,15 +3992,15 @@ class SingleClassificationDocument(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param classification: Required. - :type classification: ~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar classification: Required. + :vartype classification: ~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -3112,6 +4020,17 @@ def __init__( self, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword classification: Required. + :paramtype classification: ~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(SingleClassificationDocument, self).__init__(**kwargs) self.id = kwargs['id'] self.classification = kwargs['classification'] @@ -3124,10 +4043,10 @@ class TargetConfidenceScoreLabel(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param positive: Required. - :type positive: float - :param negative: Required. - :type negative: float + :ivar positive: Required. + :vartype positive: float + :ivar negative: Required. + :vartype negative: float """ _validation = { @@ -3144,6 +4063,12 @@ def __init__( self, **kwargs ): + """ + :keyword positive: Required. + :paramtype positive: float + :keyword negative: Required. + :paramtype negative: float + """ super(TargetConfidenceScoreLabel, self).__init__(**kwargs) self.positive = kwargs['positive'] self.negative = kwargs['negative'] @@ -3154,11 +4079,11 @@ class TargetRelation(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param relation_type: Required. The type related to the target. Possible values include: + :ivar relation_type: Required. The type related to the target. Possible values include: "assessment", "target". - :type relation_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelationType - :param ref: Required. The JSON pointer indicating the linked object. - :type ref: str + :vartype relation_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelationType + :ivar ref: Required. The JSON pointer indicating the linked object. + :vartype ref: str """ _validation = { @@ -3175,6 +4100,14 @@ def __init__( self, **kwargs ): + """ + :keyword relation_type: Required. The type related to the target. Possible values include: + "assessment", "target". + :paramtype relation_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelationType + :keyword ref: Required. The JSON pointer indicating the linked object. + :paramtype ref: str + """ super(TargetRelation, self).__init__(**kwargs) self.relation_type = kwargs['relation_type'] self.ref = kwargs['ref'] @@ -3185,40 +4118,40 @@ class TasksStateTasks(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :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: + :ivar completed: Required. + :vartype completed: int + :ivar failed: Required. + :vartype failed: int + :ivar in_progress: Required. + :vartype in_progress: int + :ivar total: Required. + :vartype total: int + :ivar entity_recognition_tasks: + :vartype entity_recognition_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityRecognitionTasksItem] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: + :ivar entity_recognition_pii_tasks: + :vartype entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityRecognitionPiiTasksItem] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: + :ivar key_phrase_extraction_tasks: + :vartype key_phrase_extraction_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksKeyPhraseExtractionTasksItem] - :param entity_linking_tasks: - :type entity_linking_tasks: + :ivar entity_linking_tasks: + :vartype entity_linking_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityLinkingTasksItem] - :param sentiment_analysis_tasks: - :type sentiment_analysis_tasks: + :ivar sentiment_analysis_tasks: + :vartype sentiment_analysis_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksSentimentAnalysisTasksItem] - :param extractive_summarization_tasks: - :type extractive_summarization_tasks: + :ivar extractive_summarization_tasks: + :vartype extractive_summarization_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksExtractiveSummarizationTasksItem] - :param custom_entity_recognition_tasks: - :type custom_entity_recognition_tasks: + :ivar custom_entity_recognition_tasks: + :vartype custom_entity_recognition_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomEntityRecognitionTasksItem] - :param custom_single_classification_tasks: - :type custom_single_classification_tasks: + :ivar custom_single_classification_tasks: + :vartype custom_single_classification_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomSingleClassificationTasksItem] - :param custom_multi_classification_tasks: - :type custom_multi_classification_tasks: + :ivar custom_multi_classification_tasks: + :vartype custom_multi_classification_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomMultiClassificationTasksItem] """ @@ -3249,6 +4182,43 @@ def __init__( self, **kwargs ): + """ + :keyword completed: Required. + :paramtype completed: int + :keyword failed: Required. + :paramtype failed: int + :keyword in_progress: Required. + :paramtype in_progress: int + :keyword total: Required. + :paramtype total: int + :keyword entity_recognition_tasks: + :paramtype entity_recognition_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityRecognitionTasksItem] + :keyword entity_recognition_pii_tasks: + :paramtype entity_recognition_pii_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityRecognitionPiiTasksItem] + :keyword key_phrase_extraction_tasks: + :paramtype key_phrase_extraction_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksKeyPhraseExtractionTasksItem] + :keyword entity_linking_tasks: + :paramtype entity_linking_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityLinkingTasksItem] + :keyword sentiment_analysis_tasks: + :paramtype sentiment_analysis_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksSentimentAnalysisTasksItem] + :keyword extractive_summarization_tasks: + :paramtype extractive_summarization_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksExtractiveSummarizationTasksItem] + :keyword custom_entity_recognition_tasks: + :paramtype custom_entity_recognition_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomEntityRecognitionTasksItem] + :keyword custom_single_classification_tasks: + :paramtype custom_single_classification_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomSingleClassificationTasksItem] + :keyword custom_multi_classification_tasks: + :paramtype custom_multi_classification_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomMultiClassificationTasksItem] + """ super(TasksStateTasks, self).__init__(**kwargs) self.completed = kwargs['completed'] self.failed = kwargs['failed'] @@ -3270,13 +4240,13 @@ class TaskState(msrest.serialization.Model): 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 task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3295,6 +4265,15 @@ def __init__( self, **kwargs ): + """ + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TaskState, self).__init__(**kwargs) self.last_update_date_time = kwargs['last_update_date_time'] self.task_name = kwargs['task_name'] @@ -3306,15 +4285,15 @@ class TasksStateTasksCustomEntityRecognitionTasksItem(TaskState, CustomEntitiesT All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3334,6 +4313,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksCustomEntityRecognitionTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -3346,15 +4336,15 @@ class TasksStateTasksCustomMultiClassificationTasksItem(TaskState, CustomMultiCl All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3374,6 +4364,18 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksCustomMultiClassificationTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -3386,15 +4388,16 @@ class TasksStateTasksCustomSingleClassificationTasksItem(TaskState, CustomSingle All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3414,6 +4417,18 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksCustomSingleClassificationTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -3426,15 +4441,15 @@ class TasksStateTasksEntityLinkingTasksItem(TaskState, EntityLinkingTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3454,6 +4469,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksEntityLinkingTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -3466,15 +4492,15 @@ class TasksStateTasksEntityRecognitionPiiTasksItem(TaskState, PiiTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3494,6 +4520,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksEntityRecognitionPiiTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -3506,15 +4543,15 @@ class TasksStateTasksEntityRecognitionTasksItem(TaskState, EntitiesTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3534,6 +4571,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksEntityRecognitionTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -3546,15 +4594,15 @@ class TasksStateTasksExtractiveSummarizationTasksItem(TaskState, ExtractiveSumma All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3574,6 +4622,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksExtractiveSummarizationTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -3586,15 +4645,15 @@ class TasksStateTasksKeyPhraseExtractionTasksItem(TaskState, KeyPhraseTaskResult All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3614,6 +4673,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksKeyPhraseExtractionTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -3626,15 +4696,15 @@ class TasksStateTasksSentimentAnalysisTasksItem(TaskState, SentimentTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3654,6 +4724,17 @@ def __init__( self, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksSentimentAnalysisTasksItem, self).__init__(**kwargs) self.results = kwargs.get('results', None) self.last_update_date_time = kwargs['last_update_date_time'] @@ -3666,17 +4747,17 @@ class TextAnalyticsError(msrest.serialization.Model): 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_2_preview_2.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_2_preview_2.models.InnerError - :param details: Details about specific errors that led to this reported error. - :type details: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :ivar code: Required. Error code. Possible values include: "InvalidRequest", "InvalidArgument", + "InternalServerError", "ServiceUnavailable", "NotFound". + :vartype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.ErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_2_preview_2.models.InnerError + :ivar details: Details about specific errors that led to this reported error. + :vartype details: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] """ _validation = { @@ -3696,6 +4777,19 @@ def __init__( self, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "InvalidRequest", + "InvalidArgument", "InternalServerError", "ServiceUnavailable", "NotFound". + :paramtype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.ErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_2_preview_2.models.InnerError + :keyword details: Details about specific errors that led to this reported error. + :paramtype details: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + """ super(TextAnalyticsError, self).__init__(**kwargs) self.code = kwargs['code'] self.message = kwargs['message'] @@ -3709,13 +4803,13 @@ class TextAnalyticsWarning(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "LongWordsInDocument", + :ivar code: Required. Error code. Possible values include: "LongWordsInDocument", "DocumentTruncated". - :type code: str or ~azure.ai.textanalytics.v3_2_preview_2.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 + :vartype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.WarningCodeValue + :ivar message: Required. Warning message. + :vartype message: str + :ivar target_ref: A JSON pointer reference indicating the target object. + :vartype target_ref: str """ _validation = { @@ -3733,6 +4827,15 @@ def __init__( self, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "LongWordsInDocument", + "DocumentTruncated". + :paramtype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.WarningCodeValue + :keyword message: Required. Warning message. + :paramtype message: str + :keyword target_ref: A JSON pointer reference indicating the target object. + :paramtype target_ref: str + """ super(TextAnalyticsWarning, self).__init__(**kwargs) self.code = kwargs['code'] self.message = kwargs['message'] diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_models_py3.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_models_py3.py index a4bda184341d..3392037db5bd 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_models_py3.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_models_py3.py @@ -20,9 +20,9 @@ class AnalysisInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param analysis_input: Required. Contains a set of input documents to be analyzed by the + :ivar analysis_input: Required. Contains a set of input documents to be analyzed by the service. - :type analysis_input: ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput + :vartype analysis_input: ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput """ _validation = { @@ -39,6 +39,12 @@ def __init__( analysis_input: "MultiLanguageBatchInput", **kwargs ): + """ + :keyword analysis_input: Required. Contains a set of input documents to be analyzed by the + service. + :paramtype analysis_input: + ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput + """ super(AnalysisInput, self).__init__(**kwargs) self.analysis_input = analysis_input @@ -48,9 +54,9 @@ class JobManifest(msrest.serialization.Model): 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 + :ivar 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_2_preview_2.models.JobManifestTasks + :vartype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.JobManifestTasks """ _validation = { @@ -67,6 +73,11 @@ def __init__( tasks: "JobManifestTasks", **kwargs ): + """ + :keyword tasks: Required. The set of tasks to execute on the input documents. Cannot specify + the same task more than once. + :paramtype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.JobManifestTasks + """ super(JobManifest, self).__init__(**kwargs) self.tasks = tasks @@ -74,8 +85,8 @@ def __init__( class JobDescriptor(msrest.serialization.Model): """JobDescriptor. - :param display_name: Optional display name for the analysis job. - :type display_name: str + :ivar display_name: Optional display name for the analysis job. + :vartype display_name: str """ _attribute_map = { @@ -88,6 +99,10 @@ def __init__( display_name: Optional[str] = None, **kwargs ): + """ + :keyword display_name: Optional display name for the analysis job. + :paramtype display_name: str + """ super(JobDescriptor, self).__init__(**kwargs) self.display_name = display_name @@ -97,14 +112,14 @@ class AnalyzeBatchInput(JobDescriptor, AnalysisInput, 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 + :ivar 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_2_preview_2.models.JobManifestTasks - :param analysis_input: Required. Contains a set of input documents to be analyzed by the + :vartype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.JobManifestTasks + :ivar analysis_input: Required. Contains a set of input documents to be analyzed by the service. - :type analysis_input: ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput - :param display_name: Optional display name for the analysis job. - :type display_name: str + :vartype analysis_input: ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput + :ivar display_name: Optional display name for the analysis job. + :vartype display_name: str """ _validation = { @@ -126,6 +141,17 @@ def __init__( display_name: Optional[str] = None, **kwargs ): + """ + :keyword tasks: Required. The set of tasks to execute on the input documents. Cannot specify + the same task more than once. + :paramtype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.JobManifestTasks + :keyword analysis_input: Required. Contains a set of input documents to be analyzed by the + service. + :paramtype analysis_input: + ~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageBatchInput + :keyword display_name: Optional display name for the analysis job. + :paramtype display_name: str + """ super(AnalyzeBatchInput, self).__init__(display_name=display_name, analysis_input=analysis_input, tasks=tasks, **kwargs) self.tasks = tasks self.analysis_input = analysis_input @@ -138,8 +164,8 @@ def __init__( class AnalyzeJobDisplayName(msrest.serialization.Model): """AnalyzeJobDisplayName. - :param display_name: - :type display_name: str + :ivar display_name: + :vartype display_name: str """ _attribute_map = { @@ -152,6 +178,10 @@ def __init__( display_name: Optional[str] = None, **kwargs ): + """ + :keyword display_name: + :paramtype display_name: str + """ super(AnalyzeJobDisplayName, self).__init__(**kwargs) self.display_name = display_name @@ -159,11 +189,11 @@ def __init__( class AnalyzeJobErrorsAndStatistics(msrest.serialization.Model): """AnalyzeJobErrorsAndStatistics. - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics """ _attribute_map = { @@ -178,6 +208,13 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + """ super(AnalyzeJobErrorsAndStatistics, self).__init__(**kwargs) self.errors = errors self.statistics = statistics @@ -188,17 +225,17 @@ class JobMetadata(msrest.serialization.Model): 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", + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -226,6 +263,19 @@ def __init__( expiration_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(JobMetadata, self).__init__(**kwargs) self.created_date_time = created_date_time self.expiration_date_time = expiration_date_time @@ -239,19 +289,19 @@ class AnalyzeJobMetadata(JobMetadata, AnalyzeJobDisplayName): All required parameters must be populated in order to send to Azure. - :param display_name: - :type display_name: 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", + :ivar display_name: + :vartype display_name: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -281,6 +331,21 @@ def __init__( expiration_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword display_name: + :paramtype display_name: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ 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, display_name=display_name, **kwargs) self.display_name = display_name self.created_date_time = created_date_time @@ -293,8 +358,8 @@ def __init__( class Pagination(msrest.serialization.Model): """Pagination. - :param next_link: - :type next_link: str + :ivar next_link: + :vartype next_link: str """ _attribute_map = { @@ -307,6 +372,10 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: + :paramtype next_link: str + """ super(Pagination, self).__init__(**kwargs) self.next_link = next_link @@ -316,8 +385,8 @@ class TasksState(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks + :ivar tasks: Required. + :vartype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks """ _validation = { @@ -334,6 +403,10 @@ def __init__( tasks: "TasksStateTasks", **kwargs ): + """ + :keyword tasks: Required. + :paramtype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks + """ super(TasksState, self).__init__(**kwargs) self.tasks = tasks @@ -343,28 +416,28 @@ class AnalyzeJobState(AnalyzeJobMetadata, TasksState, AnalyzeJobErrorsAndStatist All required parameters must be populated in order to send to Azure. - :param next_link: - :type next_link: str - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar next_link: + :vartype next_link: str + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param tasks: Required. - :type tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks - :param display_name: - :type display_name: 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", + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar tasks: Required. + :vartype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks + :ivar display_name: + :vartype display_name: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -403,6 +476,30 @@ def __init__( expiration_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword next_link: + :paramtype next_link: str + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword tasks: Required. + :paramtype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasks + :keyword display_name: + :paramtype display_name: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(AnalyzeJobState, self).__init__(display_name=display_name, 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, tasks=tasks, errors=errors, statistics=statistics, next_link=next_link, **kwargs) self.next_link = next_link self.errors = errors @@ -441,11 +538,11 @@ class ClassificationResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param category: Required. Classification type. - :type category: str - :param confidence_score: Required. Confidence score between 0 and 1 of the recognized + :ivar category: Required. Classification type. + :vartype category: str + :ivar confidence_score: Required. Confidence score between 0 and 1 of the recognized classification. - :type confidence_score: float + :vartype confidence_score: float """ _validation = { @@ -465,6 +562,13 @@ def __init__( confidence_score: float, **kwargs ): + """ + :keyword category: Required. Classification type. + :paramtype category: str + :keyword confidence_score: Required. Confidence score between 0 and 1 of the recognized + classification. + :paramtype confidence_score: float + """ super(ClassificationResult, self).__init__(**kwargs) self.category = category self.confidence_score = confidence_score @@ -475,17 +579,17 @@ class CustomEntitiesResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param project_name: Required. This field indicates the project name for the model. - :type project_name: str - :param deployment_name: Required. This field indicates the deployment name for the model. - :type deployment_name: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar project_name: Required. This field indicates the project name for the model. + :vartype project_name: str + :ivar deployment_name: Required. This field indicates the deployment name for the model. + :vartype deployment_name: str """ _validation = { @@ -513,6 +617,19 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword project_name: Required. This field indicates the project name for the model. + :paramtype project_name: str + :keyword deployment_name: Required. This field indicates the deployment name for the model. + :paramtype deployment_name: str + """ super(CustomEntitiesResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -524,10 +641,10 @@ def __init__( class CustomEntitiesTask(msrest.serialization.Model): """CustomEntitiesTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -542,6 +659,13 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(CustomEntitiesTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -552,15 +676,16 @@ class CustomEntitiesTaskParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param project_name: Required. - :type project_name: str - :param deployment_name: Required. - :type deployment_name: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar project_name: Required. + :vartype project_name: str + :ivar deployment_name: Required. + :vartype deployment_name: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType """ _validation = { @@ -569,8 +694,8 @@ class CustomEntitiesTaskParameters(msrest.serialization.Model): } _attribute_map = { - 'project_name': {'key': 'projectName', 'type': 'str'}, - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + 'project_name': {'key': 'project-name', 'type': 'str'}, + 'deployment_name': {'key': 'deployment-name', 'type': 'str'}, 'logging_opt_out': {'key': 'loggingOptOut', 'type': 'bool'}, 'string_index_type': {'key': 'stringIndexType', 'type': 'str'}, } @@ -584,6 +709,18 @@ def __init__( string_index_type: Optional[Union[str, "StringIndexType"]] = None, **kwargs ): + """ + :keyword project_name: Required. + :paramtype project_name: str + :keyword deployment_name: Required. + :paramtype deployment_name: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + """ super(CustomEntitiesTaskParameters, self).__init__(**kwargs) self.project_name = project_name self.deployment_name = deployment_name @@ -594,8 +731,8 @@ def __init__( class CustomEntitiesTaskResult(msrest.serialization.Model): """CustomEntitiesTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult """ _attribute_map = { @@ -608,6 +745,10 @@ def __init__( results: Optional["CustomEntitiesResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult + """ super(CustomEntitiesTaskResult, self).__init__(**kwargs) self.results = results @@ -617,18 +758,18 @@ class CustomMultiClassificationResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param documents: Required. Response by document. - :type documents: + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.MultiClassificationDocument] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param project_name: Required. This field indicates the project name for the model. - :type project_name: str - :param deployment_name: Required. This field indicates the deployment name for the model. - :type deployment_name: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar project_name: Required. This field indicates the project name for the model. + :vartype project_name: str + :ivar deployment_name: Required. This field indicates the deployment name for the model. + :vartype deployment_name: str """ _validation = { @@ -656,6 +797,20 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.MultiClassificationDocument] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword project_name: Required. This field indicates the project name for the model. + :paramtype project_name: str + :keyword deployment_name: Required. This field indicates the deployment name for the model. + :paramtype deployment_name: str + """ super(CustomMultiClassificationResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -667,11 +822,11 @@ def __init__( class CustomMultiClassificationTask(msrest.serialization.Model): """CustomMultiClassificationTask. - :param parameters: - :type parameters: + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationTaskParameters - :param task_name: - :type task_name: str + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -686,6 +841,13 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(CustomMultiClassificationTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -696,12 +858,12 @@ class CustomMultiClassificationTaskParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param project_name: Required. - :type project_name: str - :param deployment_name: Required. - :type deployment_name: str - :param logging_opt_out: - :type logging_opt_out: bool + :ivar project_name: Required. + :vartype project_name: str + :ivar deployment_name: Required. + :vartype deployment_name: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool """ _validation = { @@ -710,8 +872,8 @@ class CustomMultiClassificationTaskParameters(msrest.serialization.Model): } _attribute_map = { - 'project_name': {'key': 'projectName', 'type': 'str'}, - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + 'project_name': {'key': 'project-name', 'type': 'str'}, + 'deployment_name': {'key': 'deployment-name', 'type': 'str'}, 'logging_opt_out': {'key': 'loggingOptOut', 'type': 'bool'}, } @@ -723,6 +885,14 @@ def __init__( logging_opt_out: Optional[bool] = False, **kwargs ): + """ + :keyword project_name: Required. + :paramtype project_name: str + :keyword deployment_name: Required. + :paramtype deployment_name: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + """ super(CustomMultiClassificationTaskParameters, self).__init__(**kwargs) self.project_name = project_name self.deployment_name = deployment_name @@ -732,8 +902,8 @@ def __init__( class CustomMultiClassificationTaskResult(msrest.serialization.Model): """CustomMultiClassificationTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult """ _attribute_map = { @@ -746,6 +916,11 @@ def __init__( results: Optional["CustomMultiClassificationResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult + """ super(CustomMultiClassificationTaskResult, self).__init__(**kwargs) self.results = results @@ -755,18 +930,18 @@ class CustomSingleClassificationResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param documents: Required. Response by document. - :type documents: + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.SingleClassificationDocument] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param project_name: Required. This field indicates the project name for the model. - :type project_name: str - :param deployment_name: Required. This field indicates the deployment name for the model. - :type deployment_name: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar project_name: Required. This field indicates the project name for the model. + :vartype project_name: str + :ivar deployment_name: Required. This field indicates the deployment name for the model. + :vartype deployment_name: str """ _validation = { @@ -794,6 +969,20 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.SingleClassificationDocument] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword project_name: Required. This field indicates the project name for the model. + :paramtype project_name: str + :keyword deployment_name: Required. This field indicates the deployment name for the model. + :paramtype deployment_name: str + """ super(CustomSingleClassificationResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -805,11 +994,11 @@ def __init__( class CustomSingleClassificationTask(msrest.serialization.Model): """CustomSingleClassificationTask. - :param parameters: - :type parameters: + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationTaskParameters - :param task_name: - :type task_name: str + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -824,6 +1013,13 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(CustomSingleClassificationTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -834,12 +1030,12 @@ class CustomSingleClassificationTaskParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param project_name: Required. - :type project_name: str - :param deployment_name: Required. - :type deployment_name: str - :param logging_opt_out: - :type logging_opt_out: bool + :ivar project_name: Required. + :vartype project_name: str + :ivar deployment_name: Required. + :vartype deployment_name: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool """ _validation = { @@ -848,8 +1044,8 @@ class CustomSingleClassificationTaskParameters(msrest.serialization.Model): } _attribute_map = { - 'project_name': {'key': 'projectName', 'type': 'str'}, - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + 'project_name': {'key': 'project-name', 'type': 'str'}, + 'deployment_name': {'key': 'deployment-name', 'type': 'str'}, 'logging_opt_out': {'key': 'loggingOptOut', 'type': 'bool'}, } @@ -861,6 +1057,14 @@ def __init__( logging_opt_out: Optional[bool] = False, **kwargs ): + """ + :keyword project_name: Required. + :paramtype project_name: str + :keyword deployment_name: Required. + :paramtype deployment_name: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + """ super(CustomSingleClassificationTaskParameters, self).__init__(**kwargs) self.project_name = project_name self.deployment_name = deployment_name @@ -870,8 +1074,9 @@ def __init__( class CustomSingleClassificationTaskResult(msrest.serialization.Model): """CustomSingleClassificationTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult + :ivar results: + :vartype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult """ _attribute_map = { @@ -884,6 +1089,11 @@ def __init__( results: Optional["CustomSingleClassificationResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult + """ super(CustomSingleClassificationTaskResult, self).__init__(**kwargs) self.results = results @@ -893,14 +1103,14 @@ class DetectedLanguage(msrest.serialization.Model): 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 + :ivar name: Required. Long name of a detected language (e.g. English, French). + :vartype name: str + :ivar iso6391_name: Required. A two letter representation of the detected language according to + the ISO 639-1 standard (e.g. en, fr). + :vartype iso6391_name: str + :ivar 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 + :vartype confidence_score: float """ _validation = { @@ -923,6 +1133,16 @@ def __init__( confidence_score: float, **kwargs ): + """ + :keyword name: Required. Long name of a detected language (e.g. English, French). + :paramtype name: str + :keyword iso6391_name: Required. A two letter representation of the detected language according + to the ISO 639-1 standard (e.g. en, fr). + :paramtype iso6391_name: str + :keyword confidence_score: Required. A confidence score between 0 and 1. Scores close to 1 + indicate 100% certainty that the identified language is true. + :paramtype confidence_score: float + """ super(DetectedLanguage, self).__init__(**kwargs) self.name = name self.iso6391_name = iso6391_name @@ -934,15 +1154,15 @@ class DocumentEntities(msrest.serialization.Model): 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_2_preview_2.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.Entity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -967,6 +1187,17 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.Entity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(DocumentEntities, self).__init__(**kwargs) self.id = id self.entities = entities @@ -979,10 +1210,10 @@ class DocumentError(msrest.serialization.Model): 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_2_preview_2.models.TextAnalyticsError + :ivar id: Required. Document Id. + :vartype id: str + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError """ _validation = { @@ -1002,6 +1233,12 @@ def __init__( error: "TextAnalyticsError", **kwargs ): + """ + :keyword id: Required. Document Id. + :paramtype id: str + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError + """ super(DocumentError, self).__init__(**kwargs) self.id = id self.error = error @@ -1012,17 +1249,17 @@ class DocumentHealthcareEntities(msrest.serialization.Model): 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_2_preview_2.models.HealthcareEntity] - :param relations: Required. Healthcare entity relations. - :type relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelation] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Healthcare entities. + :vartype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntity] + :ivar relations: Required. Healthcare entity relations. + :vartype relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelation] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -1050,6 +1287,19 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Healthcare entities. + :paramtype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntity] + :keyword relations: Required. Healthcare entity relations. + :paramtype relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelation] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(DocumentHealthcareEntities, self).__init__(**kwargs) self.id = id self.entities = entities @@ -1063,16 +1313,16 @@ class DocumentKeyPhrases(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :vartype key_phrases: list[str] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -1097,6 +1347,18 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword 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. + :paramtype key_phrases: list[str] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(DocumentKeyPhrases, self).__init__(**kwargs) self.id = id self.key_phrases = key_phrases @@ -1109,15 +1371,15 @@ class DocumentLanguage(msrest.serialization.Model): 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_2_preview_2.models.DetectedLanguage - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar detected_language: Required. Detected Language. + :vartype detected_language: ~azure.ai.textanalytics.v3_2_preview_2.models.DetectedLanguage + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -1142,6 +1404,17 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword detected_language: Required. Detected Language. + :paramtype detected_language: ~azure.ai.textanalytics.v3_2_preview_2.models.DetectedLanguage + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(DocumentLanguage, self).__init__(**kwargs) self.id = id self.detected_language = detected_language @@ -1154,15 +1427,15 @@ class DocumentLinkedEntities(msrest.serialization.Model): 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_2_preview_2.models.LinkedEntity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar entities: Required. Recognized well known entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.LinkedEntity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -1187,6 +1460,17 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword entities: Required. Recognized well known entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.LinkedEntity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(DocumentLinkedEntities, self).__init__(**kwargs) self.id = id self.entities = entities @@ -1199,22 +1483,22 @@ class DocumentSentiment(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar 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_2_preview_2.models.DocumentSentimentValue - :param statistics: if showStats=true was specified in the request this field will contain + :vartype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentSentimentValue + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics - :param confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :ivar confidence_scores: Required. Document level sentiment confidence scores between 0 and 1 for each sentiment class. - :type confidence_scores: + :vartype confidence_scores: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentConfidenceScorePerLabel - :param sentences: Required. Sentence level sentiment analysis. - :type sentences: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentiment] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar sentences: Required. Sentence level sentiment analysis. + :vartype sentences: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentiment] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] """ _validation = { @@ -1245,6 +1529,25 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword sentiment: Required. Predicted sentiment for document (Negative, Neutral, Positive, or + Mixed). Possible values include: "positive", "neutral", "negative", "mixed". + :paramtype sentiment: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentSentimentValue + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :keyword confidence_scores: Required. Document level sentiment confidence scores between 0 and + 1 for each sentiment class. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentConfidenceScorePerLabel + :keyword sentences: Required. Sentence level sentiment analysis. + :paramtype sentences: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentiment] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + """ super(DocumentSentiment, self).__init__(**kwargs) self.id = id self.sentiment = sentiment @@ -1259,10 +1562,10 @@ class DocumentStatistics(msrest.serialization.Model): 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 + :ivar characters_count: Required. Number of text elements recognized in the document. + :vartype characters_count: int + :ivar transactions_count: Required. Number of transactions for the document. + :vartype transactions_count: int """ _validation = { @@ -1282,6 +1585,12 @@ def __init__( transactions_count: int, **kwargs ): + """ + :keyword characters_count: Required. Number of text elements recognized in the document. + :paramtype characters_count: int + :keyword transactions_count: Required. Number of transactions for the document. + :paramtype transactions_count: int + """ super(DocumentStatistics, self).__init__(**kwargs) self.characters_count = characters_count self.transactions_count = transactions_count @@ -1292,15 +1601,15 @@ class EntitiesResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1325,6 +1634,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntitiesResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -1335,10 +1655,10 @@ def __init__( class EntitiesTask(msrest.serialization.Model): """EntitiesTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -1353,6 +1673,12 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(EntitiesTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -1361,13 +1687,14 @@ def __init__( class EntitiesTaskParameters(msrest.serialization.Model): """EntitiesTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType """ _attribute_map = { @@ -1384,6 +1711,16 @@ def __init__( string_index_type: Optional[Union[str, "StringIndexType"]] = None, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + """ super(EntitiesTaskParameters, self).__init__(**kwargs) self.model_version = model_version self.logging_opt_out = logging_opt_out @@ -1393,8 +1730,8 @@ def __init__( class EntitiesTaskResult(msrest.serialization.Model): """EntitiesTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult """ _attribute_map = { @@ -1407,6 +1744,10 @@ def __init__( results: Optional["EntitiesResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult + """ super(EntitiesTaskResult, self).__init__(**kwargs) self.results = results @@ -1416,20 +1757,20 @@ class Entity(msrest.serialization.Model): 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' + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Entity type. + :vartype category: str + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -1460,6 +1801,22 @@ def __init__( subcategory: Optional[str] = None, **kwargs ): + """ + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Entity type. + :paramtype category: str + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(Entity, self).__init__(**kwargs) self.text = text self.category = category @@ -1474,15 +1831,15 @@ class EntityLinkingResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentLinkedEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentLinkedEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1507,6 +1864,18 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentLinkedEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(EntityLinkingResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -1517,10 +1886,10 @@ def __init__( class EntityLinkingTask(msrest.serialization.Model): """EntityLinkingTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -1535,6 +1904,13 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(EntityLinkingTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -1543,13 +1919,14 @@ def __init__( class EntityLinkingTaskParameters(msrest.serialization.Model): """EntityLinkingTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType """ _attribute_map = { @@ -1566,6 +1943,16 @@ def __init__( string_index_type: Optional[Union[str, "StringIndexType"]] = None, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + """ super(EntityLinkingTaskParameters, self).__init__(**kwargs) self.model_version = model_version self.logging_opt_out = logging_opt_out @@ -1575,8 +1962,8 @@ def __init__( class EntityLinkingTaskResult(msrest.serialization.Model): """EntityLinkingTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult """ _attribute_map = { @@ -1589,6 +1976,10 @@ def __init__( results: Optional["EntityLinkingResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult + """ super(EntityLinkingTaskResult, self).__init__(**kwargs) self.results = results @@ -1598,8 +1989,8 @@ class ErrorResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param error: Required. Document Error. - :type error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError + :ivar error: Required. Document Error. + :vartype error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError """ _validation = { @@ -1616,6 +2007,10 @@ def __init__( error: "TextAnalyticsError", **kwargs ): + """ + :keyword error: Required. Document Error. + :paramtype error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError + """ super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -1625,15 +2020,16 @@ class ExtractedDocumentSummary(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param sentences: Required. A ranked list of sentences representing the extracted summary. - :type sentences: list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractedSummarySentence] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar sentences: Required. A ranked list of sentences representing the extracted summary. + :vartype sentences: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractedSummarySentence] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -1658,6 +2054,18 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword sentences: Required. A ranked list of sentences representing the extracted summary. + :paramtype sentences: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractedSummarySentence] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(ExtractedDocumentSummary, self).__init__(**kwargs) self.id = id self.sentences = sentences @@ -1670,16 +2078,16 @@ class ExtractedSummarySentence(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param text: Required. The extracted sentence text. - :type text: str - :param rank_score: Required. A double value representing the relevance of the sentence within + :ivar text: Required. The extracted sentence text. + :vartype text: str + :ivar rank_score: Required. A double value representing the relevance of the sentence within the summary. Higher values indicate higher importance. - :type rank_score: float - :param offset: Required. The sentence offset from the start of the document, based on the value + :vartype rank_score: float + :ivar offset: Required. The sentence offset from the start of the document, based on the value of the parameter StringIndexType. - :type offset: int - :param length: Required. The length of the sentence. - :type length: int + :vartype offset: int + :ivar length: Required. The length of the sentence. + :vartype length: int """ _validation = { @@ -1705,6 +2113,18 @@ def __init__( length: int, **kwargs ): + """ + :keyword text: Required. The extracted sentence text. + :paramtype text: str + :keyword rank_score: Required. A double value representing the relevance of the sentence within + the summary. Higher values indicate higher importance. + :paramtype rank_score: float + :keyword offset: Required. The sentence offset from the start of the document, based on the + value of the parameter StringIndexType. + :paramtype offset: int + :keyword length: Required. The length of the sentence. + :paramtype length: int + """ super(ExtractedSummarySentence, self).__init__(**kwargs) self.text = text self.rank_score = rank_score @@ -1717,15 +2137,16 @@ class ExtractiveSummarizationResult(msrest.serialization.Model): 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_2_preview_2.models.ExtractedDocumentSummary] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractedDocumentSummary] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -1750,6 +2171,18 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractedDocumentSummary] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(ExtractiveSummarizationResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -1760,11 +2193,11 @@ def __init__( class ExtractiveSummarizationTask(msrest.serialization.Model): """ExtractiveSummarizationTask. - :param parameters: - :type parameters: + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTaskParameters - :param task_name: - :type task_name: str + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -1779,6 +2212,13 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(ExtractiveSummarizationTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -1787,17 +2227,18 @@ def __init__( class ExtractiveSummarizationTaskParameters(msrest.serialization.Model): """ExtractiveSummarizationTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType - :param sentence_count: - :type sentence_count: int - :param sort_by: Possible values include: "Offset", "Rank". Default value: "Offset". - :type sort_by: str or + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :ivar sentence_count: + :vartype sentence_count: int + :ivar sort_by: Possible values include: "Offset", "Rank". Default value: "Offset". + :vartype sort_by: str or ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTaskParametersSortBy """ @@ -1819,6 +2260,21 @@ def __init__( sort_by: Optional[Union[str, "ExtractiveSummarizationTaskParametersSortBy"]] = "Offset", **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :keyword sentence_count: + :paramtype sentence_count: int + :keyword sort_by: Possible values include: "Offset", "Rank". Default value: "Offset". + :paramtype sort_by: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTaskParametersSortBy + """ super(ExtractiveSummarizationTaskParameters, self).__init__(**kwargs) self.model_version = model_version self.logging_opt_out = logging_opt_out @@ -1830,8 +2286,8 @@ def __init__( class ExtractiveSummarizationTaskResult(msrest.serialization.Model): """ExtractiveSummarizationTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult """ _attribute_map = { @@ -1844,6 +2300,10 @@ def __init__( results: Optional["ExtractiveSummarizationResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult + """ super(ExtractiveSummarizationTaskResult, self).__init__(**kwargs) self.results = results @@ -1851,15 +2311,15 @@ def __init__( class HealthcareAssertion(msrest.serialization.Model): """HealthcareAssertion. - :param conditionality: Describes any conditionality on the entity. Possible values include: + :ivar conditionality: Describes any conditionality on the entity. Possible values include: "hypothetical", "conditional". - :type conditionality: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Conditionality - :param certainty: Describes the entities certainty and polarity. Possible values include: + :vartype conditionality: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Conditionality + :ivar certainty: Describes the entities certainty and polarity. Possible values include: "positive", "positivePossible", "neutralPossible", "negativePossible", "negative". - :type certainty: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Certainty - :param association: Describes if the entity is the subject of the text or if it describes + :vartype certainty: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Certainty + :ivar association: Describes if the entity is the subject of the text or if it describes someone else. Possible values include: "subject", "other". - :type association: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Association + :vartype association: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Association """ _attribute_map = { @@ -1876,6 +2336,17 @@ def __init__( association: Optional[Union[str, "Association"]] = None, **kwargs ): + """ + :keyword conditionality: Describes any conditionality on the entity. Possible values include: + "hypothetical", "conditional". + :paramtype conditionality: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Conditionality + :keyword certainty: Describes the entities certainty and polarity. Possible values include: + "positive", "positivePossible", "neutralPossible", "negativePossible", "negative". + :paramtype certainty: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Certainty + :keyword association: Describes if the entity is the subject of the text or if it describes + someone else. Possible values include: "subject", "other". + :paramtype association: str or ~azure.ai.textanalytics.v3_2_preview_2.models.Association + """ super(HealthcareAssertion, self).__init__(**kwargs) self.conditionality = conditionality self.certainty = certainty @@ -1885,13 +2356,13 @@ def __init__( class HealthcareLinkingProperties(msrest.serialization.Model): """HealthcareLinkingProperties. - :param assertion: - :type assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion - :param name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + :ivar assertion: + :vartype assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion + :ivar name: Preferred name for the entity. Example: 'histologically' would have a 'name' of 'histologic'. - :type name: str - :param links: Entity references in known data sources. - :type links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] + :vartype name: str + :ivar links: Entity references in known data sources. + :vartype links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] """ _attribute_map = { @@ -1908,6 +2379,15 @@ def __init__( links: Optional[List["HealthcareEntityLink"]] = None, **kwargs ): + """ + :keyword assertion: + :paramtype assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion + :keyword name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + 'histologic'. + :paramtype name: str + :keyword links: Entity references in known data sources. + :paramtype links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] + """ super(HealthcareLinkingProperties, self).__init__(**kwargs) self.assertion = assertion self.name = name @@ -1919,25 +2399,26 @@ class HealthcareEntityProperties(msrest.serialization.Model): 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. Healthcare Entity Category. Possible values include: + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Healthcare Entity Category. Possible values include: "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". - :type category: str or ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' + :vartype category: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -1968,6 +2449,28 @@ def __init__( subcategory: Optional[str] = None, **kwargs ): + """ + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Healthcare Entity Category. Possible values include: + "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", + "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", + "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", + "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", + "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". + :paramtype category: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(HealthcareEntityProperties, self).__init__(**kwargs) self.text = text self.category = category @@ -1982,32 +2485,33 @@ class HealthcareEntity(HealthcareEntityProperties, HealthcareLinkingProperties): All required parameters must be populated in order to send to Azure. - :param assertion: - :type assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion - :param name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + :ivar assertion: + :vartype assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion + :ivar name: Preferred name for the entity. Example: 'histologically' would have a 'name' of 'histologic'. - :type name: str - :param links: Entity references in known data sources. - :type links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] - :param text: Required. Entity text as appears in the request. - :type text: str - :param category: Required. Healthcare Entity Category. Possible values include: + :vartype name: str + :ivar links: Entity references in known data sources. + :vartype links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar category: Required. Healthcare Entity Category. Possible values include: "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". - :type category: str or ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory - :param subcategory: (Optional) Entity sub type. - :type subcategory: str - :param offset: Required. Start position for the entity text. Use of different 'stringIndexType' + :vartype category: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory + :ivar subcategory: (Optional) Entity sub type. + :vartype subcategory: str + :ivar 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 + :vartype offset: int + :ivar 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 + :vartype length: int + :ivar confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :vartype confidence_score: float """ _validation = { @@ -2044,6 +2548,35 @@ def __init__( subcategory: Optional[str] = None, **kwargs ): + """ + :keyword assertion: + :paramtype assertion: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareAssertion + :keyword name: Preferred name for the entity. Example: 'histologically' would have a 'name' of + 'histologic'. + :paramtype name: str + :keyword links: Entity references in known data sources. + :paramtype links: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityLink] + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword category: Required. Healthcare Entity Category. Possible values include: + "BODY_STRUCTURE", "AGE", "GENDER", "EXAMINATION_NAME", "DATE", "DIRECTION", "FREQUENCY", + "MEASUREMENT_VALUE", "MEASUREMENT_UNIT", "RELATIONAL_OPERATOR", "TIME", "GENE_OR_PROTEIN", + "VARIANT", "ADMINISTRATIVE_EVENT", "CARE_ENVIRONMENT", "HEALTHCARE_PROFESSION", "DIAGNOSIS", + "SYMPTOM_OR_SIGN", "CONDITION_QUALIFIER", "MEDICATION_CLASS", "MEDICATION_NAME", "DOSAGE", + "MEDICATION_FORM", "MEDICATION_ROUTE", "FAMILY_RELATION", "TREATMENT_NAME". + :paramtype category: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareEntityCategory + :keyword subcategory: (Optional) Entity sub type. + :paramtype subcategory: str + :keyword offset: Required. Start position for the entity text. Use of different + 'stringIndexType' values can affect the offset returned. + :paramtype offset: int + :keyword length: Required. Length for the entity text. Use of different 'stringIndexType' + values can affect the length returned. + :paramtype length: int + :keyword confidence_score: Required. Confidence score between 0 and 1 of the extracted entity. + :paramtype confidence_score: float + """ super(HealthcareEntity, self).__init__(text=text, category=category, subcategory=subcategory, offset=offset, length=length, confidence_score=confidence_score, assertion=assertion, name=name, links=links, **kwargs) self.assertion = assertion self.name = name @@ -2061,10 +2594,10 @@ class HealthcareEntityLink(msrest.serialization.Model): 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 + :ivar data_source: Required. Entity Catalog. Examples include: UMLS, CHV, MSH, etc. + :vartype data_source: str + :ivar id: Required. Entity id in the given source catalog. + :vartype id: str """ _validation = { @@ -2084,6 +2617,12 @@ def __init__( id: str, **kwargs ): + """ + :keyword data_source: Required. Entity Catalog. Examples include: UMLS, CHV, MSH, etc. + :paramtype data_source: str + :keyword id: Required. Entity id in the given source catalog. + :paramtype id: str + """ super(HealthcareEntityLink, self).__init__(**kwargs) self.data_source = data_source self.id = id @@ -2092,10 +2631,10 @@ def __init__( class HealthcareTaskResult(msrest.serialization.Model): """HealthcareTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] """ _attribute_map = { @@ -2110,6 +2649,12 @@ def __init__( errors: Optional[List["TextAnalyticsError"]] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + """ super(HealthcareTaskResult, self).__init__(**kwargs) self.results = results self.errors = errors @@ -2120,23 +2665,23 @@ class HealthcareJobState(JobMetadata, Pagination, HealthcareTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult - :param errors: - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] - :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", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult + :ivar errors: + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :ivar next_link: + :vartype next_link: str + :ivar created_date_time: Required. + :vartype created_date_time: ~datetime.datetime + :ivar expiration_date_time: + :vartype expiration_date_time: ~datetime.datetime + :ivar job_id: Required. + :vartype job_id: str + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -2170,6 +2715,25 @@ def __init__( expiration_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareResult + :keyword errors: + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :keyword next_link: + :paramtype next_link: str + :keyword created_date_time: Required. + :paramtype created_date_time: ~datetime.datetime + :keyword expiration_date_time: + :paramtype expiration_date_time: ~datetime.datetime + :keyword job_id: Required. + :paramtype job_id: str + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ 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, results=results, errors=errors, **kwargs) self.results = results self.errors = errors @@ -2194,16 +2758,16 @@ class HealthcareRelation(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or + :ivar relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or 'FrequencyOfMedication', etc. Possible values include: "Abbreviation", "DirectionOfBodyStructure", "DirectionOfCondition", "DirectionOfExamination", "DirectionOfTreatment", "DosageOfMedication", "FormOfMedication", "FrequencyOfMedication", "FrequencyOfTreatment", "QualifierOfCondition", "RelationOfExamination", "RouteOfMedication", "TimeOfCondition", "TimeOfEvent", "TimeOfExamination", "TimeOfMedication", "TimeOfTreatment", "UnitOfCondition", "UnitOfExamination", "ValueOfCondition", "ValueOfExamination". - :type relation_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.RelationType - :param entities: Required. The entities in the relation. - :type entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelationEntity] + :vartype relation_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.RelationType + :ivar entities: Required. The entities in the relation. + :vartype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelationEntity] """ _validation = { @@ -2223,6 +2787,19 @@ def __init__( entities: List["HealthcareRelationEntity"], **kwargs ): + """ + :keyword relation_type: Required. Type of relation. Examples include: ``DosageOfMedication`` or + 'FrequencyOfMedication', etc. Possible values include: "Abbreviation", + "DirectionOfBodyStructure", "DirectionOfCondition", "DirectionOfExamination", + "DirectionOfTreatment", "DosageOfMedication", "FormOfMedication", "FrequencyOfMedication", + "FrequencyOfTreatment", "QualifierOfCondition", "RelationOfExamination", "RouteOfMedication", + "TimeOfCondition", "TimeOfEvent", "TimeOfExamination", "TimeOfMedication", "TimeOfTreatment", + "UnitOfCondition", "UnitOfExamination", "ValueOfCondition", "ValueOfExamination". + :paramtype relation_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.RelationType + :keyword entities: Required. The entities in the relation. + :paramtype entities: + list[~azure.ai.textanalytics.v3_2_preview_2.models.HealthcareRelationEntity] + """ super(HealthcareRelation, self).__init__(**kwargs) self.relation_type = relation_type self.entities = entities @@ -2233,13 +2810,13 @@ class HealthcareRelationEntity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment + :ivar ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment Identifier Representation), pointing to the entity . - :type ref: str - :param role: Required. Role of entity in the relationship. For example: 'CD20-positive diffuse + :vartype ref: str + :ivar role: Required. Role of entity in the relationship. For example: 'CD20-positive diffuse large B-cell lymphoma' has the following entities with their roles in parenthesis: CD20 (GeneOrProtein), Positive (Expression), diffuse large B-cell lymphoma (Diagnosis). - :type role: str + :vartype role: str """ _validation = { @@ -2259,6 +2836,15 @@ def __init__( role: str, **kwargs ): + """ + :keyword ref: Required. Reference link object, using a JSON pointer RFC 6901 (URI Fragment + Identifier Representation), pointing to the entity . + :paramtype ref: str + :keyword role: Required. Role of entity in the relationship. For example: 'CD20-positive + diffuse large B-cell lymphoma' has the following entities with their roles in parenthesis: + CD20 (GeneOrProtein), Positive (Expression), diffuse large B-cell lymphoma (Diagnosis). + :paramtype role: str + """ super(HealthcareRelationEntity, self).__init__(**kwargs) self.ref = ref self.role = role @@ -2269,15 +2855,16 @@ class HealthcareResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentHealthcareEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentHealthcareEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2302,6 +2889,18 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: + list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentHealthcareEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(HealthcareResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -2314,19 +2913,19 @@ class InnerError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "InvalidParameterValue", + :ivar code: Required. Error code. Possible values include: "InvalidParameterValue", "InvalidRequestBodyFormat", "EmptyRequest", "MissingInputRecords", "InvalidDocument", "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", "InvalidCountryHint". - :type code: str or ~azure.ai.textanalytics.v3_2_preview_2.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_2_preview_2.models.InnerError + :vartype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.InnerErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar details: Error details. + :vartype details: dict[str, str] + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_2_preview_2.models.InnerError """ _validation = { @@ -2352,6 +2951,21 @@ def __init__( innererror: Optional["InnerError"] = None, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "InvalidParameterValue", + "InvalidRequestBodyFormat", "EmptyRequest", "MissingInputRecords", "InvalidDocument", + "ModelVersionIncorrect", "InvalidDocumentBatch", "UnsupportedLanguageCode", + "InvalidCountryHint". + :paramtype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.InnerErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword details: Error details. + :paramtype details: dict[str, str] + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_2_preview_2.models.InnerError + """ super(InnerError, self).__init__(**kwargs) self.code = code self.message = message @@ -2363,31 +2977,32 @@ def __init__( 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: + :ivar entity_recognition_tasks: + :vartype entity_recognition_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesTask] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.PiiTask] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: + :ivar entity_recognition_pii_tasks: + :vartype entity_recognition_pii_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.PiiTask] + :ivar key_phrase_extraction_tasks: + :vartype key_phrase_extraction_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhrasesTask] - :param entity_linking_tasks: - :type entity_linking_tasks: + :ivar entity_linking_tasks: + :vartype entity_linking_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingTask] - :param sentiment_analysis_tasks: - :type sentiment_analysis_tasks: + :ivar sentiment_analysis_tasks: + :vartype sentiment_analysis_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentimentAnalysisTask] - :param extractive_summarization_tasks: - :type extractive_summarization_tasks: + :ivar extractive_summarization_tasks: + :vartype extractive_summarization_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTask] - :param custom_entity_recognition_tasks: - :type custom_entity_recognition_tasks: + :ivar custom_entity_recognition_tasks: + :vartype custom_entity_recognition_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesTask] - :param custom_single_classification_tasks: - :type custom_single_classification_tasks: + :ivar custom_single_classification_tasks: + :vartype custom_single_classification_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationTask] - :param custom_multi_classification_tasks: - :type custom_multi_classification_tasks: + :ivar custom_multi_classification_tasks: + :vartype custom_multi_classification_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationTask] """ @@ -2417,6 +3032,35 @@ def __init__( custom_multi_classification_tasks: Optional[List["CustomMultiClassificationTask"]] = None, **kwargs ): + """ + :keyword entity_recognition_tasks: + :paramtype entity_recognition_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesTask] + :keyword entity_recognition_pii_tasks: + :paramtype entity_recognition_pii_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.PiiTask] + :keyword key_phrase_extraction_tasks: + :paramtype key_phrase_extraction_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhrasesTask] + :keyword entity_linking_tasks: + :paramtype entity_linking_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingTask] + :keyword sentiment_analysis_tasks: + :paramtype sentiment_analysis_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.SentimentAnalysisTask] + :keyword extractive_summarization_tasks: + :paramtype extractive_summarization_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationTask] + :keyword custom_entity_recognition_tasks: + :paramtype custom_entity_recognition_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesTask] + :keyword custom_single_classification_tasks: + :paramtype custom_single_classification_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationTask] + :keyword custom_multi_classification_tasks: + :paramtype custom_multi_classification_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationTask] + """ super(JobManifestTasks, self).__init__(**kwargs) self.entity_recognition_tasks = entity_recognition_tasks self.entity_recognition_pii_tasks = entity_recognition_pii_tasks @@ -2434,15 +3078,15 @@ class KeyPhraseResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentKeyPhrases] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentKeyPhrases] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2467,6 +3111,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentKeyPhrases] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(KeyPhraseResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -2477,10 +3132,10 @@ def __init__( class KeyPhrasesTask(msrest.serialization.Model): """KeyPhrasesTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhrasesTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhrasesTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -2495,6 +3150,12 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhrasesTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(KeyPhrasesTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -2503,10 +3164,10 @@ def __init__( class KeyPhrasesTaskParameters(msrest.serialization.Model): """KeyPhrasesTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool """ _attribute_map = { @@ -2521,6 +3182,12 @@ def __init__( logging_opt_out: Optional[bool] = False, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + """ super(KeyPhrasesTaskParameters, self).__init__(**kwargs) self.model_version = model_version self.logging_opt_out = logging_opt_out @@ -2529,8 +3196,8 @@ def __init__( class KeyPhraseTaskResult(msrest.serialization.Model): """KeyPhraseTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult """ _attribute_map = { @@ -2543,6 +3210,10 @@ def __init__( results: Optional["KeyPhraseResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult + """ super(KeyPhraseTaskResult, self).__init__(**kwargs) self.results = results @@ -2552,8 +3223,8 @@ class LanguageBatchInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param documents: Required. - :type documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.LanguageInput] + :ivar documents: Required. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.LanguageInput] """ _validation = { @@ -2570,6 +3241,10 @@ def __init__( documents: List["LanguageInput"], **kwargs ): + """ + :keyword documents: Required. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.LanguageInput] + """ super(LanguageBatchInput, self).__init__(**kwargs) self.documents = documents @@ -2579,12 +3254,12 @@ class LanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. + :vartype text: str + :ivar country_hint: + :vartype country_hint: str """ _validation = { @@ -2606,6 +3281,14 @@ def __init__( country_hint: Optional[str] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. + :paramtype text: str + :keyword country_hint: + :paramtype country_hint: str + """ super(LanguageInput, self).__init__(**kwargs) self.id = id self.text = text @@ -2617,15 +3300,15 @@ class LanguageResult(msrest.serialization.Model): 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_2_preview_2.models.DocumentLanguage] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentLanguage] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2650,6 +3333,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentLanguage] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(LanguageResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -2662,21 +3356,20 @@ class LinkedEntity(msrest.serialization.Model): 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_2_preview_2.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 + :ivar name: Required. Entity Linking formal name. + :vartype name: str + :ivar matches: Required. List of instances this entity appears in the text. + :vartype matches: list[~azure.ai.textanalytics.v3_2_preview_2.models.Match] + :ivar language: Required. Language used in the data source. + :vartype language: str + :ivar id: Unique identifier of the recognized entity from the data source. + :vartype id: str + :ivar url: Required. URL for the entity's page from the data source. + :vartype url: str + :ivar data_source: Required. Data source used to extract entity linking, such as Wiki/Bing etc. + :vartype data_source: str + :ivar bing_id: Bing Entity Search API unique identifier of the recognized entity. + :vartype bing_id: str """ _validation = { @@ -2709,6 +3402,23 @@ def __init__( bing_id: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. Entity Linking formal name. + :paramtype name: str + :keyword matches: Required. List of instances this entity appears in the text. + :paramtype matches: list[~azure.ai.textanalytics.v3_2_preview_2.models.Match] + :keyword language: Required. Language used in the data source. + :paramtype language: str + :keyword id: Unique identifier of the recognized entity from the data source. + :paramtype id: str + :keyword url: Required. URL for the entity's page from the data source. + :paramtype url: str + :keyword data_source: Required. Data source used to extract entity linking, such as Wiki/Bing + etc. + :paramtype data_source: str + :keyword bing_id: Bing Entity Search API unique identifier of the recognized entity. + :paramtype bing_id: str + """ super(LinkedEntity, self).__init__(**kwargs) self.name = name self.matches = matches @@ -2724,15 +3434,15 @@ class Match(msrest.serialization.Model): 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 + :ivar confidence_score: Required. If a well known item is recognized, a decimal number denoting + the confidence level between 0 and 1 will be returned. + :vartype confidence_score: float + :ivar text: Required. Entity text as appears in the request. + :vartype text: str + :ivar offset: Required. Start position for the entity match text. + :vartype offset: int + :ivar length: Required. Length for the entity match text. + :vartype length: int """ _validation = { @@ -2758,6 +3468,17 @@ def __init__( length: int, **kwargs ): + """ + :keyword confidence_score: Required. If a well known item is recognized, a decimal number + denoting the confidence level between 0 and 1 will be returned. + :paramtype confidence_score: float + :keyword text: Required. Entity text as appears in the request. + :paramtype text: str + :keyword offset: Required. Start position for the entity match text. + :paramtype offset: int + :keyword length: Required. Length for the entity match text. + :paramtype length: int + """ super(Match, self).__init__(**kwargs) self.confidence_score = confidence_score self.text = text @@ -2770,15 +3491,16 @@ class MultiClassificationDocument(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param classifications: Required. Recognized classification results in the document. - :type classifications: list[~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar classifications: Required. Recognized classification results in the document. + :vartype classifications: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -2803,6 +3525,18 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword classifications: Required. Recognized classification results in the document. + :paramtype classifications: + list[~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(MultiClassificationDocument, self).__init__(**kwargs) self.id = id self.classifications = classifications @@ -2815,8 +3549,8 @@ class MultiLanguageBatchInput(msrest.serialization.Model): 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_2_preview_2.models.MultiLanguageInput] + :ivar documents: Required. The set of documents to process as part of this batch. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageInput] """ _validation = { @@ -2833,6 +3567,10 @@ def __init__( documents: List["MultiLanguageInput"], **kwargs ): + """ + :keyword documents: Required. The set of documents to process as part of this batch. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.MultiLanguageInput] + """ super(MultiLanguageBatchInput, self).__init__(**kwargs) self.documents = documents @@ -2842,14 +3580,14 @@ class MultiLanguageInput(msrest.serialization.Model): 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 + :ivar id: Required. A unique, non-empty document identifier. + :vartype id: str + :ivar text: Required. The input text to process. + :vartype text: str + :ivar 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 + :vartype language: str """ _validation = { @@ -2871,6 +3609,16 @@ def __init__( language: Optional[str] = None, **kwargs ): + """ + :keyword id: Required. A unique, non-empty document identifier. + :paramtype id: str + :keyword text: Required. The input text to process. + :paramtype text: str + :keyword 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. + :paramtype language: str + """ super(MultiLanguageInput, self).__init__(**kwargs) self.id = id self.text = text @@ -2882,17 +3630,17 @@ class PiiDocumentEntities(msrest.serialization.Model): 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_2_preview_2.models.Entity] - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar redacted_text: Required. Returns redacted text. + :vartype redacted_text: str + :ivar entities: Required. Recognized entities in the document. + :vartype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.Entity] + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -2920,6 +3668,19 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword redacted_text: Required. Returns redacted text. + :paramtype redacted_text: str + :keyword entities: Required. Recognized entities in the document. + :paramtype entities: list[~azure.ai.textanalytics.v3_2_preview_2.models.Entity] + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(PiiDocumentEntities, self).__init__(**kwargs) self.id = id self.redacted_text = redacted_text @@ -2933,15 +3694,15 @@ class PiiResult(msrest.serialization.Model): 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_2_preview_2.models.PiiDocumentEntities] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Response by document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.PiiDocumentEntities] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -2966,6 +3727,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Response by document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.PiiDocumentEntities] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(PiiResult, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -2976,10 +3748,10 @@ def __init__( class PiiTask(msrest.serialization.Model): """PiiTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -2994,6 +3766,12 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(PiiTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -3002,17 +3780,18 @@ def __init__( class PiiTaskParameters(msrest.serialization.Model): """PiiTaskParameters. - :param domain: Possible values include: "phi", "none". Default value: "none". - :type domain: str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParametersDomain - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param pii_categories: (Optional) describes the PII categories to return. - :type pii_categories: list[str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiCategory] - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar domain: Possible values include: "phi", "none". Default value: "none". + :vartype domain: str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParametersDomain + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar pii_categories: (Optional) describes the PII categories to return. + :vartype pii_categories: list[str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiCategory] + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType """ _validation = { @@ -3037,6 +3816,21 @@ def __init__( string_index_type: Optional[Union[str, "StringIndexType"]] = None, **kwargs ): + """ + :keyword domain: Possible values include: "phi", "none". Default value: "none". + :paramtype domain: str or ~azure.ai.textanalytics.v3_2_preview_2.models.PiiTaskParametersDomain + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword pii_categories: (Optional) describes the PII categories to return. + :paramtype pii_categories: list[str or + ~azure.ai.textanalytics.v3_2_preview_2.models.PiiCategory] + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + """ super(PiiTaskParameters, self).__init__(**kwargs) self.domain = domain self.model_version = model_version @@ -3048,8 +3842,8 @@ def __init__( class PiiTaskResult(msrest.serialization.Model): """PiiTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult """ _attribute_map = { @@ -3062,6 +3856,10 @@ def __init__( results: Optional["PiiResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult + """ super(PiiTaskResult, self).__init__(**kwargs) self.results = results @@ -3071,16 +3869,16 @@ class RequestStatistics(msrest.serialization.Model): 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, + :ivar documents_count: Required. Number of documents submitted in the request. + :vartype documents_count: int + :ivar 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, + :vartype valid_documents_count: int + :ivar 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 + :vartype erroneous_documents_count: int + :ivar transactions_count: Required. Number of transactions for the request. + :vartype transactions_count: long """ _validation = { @@ -3106,6 +3904,18 @@ def __init__( transactions_count: int, **kwargs ): + """ + :keyword documents_count: Required. Number of documents submitted in the request. + :paramtype documents_count: int + :keyword valid_documents_count: Required. Number of valid documents. This excludes empty, + over-size limit or non-supported languages documents. + :paramtype valid_documents_count: int + :keyword erroneous_documents_count: Required. Number of invalid documents. This includes empty, + over-size limit or non-supported languages documents. + :paramtype erroneous_documents_count: int + :keyword transactions_count: Required. Number of transactions for the request. + :paramtype transactions_count: long + """ super(RequestStatistics, self).__init__(**kwargs) self.documents_count = documents_count self.valid_documents_count = valid_documents_count @@ -3118,20 +3928,20 @@ class SentenceAssessment(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param sentiment: Required. Assessment sentiment in the sentence. Possible values include: + :ivar sentiment: Required. Assessment sentiment in the sentence. Possible values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue - :param confidence_scores: Required. Assessment sentiment confidence scores in the sentence. - :type confidence_scores: + :vartype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue + :ivar confidence_scores: Required. Assessment sentiment confidence scores in the sentence. + :vartype confidence_scores: ~azure.ai.textanalytics.v3_2_preview_2.models.TargetConfidenceScoreLabel - :param offset: Required. The assessment offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the assessment. - :type length: int - :param text: Required. The assessment text detected. - :type text: str - :param is_negated: Required. The indicator representing if the assessment is negated. - :type is_negated: bool + :ivar offset: Required. The assessment offset from the start of the sentence. + :vartype offset: int + :ivar length: Required. The length of the assessment. + :vartype length: int + :ivar text: Required. The assessment text detected. + :vartype text: str + :ivar is_negated: Required. The indicator representing if the assessment is negated. + :vartype is_negated: bool """ _validation = { @@ -3163,6 +3973,22 @@ def __init__( is_negated: bool, **kwargs ): + """ + :keyword sentiment: Required. Assessment sentiment in the sentence. Possible values include: + "positive", "mixed", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue + :keyword confidence_scores: Required. Assessment sentiment confidence scores in the sentence. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_2_preview_2.models.TargetConfidenceScoreLabel + :keyword offset: Required. The assessment offset from the start of the sentence. + :paramtype offset: int + :keyword length: Required. The length of the assessment. + :paramtype length: int + :keyword text: Required. The assessment text detected. + :paramtype text: str + :keyword is_negated: Required. The indicator representing if the assessment is negated. + :paramtype is_negated: bool + """ super(SentenceAssessment, self).__init__(**kwargs) self.sentiment = sentiment self.confidence_scores = confidence_scores @@ -3177,23 +4003,23 @@ class SentenceSentiment(msrest.serialization.Model): 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: + :ivar text: Required. The sentence text. + :vartype text: str + :ivar sentiment: Required. The predicted Sentiment for the sentence. Possible values include: "positive", "neutral", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentimentValue - :param confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + :vartype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentimentValue + :ivar confidence_scores: Required. The sentiment confidence score between 0 and 1 for the sentence for all classes. - :type confidence_scores: + :vartype confidence_scores: ~azure.ai.textanalytics.v3_2_preview_2.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 targets: The array of sentence targets for the sentence. - :type targets: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceTarget] - :param assessments: The array of assessments for the sentence. - :type assessments: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceAssessment] + :ivar offset: Required. The sentence offset from the start of the document. + :vartype offset: int + :ivar length: Required. The length of the sentence. + :vartype length: int + :ivar targets: The array of sentence targets for the sentence. + :vartype targets: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceTarget] + :ivar assessments: The array of assessments for the sentence. + :vartype assessments: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceAssessment] """ _validation = { @@ -3226,6 +4052,26 @@ def __init__( assessments: Optional[List["SentenceAssessment"]] = None, **kwargs ): + """ + :keyword text: Required. The sentence text. + :paramtype text: str + :keyword sentiment: Required. The predicted Sentiment for the sentence. Possible values + include: "positive", "neutral", "negative". + :paramtype sentiment: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.SentenceSentimentValue + :keyword confidence_scores: Required. The sentiment confidence score between 0 and 1 for the + sentence for all classes. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentConfidenceScorePerLabel + :keyword offset: Required. The sentence offset from the start of the document. + :paramtype offset: int + :keyword length: Required. The length of the sentence. + :paramtype length: int + :keyword targets: The array of sentence targets for the sentence. + :paramtype targets: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceTarget] + :keyword assessments: The array of assessments for the sentence. + :paramtype assessments: list[~azure.ai.textanalytics.v3_2_preview_2.models.SentenceAssessment] + """ super(SentenceSentiment, self).__init__(**kwargs) self.text = text self.sentiment = sentiment @@ -3241,22 +4087,22 @@ class SentenceTarget(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param sentiment: Required. Targeted sentiment in the sentence. Possible values include: + :ivar sentiment: Required. Targeted sentiment in the sentence. Possible values include: "positive", "mixed", "negative". - :type sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue - :param confidence_scores: Required. Target sentiment confidence scores for the target in the + :vartype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue + :ivar confidence_scores: Required. Target sentiment confidence scores for the target in the sentence. - :type confidence_scores: + :vartype confidence_scores: ~azure.ai.textanalytics.v3_2_preview_2.models.TargetConfidenceScoreLabel - :param offset: Required. The target offset from the start of the sentence. - :type offset: int - :param length: Required. The length of the target. - :type length: int - :param text: Required. The target text detected. - :type text: str - :param relations: Required. The array of either assessment or target objects which is related - to the target. - :type relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelation] + :ivar offset: Required. The target offset from the start of the sentence. + :vartype offset: int + :ivar length: Required. The length of the target. + :vartype length: int + :ivar text: Required. The target text detected. + :vartype text: str + :ivar relations: Required. The array of either assessment or target objects which is related to + the target. + :vartype relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelation] """ _validation = { @@ -3288,6 +4134,24 @@ def __init__( relations: List["TargetRelation"], **kwargs ): + """ + :keyword sentiment: Required. Targeted sentiment in the sentence. Possible values include: + "positive", "mixed", "negative". + :paramtype sentiment: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TokenSentimentValue + :keyword confidence_scores: Required. Target sentiment confidence scores for the target in the + sentence. + :paramtype confidence_scores: + ~azure.ai.textanalytics.v3_2_preview_2.models.TargetConfidenceScoreLabel + :keyword offset: Required. The target offset from the start of the sentence. + :paramtype offset: int + :keyword length: Required. The length of the target. + :paramtype length: int + :keyword text: Required. The target text detected. + :paramtype text: str + :keyword relations: Required. The array of either assessment or target objects which is related + to the target. + :paramtype relations: list[~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelation] + """ super(SentenceTarget, self).__init__(**kwargs) self.sentiment = sentiment self.confidence_scores = confidence_scores @@ -3300,10 +4164,11 @@ def __init__( class SentimentAnalysisTask(msrest.serialization.Model): """SentimentAnalysisTask. - :param parameters: - :type parameters: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentAnalysisTaskParameters - :param task_name: - :type task_name: str + :ivar parameters: + :vartype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentAnalysisTaskParameters + :ivar task_name: + :vartype task_name: str """ _attribute_map = { @@ -3318,6 +4183,13 @@ def __init__( task_name: Optional[str] = None, **kwargs ): + """ + :keyword parameters: + :paramtype parameters: + ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentAnalysisTaskParameters + :keyword task_name: + :paramtype task_name: str + """ super(SentimentAnalysisTask, self).__init__(**kwargs) self.parameters = parameters self.task_name = task_name @@ -3326,15 +4198,16 @@ def __init__( class SentimentAnalysisTaskParameters(msrest.serialization.Model): """SentimentAnalysisTaskParameters. - :param model_version: - :type model_version: str - :param logging_opt_out: - :type logging_opt_out: bool - :param opinion_mining: - :type opinion_mining: bool - :param string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + :ivar model_version: + :vartype model_version: str + :ivar logging_opt_out: + :vartype logging_opt_out: bool + :ivar opinion_mining: + :vartype opinion_mining: bool + :ivar string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", "Utf16CodeUnit". - :type string_index_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + :vartype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType """ _attribute_map = { @@ -3353,6 +4226,18 @@ def __init__( string_index_type: Optional[Union[str, "StringIndexType"]] = None, **kwargs ): + """ + :keyword model_version: + :paramtype model_version: str + :keyword logging_opt_out: + :paramtype logging_opt_out: bool + :keyword opinion_mining: + :paramtype opinion_mining: bool + :keyword string_index_type: Possible values include: "TextElement_v8", "UnicodeCodePoint", + "Utf16CodeUnit". + :paramtype string_index_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.StringIndexType + """ super(SentimentAnalysisTaskParameters, self).__init__(**kwargs) self.model_version = model_version self.logging_opt_out = logging_opt_out @@ -3365,12 +4250,12 @@ class SentimentConfidenceScorePerLabel(msrest.serialization.Model): 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 + :ivar positive: Required. + :vartype positive: float + :ivar neutral: Required. + :vartype neutral: float + :ivar negative: Required. + :vartype negative: float """ _validation = { @@ -3393,6 +4278,14 @@ def __init__( negative: float, **kwargs ): + """ + :keyword positive: Required. + :paramtype positive: float + :keyword neutral: Required. + :paramtype neutral: float + :keyword negative: Required. + :paramtype negative: float + """ super(SentimentConfidenceScorePerLabel, self).__init__(**kwargs) self.positive = positive self.neutral = neutral @@ -3404,15 +4297,15 @@ class SentimentResponse(msrest.serialization.Model): 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_2_preview_2.models.DocumentSentiment] - :param errors: Required. Errors by document id. - :type errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar documents: Required. Sentiment analysis per document. + :vartype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentSentiment] + :ivar errors: Required. Errors by document id. + :vartype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the request payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics - :param model_version: Required. This field indicates which model is used for scoring. - :type model_version: str + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :ivar model_version: Required. This field indicates which model is used for scoring. + :vartype model_version: str """ _validation = { @@ -3437,6 +4330,17 @@ def __init__( statistics: Optional["RequestStatistics"] = None, **kwargs ): + """ + :keyword documents: Required. Sentiment analysis per document. + :paramtype documents: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentSentiment] + :keyword errors: Required. Errors by document id. + :paramtype errors: list[~azure.ai.textanalytics.v3_2_preview_2.models.DocumentError] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the request payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.RequestStatistics + :keyword model_version: Required. This field indicates which model is used for scoring. + :paramtype model_version: str + """ super(SentimentResponse, self).__init__(**kwargs) self.documents = documents self.errors = errors @@ -3447,8 +4351,8 @@ def __init__( class SentimentTaskResult(msrest.serialization.Model): """SentimentTaskResult. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse """ _attribute_map = { @@ -3461,6 +4365,10 @@ def __init__( results: Optional["SentimentResponse"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse + """ super(SentimentTaskResult, self).__init__(**kwargs) self.results = results @@ -3470,15 +4378,15 @@ class SingleClassificationDocument(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param id: Required. Unique, non-empty document identifier. - :type id: str - :param classification: Required. - :type classification: ~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult - :param warnings: Required. Warnings encountered while processing document. - :type warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] - :param statistics: if showStats=true was specified in the request this field will contain + :ivar id: Required. Unique, non-empty document identifier. + :vartype id: str + :ivar classification: Required. + :vartype classification: ~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult + :ivar warnings: Required. Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :ivar statistics: if showStats=true was specified in the request this field will contain information about the document payload. - :type statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + :vartype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics """ _validation = { @@ -3503,6 +4411,17 @@ def __init__( statistics: Optional["DocumentStatistics"] = None, **kwargs ): + """ + :keyword id: Required. Unique, non-empty document identifier. + :paramtype id: str + :keyword classification: Required. + :paramtype classification: ~azure.ai.textanalytics.v3_2_preview_2.models.ClassificationResult + :keyword warnings: Required. Warnings encountered while processing document. + :paramtype warnings: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsWarning] + :keyword statistics: if showStats=true was specified in the request this field will contain + information about the document payload. + :paramtype statistics: ~azure.ai.textanalytics.v3_2_preview_2.models.DocumentStatistics + """ super(SingleClassificationDocument, self).__init__(**kwargs) self.id = id self.classification = classification @@ -3515,10 +4434,10 @@ class TargetConfidenceScoreLabel(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param positive: Required. - :type positive: float - :param negative: Required. - :type negative: float + :ivar positive: Required. + :vartype positive: float + :ivar negative: Required. + :vartype negative: float """ _validation = { @@ -3538,6 +4457,12 @@ def __init__( negative: float, **kwargs ): + """ + :keyword positive: Required. + :paramtype positive: float + :keyword negative: Required. + :paramtype negative: float + """ super(TargetConfidenceScoreLabel, self).__init__(**kwargs) self.positive = positive self.negative = negative @@ -3548,11 +4473,11 @@ class TargetRelation(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param relation_type: Required. The type related to the target. Possible values include: + :ivar relation_type: Required. The type related to the target. Possible values include: "assessment", "target". - :type relation_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelationType - :param ref: Required. The JSON pointer indicating the linked object. - :type ref: str + :vartype relation_type: str or ~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelationType + :ivar ref: Required. The JSON pointer indicating the linked object. + :vartype ref: str """ _validation = { @@ -3572,6 +4497,14 @@ def __init__( ref: str, **kwargs ): + """ + :keyword relation_type: Required. The type related to the target. Possible values include: + "assessment", "target". + :paramtype relation_type: str or + ~azure.ai.textanalytics.v3_2_preview_2.models.TargetRelationType + :keyword ref: Required. The JSON pointer indicating the linked object. + :paramtype ref: str + """ super(TargetRelation, self).__init__(**kwargs) self.relation_type = relation_type self.ref = ref @@ -3582,40 +4515,40 @@ class TasksStateTasks(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :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: + :ivar completed: Required. + :vartype completed: int + :ivar failed: Required. + :vartype failed: int + :ivar in_progress: Required. + :vartype in_progress: int + :ivar total: Required. + :vartype total: int + :ivar entity_recognition_tasks: + :vartype entity_recognition_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityRecognitionTasksItem] - :param entity_recognition_pii_tasks: - :type entity_recognition_pii_tasks: + :ivar entity_recognition_pii_tasks: + :vartype entity_recognition_pii_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityRecognitionPiiTasksItem] - :param key_phrase_extraction_tasks: - :type key_phrase_extraction_tasks: + :ivar key_phrase_extraction_tasks: + :vartype key_phrase_extraction_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksKeyPhraseExtractionTasksItem] - :param entity_linking_tasks: - :type entity_linking_tasks: + :ivar entity_linking_tasks: + :vartype entity_linking_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityLinkingTasksItem] - :param sentiment_analysis_tasks: - :type sentiment_analysis_tasks: + :ivar sentiment_analysis_tasks: + :vartype sentiment_analysis_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksSentimentAnalysisTasksItem] - :param extractive_summarization_tasks: - :type extractive_summarization_tasks: + :ivar extractive_summarization_tasks: + :vartype extractive_summarization_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksExtractiveSummarizationTasksItem] - :param custom_entity_recognition_tasks: - :type custom_entity_recognition_tasks: + :ivar custom_entity_recognition_tasks: + :vartype custom_entity_recognition_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomEntityRecognitionTasksItem] - :param custom_single_classification_tasks: - :type custom_single_classification_tasks: + :ivar custom_single_classification_tasks: + :vartype custom_single_classification_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomSingleClassificationTasksItem] - :param custom_multi_classification_tasks: - :type custom_multi_classification_tasks: + :ivar custom_multi_classification_tasks: + :vartype custom_multi_classification_tasks: list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomMultiClassificationTasksItem] """ @@ -3660,6 +4593,43 @@ def __init__( custom_multi_classification_tasks: Optional[List["TasksStateTasksCustomMultiClassificationTasksItem"]] = None, **kwargs ): + """ + :keyword completed: Required. + :paramtype completed: int + :keyword failed: Required. + :paramtype failed: int + :keyword in_progress: Required. + :paramtype in_progress: int + :keyword total: Required. + :paramtype total: int + :keyword entity_recognition_tasks: + :paramtype entity_recognition_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityRecognitionTasksItem] + :keyword entity_recognition_pii_tasks: + :paramtype entity_recognition_pii_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityRecognitionPiiTasksItem] + :keyword key_phrase_extraction_tasks: + :paramtype key_phrase_extraction_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksKeyPhraseExtractionTasksItem] + :keyword entity_linking_tasks: + :paramtype entity_linking_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksEntityLinkingTasksItem] + :keyword sentiment_analysis_tasks: + :paramtype sentiment_analysis_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksSentimentAnalysisTasksItem] + :keyword extractive_summarization_tasks: + :paramtype extractive_summarization_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksExtractiveSummarizationTasksItem] + :keyword custom_entity_recognition_tasks: + :paramtype custom_entity_recognition_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomEntityRecognitionTasksItem] + :keyword custom_single_classification_tasks: + :paramtype custom_single_classification_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomSingleClassificationTasksItem] + :keyword custom_multi_classification_tasks: + :paramtype custom_multi_classification_tasks: + list[~azure.ai.textanalytics.v3_2_preview_2.models.TasksStateTasksCustomMultiClassificationTasksItem] + """ super(TasksStateTasks, self).__init__(**kwargs) self.completed = completed self.failed = failed @@ -3681,13 +4651,13 @@ class TaskState(msrest.serialization.Model): 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 task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3710,6 +4680,15 @@ def __init__( status: Union[str, "State"], **kwargs ): + """ + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TaskState, self).__init__(**kwargs) self.last_update_date_time = last_update_date_time self.task_name = task_name @@ -3721,15 +4700,15 @@ class TasksStateTasksCustomEntityRecognitionTasksItem(TaskState, CustomEntitiesT All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3754,6 +4733,17 @@ def __init__( results: Optional["CustomEntitiesResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomEntitiesResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksCustomEntityRecognitionTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -3766,15 +4756,15 @@ class TasksStateTasksCustomMultiClassificationTasksItem(TaskState, CustomMultiCl All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3799,6 +4789,18 @@ def __init__( results: Optional["CustomMultiClassificationResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomMultiClassificationResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksCustomMultiClassificationTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -3811,15 +4813,16 @@ class TasksStateTasksCustomSingleClassificationTasksItem(TaskState, CustomSingle All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3844,6 +4847,18 @@ def __init__( results: Optional["CustomSingleClassificationResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: + ~azure.ai.textanalytics.v3_2_preview_2.models.CustomSingleClassificationResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksCustomSingleClassificationTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -3856,15 +4871,15 @@ class TasksStateTasksEntityLinkingTasksItem(TaskState, EntityLinkingTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3889,6 +4904,17 @@ def __init__( results: Optional["EntityLinkingResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntityLinkingResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksEntityLinkingTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -3901,15 +4927,15 @@ class TasksStateTasksEntityRecognitionPiiTasksItem(TaskState, PiiTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3934,6 +4960,17 @@ def __init__( results: Optional["PiiResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.PiiResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksEntityRecognitionPiiTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -3946,15 +4983,15 @@ class TasksStateTasksEntityRecognitionTasksItem(TaskState, EntitiesTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -3979,6 +5016,17 @@ def __init__( results: Optional["EntitiesResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.EntitiesResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksEntityRecognitionTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -3991,15 +5039,15 @@ class TasksStateTasksExtractiveSummarizationTasksItem(TaskState, ExtractiveSumma All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -4024,6 +5072,17 @@ def __init__( results: Optional["ExtractiveSummarizationResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.ExtractiveSummarizationResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksExtractiveSummarizationTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -4036,15 +5095,15 @@ class TasksStateTasksKeyPhraseExtractionTasksItem(TaskState, KeyPhraseTaskResult All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -4069,6 +5128,17 @@ def __init__( results: Optional["KeyPhraseResult"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.KeyPhraseResult + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksKeyPhraseExtractionTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -4081,15 +5151,15 @@ class TasksStateTasksSentimentAnalysisTasksItem(TaskState, SentimentTaskResult): All required parameters must be populated in order to send to Azure. - :param results: - :type results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse - :param last_update_date_time: Required. - :type last_update_date_time: ~datetime.datetime - :param task_name: Required. - :type task_name: str - :param status: Required. Possible values include: "notStarted", "running", "succeeded", + :ivar results: + :vartype results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse + :ivar last_update_date_time: Required. + :vartype last_update_date_time: ~datetime.datetime + :ivar task_name: Required. + :vartype task_name: str + :ivar status: Required. Possible values include: "notStarted", "running", "succeeded", "failed", "rejected", "cancelled", "cancelling". - :type status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + :vartype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State """ _validation = { @@ -4114,6 +5184,17 @@ def __init__( results: Optional["SentimentResponse"] = None, **kwargs ): + """ + :keyword results: + :paramtype results: ~azure.ai.textanalytics.v3_2_preview_2.models.SentimentResponse + :keyword last_update_date_time: Required. + :paramtype last_update_date_time: ~datetime.datetime + :keyword task_name: Required. + :paramtype task_name: str + :keyword status: Required. Possible values include: "notStarted", "running", "succeeded", + "failed", "rejected", "cancelled", "cancelling". + :paramtype status: str or ~azure.ai.textanalytics.v3_2_preview_2.models.State + """ super(TasksStateTasksSentimentAnalysisTasksItem, self).__init__(last_update_date_time=last_update_date_time, task_name=task_name, status=status, results=results, **kwargs) self.results = results self.last_update_date_time = last_update_date_time @@ -4126,17 +5207,17 @@ class TextAnalyticsError(msrest.serialization.Model): 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_2_preview_2.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_2_preview_2.models.InnerError - :param details: Details about specific errors that led to this reported error. - :type details: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + :ivar code: Required. Error code. Possible values include: "InvalidRequest", "InvalidArgument", + "InternalServerError", "ServiceUnavailable", "NotFound". + :vartype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.ErrorCodeValue + :ivar message: Required. Error message. + :vartype message: str + :ivar target: Error target. + :vartype target: str + :ivar innererror: Inner error contains more specific information. + :vartype innererror: ~azure.ai.textanalytics.v3_2_preview_2.models.InnerError + :ivar details: Details about specific errors that led to this reported error. + :vartype details: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] """ _validation = { @@ -4162,6 +5243,19 @@ def __init__( details: Optional[List["TextAnalyticsError"]] = None, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "InvalidRequest", + "InvalidArgument", "InternalServerError", "ServiceUnavailable", "NotFound". + :paramtype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.ErrorCodeValue + :keyword message: Required. Error message. + :paramtype message: str + :keyword target: Error target. + :paramtype target: str + :keyword innererror: Inner error contains more specific information. + :paramtype innererror: ~azure.ai.textanalytics.v3_2_preview_2.models.InnerError + :keyword details: Details about specific errors that led to this reported error. + :paramtype details: list[~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError] + """ super(TextAnalyticsError, self).__init__(**kwargs) self.code = code self.message = message @@ -4175,13 +5269,13 @@ class TextAnalyticsWarning(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. Error code. Possible values include: "LongWordsInDocument", + :ivar code: Required. Error code. Possible values include: "LongWordsInDocument", "DocumentTruncated". - :type code: str or ~azure.ai.textanalytics.v3_2_preview_2.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 + :vartype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.WarningCodeValue + :ivar message: Required. Warning message. + :vartype message: str + :ivar target_ref: A JSON pointer reference indicating the target object. + :vartype target_ref: str """ _validation = { @@ -4203,6 +5297,15 @@ def __init__( target_ref: Optional[str] = None, **kwargs ): + """ + :keyword code: Required. Error code. Possible values include: "LongWordsInDocument", + "DocumentTruncated". + :paramtype code: str or ~azure.ai.textanalytics.v3_2_preview_2.models.WarningCodeValue + :keyword message: Required. Warning message. + :paramtype message: str + :keyword target_ref: A JSON pointer reference indicating the target object. + :paramtype target_ref: str + """ super(TextAnalyticsWarning, self).__init__(**kwargs) self.code = code self.message = message diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_text_analytics_client_enums.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_text_analytics_client_enums.py index 06156b3b116d..61ecf267b1a7 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_text_analytics_client_enums.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/models/_text_analytics_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -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 Association(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Association(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes if the entity is the subject of the text or if it describes someone else. """ SUBJECT = "subject" OTHER = "other" -class Certainty(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Certainty(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes the entities certainty and polarity. """ @@ -43,14 +28,14 @@ class Certainty(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NEGATIVE_POSSIBLE = "negativePossible" NEGATIVE = "negative" -class Conditionality(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Conditionality(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Describes any conditionality on the entity. """ HYPOTHETICAL = "hypothetical" CONDITIONAL = "conditional" -class DocumentSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DocumentSentimentValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Predicted sentiment for document (Negative, Neutral, Positive, or Mixed). """ @@ -59,7 +44,7 @@ class DocumentSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) NEGATIVE = "negative" MIXED = "mixed" -class ErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ErrorCodeValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Error code. """ @@ -69,12 +54,12 @@ class ErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SERVICE_UNAVAILABLE = "ServiceUnavailable" NOT_FOUND = "NotFound" -class ExtractiveSummarizationTaskParametersSortBy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExtractiveSummarizationTaskParametersSortBy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): OFFSET = "Offset" RANK = "Rank" -class HealthcareEntityCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class HealthcareEntityCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Healthcare Entity Category. """ @@ -105,7 +90,7 @@ class HealthcareEntityCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enu FAMILY_RELATION = "FAMILY_RELATION" TREATMENT_NAME = "TREATMENT_NAME" -class InnerErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class InnerErrorCodeValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Error code. """ @@ -119,7 +104,7 @@ class InnerErrorCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UNSUPPORTED_LANGUAGE_CODE = "UnsupportedLanguageCode" INVALID_COUNTRY_HINT = "InvalidCountryHint" -class PiiCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PiiCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ABA_ROUTING_NUMBER = "ABARoutingNumber" AR_NATIONAL_IDENTITY_NUMBER = "ARNationalIdentityNumber" @@ -295,12 +280,12 @@ class PiiCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ALL = "All" DEFAULT = "Default" -class PiiTaskParametersDomain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PiiTaskParametersDomain(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): PHI = "phi" NONE = "none" -class RelationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RelationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of relation. Examples include: ``DosageOfMedication`` or 'FrequencyOfMedication', etc. """ @@ -326,7 +311,7 @@ class RelationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VALUE_OF_CONDITION = "ValueOfCondition" VALUE_OF_EXAMINATION = "ValueOfExamination" -class SentenceSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SentenceSentimentValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The predicted Sentiment for the sentence. """ @@ -334,7 +319,7 @@ class SentenceSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) NEUTRAL = "neutral" NEGATIVE = "negative" -class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class State(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): NOT_STARTED = "notStarted" RUNNING = "running" @@ -344,7 +329,7 @@ class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): CANCELLED = "cancelled" CANCELLING = "cancelling" -class StringIndexType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +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 @@ -357,14 +342,14 @@ class StringIndexType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: application is written in a language that support Unicode, for example Java, JavaScript. UTF16_CODE_UNIT = "Utf16CodeUnit" -class TargetRelationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TargetRelationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type related to the target. """ ASSESSMENT = "assessment" TARGET = "target" -class TokenSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TokenSentimentValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Targeted sentiment in the sentence. """ @@ -372,7 +357,7 @@ class TokenSentimentValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MIXED = "mixed" NEGATIVE = "negative" -class WarningCodeValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WarningCodeValue(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Error code. """ diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/operations/_text_analytics_client_operations.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/operations/_text_analytics_client_operations.py index 36c65ad8e120..c226e00b86c4 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/operations/_text_analytics_client_operations.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2/operations/_text_analytics_client_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from ...._lro import AnalyzeActionsLROPoller, AnalyzeActionsLROPollingMethod, 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.polling.base_polling import LROBasePolling +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,6 +29,419 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +# fmt: off + +def build_analyze_request_initial( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/analyze') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + headers=header_parameters, + **kwargs + ) + + +def build_analyze_status_request( + job_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + top = kwargs.pop('top', 20) # type: Optional[int] + skip = kwargs.pop('skip', 0) # type: Optional[int] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/analyze/jobs/{jobId}') + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if top is not None: + query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', maximum=50, minimum=1) + if skip is not None: + query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_health_status_request( + job_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + top = kwargs.pop('top', 20) # type: Optional[int] + skip = kwargs.pop('skip', 0) # type: Optional[int] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/health/jobs/{jobId}') + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if top is not None: + query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', maximum=50, minimum=1) + if skip is not None: + query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_cancel_health_job_request_initial( + job_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/health/jobs/{jobId}') + path_format_arguments = { + "jobId": _SERIALIZER.url("job_id", job_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + headers=header_parameters, + **kwargs + ) + + +def build_health_request_initial( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + string_index_type = kwargs.pop('string_index_type', None) # type: Optional[Union[str, "_models.StringIndexType"]] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/health/jobs') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if string_index_type is not None: + query_parameters['stringIndexType'] = _SERIALIZER.query("string_index_type", string_index_type, 'str') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_entities_recognition_general_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + string_index_type = kwargs.pop('string_index_type', None) # type: Optional[Union[str, "_models.StringIndexType"]] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/recognition/general') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + if string_index_type is not None: + query_parameters['stringIndexType'] = _SERIALIZER.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_entities_recognition_pii_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + domain = kwargs.pop('domain', None) # type: Optional[str] + string_index_type = kwargs.pop('string_index_type', None) # type: Optional[Union[str, "_models.StringIndexType"]] + pii_categories = kwargs.pop('pii_categories', None) # type: Optional[List[Union[str, "_models.PiiCategory"]]] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/recognition/pii') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + if domain is not None: + query_parameters['domain'] = _SERIALIZER.query("domain", domain, 'str') + if string_index_type is not None: + query_parameters['stringIndexType'] = _SERIALIZER.query("string_index_type", string_index_type, 'str') + if pii_categories is not None: + query_parameters['piiCategories'] = _SERIALIZER.query("pii_categories", pii_categories, '[str]', div=',') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_entities_linking_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + string_index_type = kwargs.pop('string_index_type', None) # type: Optional[Union[str, "_models.StringIndexType"]] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/entities/linking') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + if string_index_type is not None: + query_parameters['stringIndexType'] = _SERIALIZER.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_key_phrases_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/keyPhrases') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_languages_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/languages') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_sentiment_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + model_version = kwargs.pop('model_version', None) # type: Optional[str] + show_stats = kwargs.pop('show_stats', None) # type: Optional[bool] + logging_opt_out = kwargs.pop('logging_opt_out', None) # type: Optional[bool] + opinion_mining = kwargs.pop('opinion_mining', None) # type: Optional[bool] + string_index_type = kwargs.pop('string_index_type', None) # type: Optional[Union[str, "_models.StringIndexType"]] + + accept = "application/json, text/json" + # Construct URL + url = kwargs.pop("template_url", '/sentiment') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if model_version is not None: + query_parameters['model-version'] = _SERIALIZER.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = _SERIALIZER.query("show_stats", show_stats, 'bool') + if logging_opt_out is not None: + query_parameters['loggingOptOut'] = _SERIALIZER.query("logging_opt_out", logging_opt_out, 'bool') + if opinion_mining is not None: + query_parameters['opinionMining'] = _SERIALIZER.query("opinion_mining", opinion_mining, 'bool') + if string_index_type is not None: + query_parameters['stringIndexType'] = _SERIALIZER.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class TextAnalyticsClientOperationsMixin(object): def _analyze_initial( @@ -37,53 +455,50 @@ def _analyze_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } 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] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[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] if body is not None: - body_content = self._serialize.body(body, 'AnalyzeBatchInput') + json = 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) + json = None + + request = build_analyze_request_initial( + content_type=content_type, + json=json, + template_url=self._analyze_initial.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) - response_headers = {} deserialized = None + response_headers = {} 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 + + @distributed_trace def begin_analyze( self, body=None, # type: Optional["_models.AnalyzeBatchInput"] @@ -99,15 +514,20 @@ def begin_analyze( :type body: ~azure.ai.textanalytics.v3_2_preview_2.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: By default, your polling method will be AnalyzeActionsLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AnalyzeActionsLROPollingMethod. Pass + in False for this operation to not poll, or pass in 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 AnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response) - :rtype: ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.AnalyzeJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AnalyzeActionsLROPoller that returns either AnalyzeJobState or the + result of cls(response) + :rtype: + ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_2_preview_2.models.AnalyzeJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeJobState"] lro_delay = kwargs.pop( 'polling_interval', @@ -117,25 +537,25 @@ def begin_analyze( if cont_token is None: raw_result = self._analyze_initial( body=body, + content_type=content_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): + response = pipeline_response.http_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), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = AnalyzeActionsLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AnalyzeActionsLROPollingMethod(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -147,8 +567,10 @@ def get_long_running_output(pipeline_response): ) else: return AnalyzeActionsLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_analyze.metadata = {'url': '/analyze'} # type: ignore + @distributed_trace def analyze_status( self, job_id, # type: str @@ -185,36 +607,27 @@ def analyze_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self.analyze_status.metadata['url'] # type: ignore + + request = build_analyze_status_request( + job_id=job_id, + show_stats=show_stats, + top=top, + skip=skip, + template_url=self.analyze_status.metadata['url'], + ) + request = _convert_request(request) 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'), + "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 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('AnalyzeJobState', pipeline_response) @@ -223,8 +636,11 @@ def analyze_status( return cls(pipeline_response, deserialized, {}) return deserialized + analyze_status.metadata = {'url': '/analyze/jobs/{jobId}'} # type: ignore + + @distributed_trace def health_status( self, job_id, # type: str @@ -259,36 +675,27 @@ def health_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self.health_status.metadata['url'] # type: ignore + + request = build_health_status_request( + job_id=job_id, + top=top, + skip=skip, + show_stats=show_stats, + template_url=self.health_status.metadata['url'], + ) + request = _convert_request(request) 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'), + "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 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('HealthcareJobState', pipeline_response) @@ -297,8 +704,10 @@ def health_status( 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 @@ -310,40 +719,36 @@ def _cancel_health_job_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - accept = "application/json, text/json" - # Construct URL - url = self._cancel_health_job_initial.metadata['url'] # type: ignore + + request = build_cancel_health_job_request_initial( + job_id=job_id, + template_url=self._cancel_health_job_initial.metadata['url'], + ) + request = _convert_request(request) 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'), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + 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 + + @distributed_trace def begin_cancel_health_job( self, job_id, # type: str @@ -358,15 +763,17 @@ def begin_cancel_health_job( :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: By default, your polling method will be LROBasePolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for + this operation to not poll, or pass in 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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -379,20 +786,18 @@ def begin_cancel_health_job( 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'), + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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: @@ -404,6 +809,7 @@ def get_long_running_output(pipeline_response): ) 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( @@ -421,57 +827,50 @@ def _health_initial( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self._health_initial.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_health_request_initial( + content_type=content_type, + model_version=model_version, + string_index_type=string_index_type, + logging_opt_out=logging_opt_out, + json=json, + template_url=self._health_initial.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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') - if logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) - response_headers = {} deserialized = None + response_headers = {} 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 + + @distributed_trace def begin_health( self, documents, # type: List["_models.MultiLanguageInput"] @@ -505,15 +904,20 @@ def begin_health( :type logging_opt_out: bool :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: By default, your polling method will be AnalyzeHealthcareEntitiesLROPollingMethod. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be + AnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll, or + pass in 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_2_preview_2.models.HealthcareJobState] - :raises ~azure.core.exceptions.HttpResponseError: + :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_2_preview_2.models.HealthcareJobState] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.HealthcareJobState"] lro_delay = kwargs.pop( 'polling_interval', @@ -526,25 +930,25 @@ def begin_health( model_version=model_version, string_index_type=string_index_type, logging_opt_out=logging_opt_out, + content_type=content_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): + response = pipeline_response.http_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), + "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) + 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: @@ -556,8 +960,10 @@ def get_long_running_output(pipeline_response): ) else: return AnalyzeHealthcareEntitiesLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_health.metadata = {'url': '/entities/health/jobs'} # type: ignore + @distributed_trace def entities_recognition_general( self, documents, # type: List["_models.MultiLanguageInput"] @@ -606,43 +1012,32 @@ def entities_recognition_general( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_recognition_general.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_recognition_general_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + string_index_type=string_index_type, + json=json, + template_url=self.entities_recognition_general.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntitiesResult', pipeline_response) @@ -651,8 +1046,11 @@ def entities_recognition_general( return cls(pipeline_response, deserialized, {}) return deserialized + entities_recognition_general.metadata = {'url': '/entities/recognition/general'} # type: ignore + + @distributed_trace def entities_recognition_pii( self, documents, # type: List["_models.MultiLanguageInput"] @@ -709,47 +1107,34 @@ def entities_recognition_pii( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_recognition_pii.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_recognition_pii_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + domain=domain, + string_index_type=string_index_type, + pii_categories=pii_categories, + json=json, + template_url=self.entities_recognition_pii.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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') - if pii_categories is not None: - query_parameters['piiCategories'] = self._serialize.query("pii_categories", pii_categories, '[str]', div=',') - - # 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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PiiResult', pipeline_response) @@ -758,8 +1143,11 @@ def entities_recognition_pii( return cls(pipeline_response, deserialized, {}) return deserialized + entities_recognition_pii.metadata = {'url': '/entities/recognition/pii'} # type: ignore + + @distributed_trace def entities_linking( self, documents, # type: List["_models.MultiLanguageInput"] @@ -807,43 +1195,32 @@ def entities_linking( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.entities_linking.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_entities_linking_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + string_index_type=string_index_type, + json=json, + template_url=self.entities_linking.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('EntityLinkingResult', pipeline_response) @@ -852,8 +1229,11 @@ def entities_linking( return cls(pipeline_response, deserialized, {}) return deserialized + entities_linking.metadata = {'url': '/entities/linking'} # type: ignore + + @distributed_trace def key_phrases( self, documents, # type: List["_models.MultiLanguageInput"] @@ -896,41 +1276,31 @@ def key_phrases( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.key_phrases.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_key_phrases_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + json=json, + template_url=self.key_phrases.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('KeyPhraseResult', pipeline_response) @@ -939,8 +1309,11 @@ def key_phrases( return cls(pipeline_response, deserialized, {}) return deserialized + key_phrases.metadata = {'url': '/keyPhrases'} # type: ignore + + @distributed_trace def languages( self, documents, # type: List["_models.LanguageInput"] @@ -984,41 +1357,31 @@ def languages( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.languages.metadata['url'] # type: ignore + _input = _models.LanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'LanguageBatchInput') + + request = build_languages_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + json=json, + template_url=self.languages.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('LanguageResult', pipeline_response) @@ -1027,8 +1390,11 @@ def languages( return cls(pipeline_response, deserialized, {}) return deserialized + languages.metadata = {'url': '/languages'} # type: ignore + + @distributed_trace def sentiment( self, documents, # type: List["_models.MultiLanguageInput"] @@ -1080,45 +1446,33 @@ def sentiment( } 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" + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct URL - url = self.sentiment.metadata['url'] # type: ignore + _input = _models.MultiLanguageBatchInput(documents=documents) + json = self._serialize.body(_input, 'MultiLanguageBatchInput') + + request = build_sentiment_request( + content_type=content_type, + model_version=model_version, + show_stats=show_stats, + logging_opt_out=logging_opt_out, + opinion_mining=opinion_mining, + string_index_type=string_index_type, + json=json, + template_url=self.sentiment.metadata['url'], + ) + request = _convert_request(request) path_format_arguments = { - 'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "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 logging_opt_out is not None: - query_parameters['loggingOptOut'] = self._serialize.query("logging_opt_out", logging_opt_out, '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) + request.url = self._client.format_url(request.url, **path_format_arguments) + 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SentimentResponse', pipeline_response) @@ -1127,4 +1481,6 @@ def sentiment( return cls(pipeline_response, deserialized, {}) return deserialized + sentiment.metadata = {'url': '/sentiment'} # type: ignore + 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 ee9c6b437b69..0327200212f3 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py @@ -1746,6 +1746,9 @@ class _AnalyzeActionsType(str, Enum): ) ANALYZE_SENTIMENT = "analyze_sentiment" #: Sentiment Analysis action. EXTRACT_SUMMARY = "extract_summary" + RECOGNIZE_CUSTOM_ENTITIES = "recognize_custom_entities" + SINGLE_CATEGORY_CLASSIFY = "single_category_classify" + MULTI_CATEGORY_CLASSIFY = "multi_category_classify" class RecognizeEntitiesAction(DictMixin): @@ -2244,3 +2247,376 @@ def _from_generated(cls, sentence): offset=sentence.offset, length=sentence.length, ) + + +class RecognizeCustomEntitiesAction(DictMixin): + """RecognizeCustomEntitiesAction. + + :param project_name: Required. This field indicates the project name for the model. + :type project_name: str + :param deployment_name: This field indicates the deployment name for the model. + :type deployment_name: str + :keyword str string_index_type: Specifies the method used to interpret string offsets. + `UnicodeCodePoint`, the Python encoding, is the default. To override the Python default, + you can also pass in `Utf16CodePoint` or TextElement_v8`. For additional information + see https://aka.ms/text-analytics-offsets + :keyword bool disable_service_logs: If set to true, you opt-out of having your text input + logged on the service side for troubleshooting. By default, Text Analytics logs your + input text for 48 hours, solely to allow for troubleshooting issues in providing you with + the Text Analytics natural language processing functions. Setting this parameter to true, + disables input logging and may limit our ability to remediate issues that occur. Please see + Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for + additional details, and Microsoft Responsible AI principles at + https://www.microsoft.com/ai/responsible-ai. + :ivar str project_name: This field indicates the project name for the model. + :ivar str deployment_name: This field indicates the deployment name for the model. + :ivar str string_index_type: Specifies the method used to interpret string offsets. + `UnicodeCodePoint`, the Python encoding, is the default. To override the Python default, + you can also pass in `Utf16CodePoint` or TextElement_v8`. For additional information + see https://aka.ms/text-analytics-offsets + :ivar bool disable_service_logs: If set to true, you opt-out of having your text input + logged on the service side for troubleshooting. By default, Text Analytics logs your + input text for 48 hours, solely to allow for troubleshooting issues in providing you with + the Text Analytics natural language processing functions. Setting this parameter to true, + disables input logging and may limit our ability to remediate issues that occur. Please see + Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for + additional details, and Microsoft Responsible AI principles at + https://www.microsoft.com/ai/responsible-ai. + """ + + def __init__( + self, + project_name, + deployment_name, + **kwargs + ): + self.project_name = project_name + self.deployment_name = deployment_name + self.disable_service_logs = kwargs.get('disable_service_logs', None) + self.string_index_type = kwargs.get('string_index_type', None) + + def __repr__(self): + return "RecognizeCustomEntitiesAction(project_name={}, deployment_name={}, disable_service_logs={}, " \ + "string_index_type={})".format( + self.project_name, + self.deployment_name, + self.disable_service_logs, + self.string_index_type, + )[:1024] + + def _to_generated(self, api_version): # pylint: disable=unused-argument + return _v3_2_preview_models.CustomEntitiesTask( + parameters=_v3_2_preview_models.CustomEntitiesTaskParameters( + project_name=self.project_name, + deployment_name=self.deployment_name, + string_index_type=self.string_index_type, + logging_opt_out=self.disable_service_logs, + ) + ) + + +class RecognizeCustomEntitiesResult(DictMixin): + """RecognizeCustomEntitiesResult is a result object which contains + the custom recognized entities from a particular document. + + :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: Recognized custom entities in the document. + :vartype entities: + list[~azure.ai.textanalytics.CategorizedEntity] + :ivar warnings: Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] + :ivar statistics: If `show_stats=True` was specified in the request this + field will contain information about the document payload. + :vartype statistics: ~azure.ai.textanalytics.TextDocumentStatistics + :ivar bool is_error: Boolean check for error item when iterating over list of + results. Always False for an instance of a RecognizeCustomEntitiesResult. + """ + + def __init__(self, **kwargs): + self.id = kwargs.get("id", None) + self.entities = kwargs.get("entities", None) + self.warnings = kwargs.get("warnings", []) + self.statistics = kwargs.get("statistics", None) + self.is_error = False + + def __repr__(self): + return "RecognizeCustomEntitiesResult(id={}, entities={}, warnings={}, statistics={}, is_error={})".format( + self.id, + repr(self.entities), + repr(self.warnings), + repr(self.statistics), + self.is_error, + )[ + :1024 + ] + + @classmethod + def _from_generated(cls, result): + return cls( + id=result.id, + entities=[ + CategorizedEntity._from_generated(e) # pylint: disable=protected-access + for e in result.entities + ], + warnings=[ + TextAnalyticsWarning._from_generated( # pylint: disable=protected-access + w + ) + for w in result.warnings + ], + statistics=TextDocumentStatistics._from_generated( # pylint: disable=protected-access + result.statistics + ), + ) + + +class MultiCategoryClassifyAction(DictMixin): + """MultiCategoryClassifyAction. + + :param project_name: Required. This field indicates the project name for the model. + :type project_name: str + :param deployment_name: This field indicates the deployment name for the model. + :type deployment_name: str + :keyword bool disable_service_logs: If set to true, you opt-out of having your text input + logged on the service side for troubleshooting. By default, Text Analytics logs your + input text for 48 hours, solely to allow for troubleshooting issues in providing you with + the Text Analytics natural language processing functions. Setting this parameter to true, + disables input logging and may limit our ability to remediate issues that occur. Please see + Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for + additional details, and Microsoft Responsible AI principles at + https://www.microsoft.com/ai/responsible-ai. + :ivar str project_name: This field indicates the project name for the model. + :ivar str deployment_name: This field indicates the deployment name for the model. + :ivar bool disable_service_logs: If set to true, you opt-out of having your text input + logged on the service side for troubleshooting. By default, Text Analytics logs your + input text for 48 hours, solely to allow for troubleshooting issues in providing you with + the Text Analytics natural language processing functions. Setting this parameter to true, + disables input logging and may limit our ability to remediate issues that occur. Please see + Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for + additional details, and Microsoft Responsible AI principles at + https://www.microsoft.com/ai/responsible-ai. + """ + + def __init__( + self, + project_name, + deployment_name, + **kwargs + ): + self.project_name = project_name + self.deployment_name = deployment_name + self.disable_service_logs = kwargs.get('disable_service_logs', None) + + def __repr__(self): + return "MultiCategoryClassifyAction(project_name={}, deployment_name={}, " \ + "disable_service_logs={})".format( + self.project_name, + self.deployment_name, + self.disable_service_logs, + )[:1024] + + def _to_generated(self, api_version): # pylint: disable=unused-argument + return _v3_2_preview_models.CustomMultiClassificationTask( + parameters=_v3_2_preview_models.CustomMultiClassificationTaskParameters( + project_name=self.project_name, + deployment_name=self.deployment_name, + logging_opt_out=self.disable_service_logs, + ) + ) + + +class MultiCategoryClassifyResult(DictMixin): + """MultiCategoryClassifyResult. + + :ivar str id: Required. Unique, non-empty document identifier. + :ivar classifications: Required. Recognized classification results in the document. + :vartype classifications: list[~azure.ai.textanalytics.ClassificationCategory] + :ivar warnings: Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] + :ivar statistics: If `show_stats=True` was specified in the request this + field will contain information about the document payload. + :vartype statistics: ~azure.ai.textanalytics.TextDocumentStatistics + :ivar bool is_error: Boolean check for error item when iterating over list of + results. Always False for an instance of a MultiCategoryClassifyResult. + """ + + def __init__( + self, + **kwargs + ): + self.id = kwargs.get('id', None) + self.classifications = kwargs.get('classifications', None) + self.warnings = kwargs.get('warnings', []) + self.statistics = kwargs.get('statistics', None) + self.is_error = False + + def __repr__(self): + return "MultiCategoryClassifyResult(id={}, classifications={}, warnings={}, statistics={}, " \ + "is_error={})".format( + self.id, + repr(self.classifications), + repr(self.warnings), + repr(self.statistics), + self.is_error, + )[ + :1024 + ] + + @classmethod + def _from_generated(cls, result): + return cls( + id=result.id, + classifications=[ + ClassificationCategory._from_generated(e) # pylint: disable=protected-access + for e in result.classifications + ], + warnings=[ + TextAnalyticsWarning._from_generated( # pylint: disable=protected-access + w + ) + for w in result.warnings + ], + statistics=TextDocumentStatistics._from_generated( # pylint: disable=protected-access + result.statistics + ), + ) + + +class SingleCategoryClassifyAction(DictMixin): + """SingleCategoryClassifyAction. + + :param project_name: Required. This field indicates the project name for the model. + :type project_name: str + :param deployment_name: This field indicates the deployment name for the model. + :type deployment_name: str + :keyword bool disable_service_logs: If set to true, you opt-out of having your text input + logged on the service side for troubleshooting. By default, Text Analytics logs your + input text for 48 hours, solely to allow for troubleshooting issues in providing you with + the Text Analytics natural language processing functions. Setting this parameter to true, + disables input logging and may limit our ability to remediate issues that occur. Please see + Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for + additional details, and Microsoft Responsible AI principles at + https://www.microsoft.com/ai/responsible-ai. + :ivar str project_name: This field indicates the project name for the model. + :ivar str deployment_name: This field indicates the deployment name for the model. + :ivar bool disable_service_logs: If set to true, you opt-out of having your text input + logged on the service side for troubleshooting. By default, Text Analytics logs your + input text for 48 hours, solely to allow for troubleshooting issues in providing you with + the Text Analytics natural language processing functions. Setting this parameter to true, + disables input logging and may limit our ability to remediate issues that occur. Please see + Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for + additional details, and Microsoft Responsible AI principles at + https://www.microsoft.com/ai/responsible-ai. + """ + + def __init__( + self, + project_name, + deployment_name, + **kwargs + ): + self.project_name = project_name + self.deployment_name = deployment_name + self.disable_service_logs = kwargs.get('disable_service_logs', None) + + def __repr__(self): + return "SingleCategoryClassifyAction(project_name={}, deployment_name={}, " \ + "disable_service_logs={})".format( + self.project_name, + self.deployment_name, + self.disable_service_logs, + )[:1024] + + def _to_generated(self, api_version): # pylint: disable=unused-argument + return _v3_2_preview_models.CustomSingleClassificationTask( + parameters=_v3_2_preview_models.CustomSingleClassificationTaskParameters( + project_name=self.project_name, + deployment_name=self.deployment_name, + logging_opt_out=self.disable_service_logs, + ) + ) + + +class SingleCategoryClassifyResult(DictMixin): + """SingleCategoryClassifyResult. + + :ivar str id: Required. Unique, non-empty document identifier. + :ivar classification: Required. Recognized classification results in the document. + :vartype classification: ~azure.ai.textanalytics.ClassificationCategory + :ivar warnings: Warnings encountered while processing document. + :vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning] + :ivar statistics: If `show_stats=True` was specified in the request this + field will contain information about the document payload. + :vartype statistics: ~azure.ai.textanalytics.TextDocumentStatistics + :ivar bool is_error: Boolean check for error item when iterating over list of + results. Always False for an instance of a SingleCategoryClassifyResult. + """ + + def __init__( + self, + **kwargs + ): + self.id = kwargs.get('id', None) + self.classification = kwargs.get('classification', None) + self.warnings = kwargs.get('warnings', []) + self.statistics = kwargs.get('statistics', None) + self.is_error = False + + def __repr__(self): + return "SingleCategoryClassifyResult(id={}, classification={}, warnings={}, statistics={}, " \ + "is_error={})".format( + self.id, + repr(self.classification), + repr(self.warnings), + repr(self.statistics), + self.is_error, + )[ + :1024 + ] + + @classmethod + def _from_generated(cls, result): + return cls( + id=result.id, + classification= + ClassificationCategory._from_generated(result.classification), # pylint: disable=protected-access + warnings=[ + TextAnalyticsWarning._from_generated( # pylint: disable=protected-access + w + ) + for w in result.warnings + ], + statistics=TextDocumentStatistics._from_generated( # pylint: disable=protected-access + result.statistics + ), + ) + + +class ClassificationCategory(DictMixin): + """ClassificationCategory. + + :ivar str category: Required. Classification type. + :ivar float confidence_score: Confidence score between 0 and 1 of the recognized classification. + """ + + def __init__( + self, + **kwargs + ): + self.category = kwargs.get('category', None) + self.confidence_score = kwargs.get('confidence_score', None) + + def __repr__(self): + return "ClassificationCategory(category={}, confidence_score={})".format( + self.category, + self.confidence_score, + )[:1024] + + @classmethod + def _from_generated(cls, result): + return cls( + category=result.category, + confidence_score=result.confidence_score + ) 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 2d94bfef3b31..dffe57534217 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 @@ -15,6 +15,9 @@ RecognizeLinkedEntitiesAction, AnalyzeSentimentAction, ExtractSummaryAction, + RecognizeCustomEntitiesAction, + SingleCategoryClassifyAction, + MultiCategoryClassifyAction, _AnalyzeActionsType, ) @@ -88,7 +91,7 @@ def _validate_input(documents, hint, whole_input_hint): return request_batch -def _determine_action_type(action): +def _determine_action_type(action): # pylint: disable=too-many-return-statements if isinstance(action, RecognizeEntitiesAction): return _AnalyzeActionsType.RECOGNIZE_ENTITIES if isinstance(action, RecognizePiiEntitiesAction): @@ -99,6 +102,12 @@ def _determine_action_type(action): return _AnalyzeActionsType.ANALYZE_SENTIMENT if isinstance(action, ExtractSummaryAction): return _AnalyzeActionsType.EXTRACT_SUMMARY + if isinstance(action, RecognizeCustomEntitiesAction): + return _AnalyzeActionsType.RECOGNIZE_CUSTOM_ENTITIES + if isinstance(action, SingleCategoryClassifyAction): + return _AnalyzeActionsType.SINGLE_CATEGORY_CLASSIFY + if isinstance(action, MultiCategoryClassifyAction): + return _AnalyzeActionsType.MULTI_CATEGORY_CLASSIFY return _AnalyzeActionsType.EXTRACT_KEY_PHRASES 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 d412ddf32643..b61109b47e5c 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 @@ -34,6 +34,9 @@ AnalyzeHealthcareEntitiesResult, ExtractSummaryResult, _AnalyzeActionsType, + RecognizeCustomEntitiesResult, + SingleCategoryClassifyResult, + MultiCategoryClassifyResult, ) @@ -260,6 +263,32 @@ def summary_result( ) +@prepare_result +def custom_entities_result( + custom_entities, results, *args, **kwargs +): # pylint: disable=unused-argument + return RecognizeCustomEntitiesResult._from_generated( # pylint: disable=protected-access + custom_entities + ) + + +@prepare_result +def single_category_classify_result( + custom_category, results, *args, **kwargs +): # pylint: disable=unused-argument + return SingleCategoryClassifyResult._from_generated( # pylint: disable=protected-access + custom_category + ) + +@prepare_result +def multi_category_classify_result( + custom_categories, results, *args, **kwargs +): # pylint: disable=unused-argument + return MultiCategoryClassifyResult._from_generated( # pylint: disable=protected-access + custom_categories + ) + + def healthcare_extract_page_data( doc_id_order, obj, response_headers, health_job_state ): # pylint: disable=unused-argument @@ -271,7 +300,7 @@ def healthcare_extract_page_data( ) -def _get_deserialization_callback_from_task_type(task_type): +def _get_deserialization_callback_from_task_type(task_type): # pylint: disable=too-many-return-statements if task_type == _AnalyzeActionsType.RECOGNIZE_ENTITIES: return entities_result if task_type == _AnalyzeActionsType.RECOGNIZE_PII_ENTITIES: @@ -282,10 +311,16 @@ def _get_deserialization_callback_from_task_type(task_type): return sentiment_result if task_type == _AnalyzeActionsType.EXTRACT_SUMMARY: return summary_result + if task_type == _AnalyzeActionsType.RECOGNIZE_CUSTOM_ENTITIES: + return custom_entities_result + if task_type == _AnalyzeActionsType.SINGLE_CATEGORY_CLASSIFY: + return single_category_classify_result + if task_type == _AnalyzeActionsType.MULTI_CATEGORY_CLASSIFY: + return multi_category_classify_result return key_phrases_result -def _get_property_name_from_task_type(task_type): +def _get_property_name_from_task_type(task_type): # pylint: disable=too-many-return-statements if task_type == _AnalyzeActionsType.RECOGNIZE_ENTITIES: return "entity_recognition_tasks" if task_type == _AnalyzeActionsType.RECOGNIZE_PII_ENTITIES: @@ -296,6 +331,12 @@ def _get_property_name_from_task_type(task_type): return "sentiment_analysis_tasks" if task_type == _AnalyzeActionsType.EXTRACT_SUMMARY: return "extractive_summarization_tasks" + if task_type == _AnalyzeActionsType.RECOGNIZE_CUSTOM_ENTITIES: + return "custom_entity_recognition_tasks" + if task_type == _AnalyzeActionsType.SINGLE_CATEGORY_CLASSIFY: + return "custom_single_classification_tasks" + if task_type == _AnalyzeActionsType.MULTI_CATEGORY_CLASSIFY: + return "custom_multi_classification_tasks" return "key_phrase_extraction_tasks" 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 bc93cc5d6ae7..5bb61f9bc303 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 @@ -64,6 +64,12 @@ AnalyzeHealthcareEntitiesResult, ExtractSummaryAction, ExtractSummaryResult, + RecognizeCustomEntitiesAction, + RecognizeCustomEntitiesResult, + SingleCategoryClassifyAction, + SingleCategoryClassifyResult, + MultiCategoryClassifyAction, + MultiCategoryClassifyResult, ) from ._lro import AnalyzeHealthcareEntitiesLROPoller, AnalyzeActionsLROPoller @@ -854,9 +860,9 @@ def _analyze_result_callback( def begin_analyze_actions( # type: ignore self, documents, # type: Union[List[str], List[TextDocumentInput], List[Dict[str, str]]] - actions, # type: List[Union[RecognizeEntitiesAction, RecognizeLinkedEntitiesAction, RecognizePiiEntitiesAction, ExtractKeyPhrasesAction, AnalyzeSentimentAction, ExtractSummaryAction]] # pylint: disable=line-too-long + actions, # type: List[Union[RecognizeEntitiesAction, RecognizeLinkedEntitiesAction, RecognizePiiEntitiesAction, ExtractKeyPhrasesAction, AnalyzeSentimentAction, ExtractSummaryAction, RecognizeCustomEntitiesAction, SingleCategoryClassifyAction, MultiCategoryClassifyAction]] # pylint: disable=line-too-long **kwargs # type: Any - ): # type: (...) -> AnalyzeActionsLROPoller[ItemPaged[List[Union[RecognizeEntitiesResult, RecognizeLinkedEntitiesResult, RecognizePiiEntitiesResult, ExtractKeyPhrasesResult, AnalyzeSentimentResult, ExtractSummaryResult, DocumentError]]]] # pylint: disable=line-too-long + ): # type: (...) -> AnalyzeActionsLROPoller[ItemPaged[List[Union[RecognizeEntitiesResult, RecognizeLinkedEntitiesResult, RecognizePiiEntitiesResult, ExtractKeyPhrasesResult, AnalyzeSentimentResult, ExtractSummaryResult, RecognizeCustomEntitiesResult, SingleCategoryClassifyResult, MultiCategoryClassifyResult, DocumentError]]]] # pylint: disable=line-too-long """Start a long-running operation to perform a variety of text analysis actions over a batch of documents. We recommend you use this function if you're looking to analyze larger documents, and / or @@ -877,7 +883,8 @@ def begin_analyze_actions( # type: ignore Duplicate actions in list not supported. :type actions: list[RecognizeEntitiesAction or RecognizePiiEntitiesAction or ExtractKeyPhrasesAction or - RecognizeLinkedEntitiesAction or AnalyzeSentimentAction or ExtractSummaryAction] + RecognizeLinkedEntitiesAction or AnalyzeSentimentAction or ExtractSummaryAction or + RecognizeCustomEntitiesAction or SingleCategoryClassifyAction or MultiCategoryClassifyAction] :keyword str display_name: An optional display name to set for the requested analysis. :keyword str language: The 2 letter ISO 639-1 representation of language for the entire batch. For example, use "en" for English; "es" for Spanish etc. @@ -901,13 +908,17 @@ def begin_analyze_actions( # type: ignore :rtype: ~azure.ai.textanalytics.AnalyzeActionsLROPoller[~azure.core.paging.ItemPaged[ list[Union[RecognizeEntitiesResult, RecognizeLinkedEntitiesResult, RecognizePiiEntitiesResult, - ExtractKeyPhrasesResult, AnalyzeSentimentResult, ExtractSummaryAction, DocumentError]]]] + ExtractKeyPhrasesResult, AnalyzeSentimentResult, ExtractSummaryAction, RecognizeCustomEntitiesResult, + SingleCategoryClassifyResult, MultiCategoryClassifyResult, DocumentError]]]] :raises ~azure.core.exceptions.HttpResponseError or TypeError or ValueError or NotImplementedError: .. versionadded:: v3.1 The *begin_analyze_actions* client method. .. versionadded:: v3.2-preview - The *ExtractSummaryAction* input option and *ExtractSummaryResult* result object + The *ExtractSummaryAction*, *RecognizeCustomEntitiesAction*, *SingleCategoryClassifyAction*, + and *MultiCategoryClassifyAction* input options and the corresponding *ExtractSummaryResult*, + *RecognizeCustomEntitiesResult*, *SingleCategoryClassifyResult*, and *MultiCategoryClassifyResult* + result objects .. admonition:: Example: @@ -1007,6 +1018,39 @@ def begin_analyze_actions( # type: ignore == _AnalyzeActionsType.EXTRACT_SUMMARY ] ], + custom_entity_recognition_tasks=[ + t._to_generated( # pylint: disable=protected-access + self._api_version + ) + for t in [ + a + for a in actions + if _determine_action_type(a) + == _AnalyzeActionsType.RECOGNIZE_CUSTOM_ENTITIES + ] + ], + custom_single_classification_tasks=[ + t._to_generated( # pylint: disable=protected-access + self._api_version + ) + for t in [ + a + for a in actions + if _determine_action_type(a) + == _AnalyzeActionsType.SINGLE_CATEGORY_CLASSIFY + ] + ], + custom_multi_classification_tasks=[ + t._to_generated( # pylint: disable=protected-access + self._api_version + ) + for t in [ + a + for a in actions + if _determine_action_type(a) + == _AnalyzeActionsType.MULTI_CATEGORY_CLASSIFY + ] + ], ) analyze_body = self._client.models( api_version=self._api_version diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py index cdebda24c1af..79b618b77ce8 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py @@ -35,8 +35,8 @@ def __init__(self, endpoint, credential, **kwargs): credential=credential, api_version=kwargs.pop("api_version", DEFAULT_API_VERSION), sdk_moniker=USER_AGENT, - authentication_policy=_authentication_policy(credential), - custom_hook_policy=TextAnalyticsResponseHookPolicy(**kwargs), + authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential)), + custom_hook_policy=kwargs.pop("custom_hook_policy", TextAnalyticsResponseHookPolicy(**kwargs)), **kwargs ) 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 f85d08348cc4..59764d7913c7 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 @@ -49,6 +49,12 @@ AnalyzeHealthcareEntitiesResult, ExtractSummaryAction, ExtractSummaryResult, + RecognizeCustomEntitiesAction, + RecognizeCustomEntitiesResult, + SingleCategoryClassifyAction, + SingleCategoryClassifyResult, + MultiCategoryClassifyAction, + MultiCategoryClassifyResult, ) from .._lro import TextAnalyticsOperationResourcePolling from ._lro_async import ( @@ -851,6 +857,9 @@ async def begin_analyze_actions( # type: ignore ExtractKeyPhrasesAction, AnalyzeSentimentAction, ExtractSummaryAction, + RecognizeCustomEntitiesAction, + SingleCategoryClassifyAction, + MultiCategoryClassifyAction, ] ], # pylint: disable=line-too-long **kwargs: Any, @@ -864,6 +873,9 @@ async def begin_analyze_actions( # type: ignore ExtractKeyPhrasesResult, AnalyzeSentimentResult, ExtractSummaryResult, + RecognizeCustomEntitiesResult, + SingleCategoryClassifyResult, + MultiCategoryClassifyResult, DocumentError, ] ] @@ -889,7 +901,9 @@ async def begin_analyze_actions( # type: ignore Duplicate actions in list not supported. :type actions: list[RecognizeEntitiesAction or RecognizePiiEntitiesAction or ExtractKeyPhrasesAction or - RecognizeLinkedEntitiesAction or AnalyzeSentimentAction, or ExtractSummaryAction] + RecognizeLinkedEntitiesAction or AnalyzeSentimentAction or ExtractSummaryAction or + RecognizeCustomEntitiesAction or SingleCategoryClassifyAction or + MultiCategoryClassifyAction] :keyword str display_name: An optional display name to set for the requested analysis. :keyword str language: The 2 letter ISO 639-1 representation of language for the entire batch. For example, use "en" for English; "es" for Spanish etc. @@ -913,13 +927,17 @@ async def begin_analyze_actions( # type: ignore :rtype: ~azure.ai.textanalytics.aio.AsyncAnalyzeActionsLROPoller[~azure.core.async_paging.AsyncItemPaged[ list[Union[RecognizeEntitiesResult, RecognizeLinkedEntitiesResult, RecognizePiiEntitiesResult, - ExtractKeyPhrasesResult, AnalyzeSentimentResult, ExtractSummaryResult, DocumentError]]]] + ExtractKeyPhrasesResult, AnalyzeSentimentResult, ExtractSummaryAction, RecognizeCustomEntitiesResult, + SingleCategoryClassifyResult, MultiCategoryClassifyResult, DocumentError]]]] :raises ~azure.core.exceptions.HttpResponseError or TypeError or ValueError or NotImplementedError: .. versionadded:: v3.1 The *begin_analyze_actions* client method. .. versionadded:: v3.2-preview - The *ExtractSummaryAction* input option and *ExtractSummaryResult* result object + The *ExtractSummaryAction*, *RecognizeCustomEntitiesAction*, *SingleCategoryClassifyAction*, + and *MultiCategoryClassifyAction* input options and the corresponding *ExtractSummaryResult*, + *RecognizeCustomEntitiesResult*, *SingleCategoryClassifyResult*, + and *MultiCategoryClassifyResult* result objects .. admonition:: Example: @@ -1019,6 +1037,39 @@ async def begin_analyze_actions( # type: ignore == _AnalyzeActionsType.EXTRACT_SUMMARY ] ], + custom_entity_recognition_tasks=[ + t._to_generated( # pylint: disable=protected-access + self._api_version + ) + for t in [ + a + for a in actions + if _determine_action_type(a) + == _AnalyzeActionsType.RECOGNIZE_CUSTOM_ENTITIES + ] + ], + custom_single_classification_tasks=[ + t._to_generated( # pylint: disable=protected-access + self._api_version + ) + for t in [ + a + for a in actions + if _determine_action_type(a) + == _AnalyzeActionsType.SINGLE_CATEGORY_CLASSIFY + ] + ], + custom_multi_classification_tasks=[ + t._to_generated( # pylint: disable=protected-access + self._api_version + ) + for t in [ + a + for a in actions + if _determine_action_type(a) + == _AnalyzeActionsType.MULTI_CATEGORY_CLASSIFY + ] + ], ) analyze_body = self._client.models( api_version=self._api_version diff --git a/sdk/textanalytics/azure-ai-textanalytics/setup.py b/sdk/textanalytics/azure-ai-textanalytics/setup.py index 0e99e4b17a6e..baf5fe340b89 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/setup.py +++ b/sdk/textanalytics/azure-ai-textanalytics/setup.py @@ -79,7 +79,7 @@ 'azure.ai', ]), install_requires=[ - "azure-core<2.0.0,>=1.14.0", + "azure-core<2.0.0,>=1.16.0", "msrest>=0.6.21", 'azure-common~=1.1', 'six>=1.11.0', diff --git a/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md b/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md index 49caeebf247a..f236cba560fd 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md +++ b/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md @@ -66,7 +66,7 @@ output-folder: $(python-sdks-folder)/textanalytics/azure-ai-textanalytics/azure/ These settings apply only when `--tag=release_3_2_preview.2` is specified on the command line. ```yaml $(tag) == 'release_3_2_preview.2' -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5efb2eca2fc3d94f27015f5d3176786c7497f946/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.2/TextAnalytics.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/71c9d235dab9206194691d083f0248c8613e2e17/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.2/TextAnalytics.json namespace: azure.ai.textanalytics.v3_2_preview_2 output-folder: $(python-sdks-folder)/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_2_preview_2 ``` diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_custom_partial_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_custom_partial_error.yaml new file mode 100644 index 000000000000..2047a5a37155 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_custom_partial_error.yaml @@ -0,0 +1,95 @@ +interactions: +- request: + body: '{"tasks": {"entityRecognitionTasks": [], "entityRecognitionPiiTasks": [], + "keyPhraseExtractionTasks": [], "entityLinkingTasks": [], "sentimentAnalysisTasks": + [], "extractiveSummarizationTasks": [], "customEntityRecognitionTasks": [{"parameters": + {"project-name": "textanalytics_custom_entities_project_name", "deployment-name": + "textanalytics_custom_entities_project_name"}}], "customSingleClassificationTasks": + [{"parameters": {"project-name": "single_category_classify_project_name", "deployment-name": + "single_category_classify_project_name"}}], "customMultiClassificationTasks": + [{"parameters": {"project-name": "textanalytics_multi_category_classify_project_name", + "deployment-name": "textanalytics_multi_category_classify_project_name"}}]}, + "analysisInput": {"documents": [{"id": "1", "text": "A recent report by the + Government Accountability Office (GAO) found that the dramatic increase in oil + and natural gas development on federal lands over the past six years has stretched + the staff of the BLM to a point that it has been unable to meet its environmental + protection responsibilities.", "language": "en"}, {"id": "2", "text": "", "language": + "en"}]}}' + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1119' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze + response: + body: + string: '' + headers: + apim-request-id: + - daf613dd-edd7-4ce2-8eb0-4824d6214d33 + date: + - Tue, 05 Oct 2021 23:07:21 GMT + operation-location: + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/ba92a7f8-bd89-4c68-88e5-057a94334d3e + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '329' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/ba92a7f8-bd89-4c68-88e5-057a94334d3e?showStats=True + response: + body: + string: '{"jobId":"ba92a7f8-bd89-4c68-88e5-057a94334d3e","lastUpdateDateTime":"2021-10-05T23:07:22Z","createdDateTime":"2021-10-05T23:07:21Z","expirationDateTime":"2021-10-06T23:07:21Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":3,"failed":0,"inProgress":0,"total":3,"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:22.440671Z","state":"succeeded","results":{"statistics":{"documentsCount":2,"validDocumentsCount":1,"erroneousDocumentsCount":1,"transactionsCount":1},"documents":[{"id":"1","statistics":{"charactersCount":295,"transactionsCount":1},"entities":[{"text":"Government","category":"restaurant_name","offset":23,"length":10,"confidenceScore":0.05},{"text":"Office","category":"restaurant_name","offset":49,"length":6,"confidenceScore":0.11},{"text":"GAO","category":"restaurant_name","offset":57,"length":3,"confidenceScore":0.04},{"text":"Accountability","category":"geographic_poi","offset":34,"length":14,"confidenceScore":0.07},{"text":"natural","category":"geographic_poi","offset":106,"length":7,"confidenceScore":0.04},{"text":"dramatic","category":"sort","offset":77,"length":8,"confidenceScore":0.03},{"text":"oil","category":"restaurant_type","offset":98,"length":3,"confidenceScore":0.03},{"text":"gas","category":"restaurant_type","offset":114,"length":3,"confidenceScore":0.09},{"text":"and","category":"served_dish","offset":102,"length":3,"confidenceScore":0.07},{"text":"development","category":"object_type","offset":118,"length":11,"confidenceScore":0.06},{"text":"federal","category":"state","offset":133,"length":7,"confidenceScore":0.07},{"text":"protection","category":"state","offset":267,"length":10,"confidenceScore":0.05},{"text":"lands","category":"poi","offset":141,"length":5,"confidenceScore":0.04},{"text":"BLM","category":"poi","offset":202,"length":3,"confidenceScore":0.07},{"text":"the","category":"timeRange","offset":152,"length":3,"confidenceScore":0.24},{"text":"past + six years","category":"timeRange","offset":156,"length":14,"confidenceScore":0.54}],"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid + document in request.","innererror":{"code":"InvalidDocument","message":"Document + text is empty."}}}],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:22.4975235Z","state":"succeeded","results":{"statistics":{"documentsCount":2,"validDocumentsCount":1,"erroneousDocumentsCount":1,"transactionsCount":1},"documents":[{"id":"1","classification":{"category":"RateBook","confidenceScore":0.76},"statistics":{"charactersCount":295,"transactionsCount":1},"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid + document in request.","innererror":{"code":"InvalidDocument","message":"Document + text is empty."}}}],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:22.2662386Z","state":"succeeded","results":{"statistics":{"documentsCount":2,"validDocumentsCount":1,"erroneousDocumentsCount":1,"transactionsCount":1},"documents":[{"id":"1","classifications":[],"statistics":{"charactersCount":295,"transactionsCount":1},"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid + document in request.","innererror":{"code":"InvalidDocument","message":"Document + text is empty."}}}],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' + headers: + apim-request-id: + - a8641abb-4688-448f-aa31-5d6a62dea7f4 + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Oct 2021 23:07:26 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '288' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_disable_service_logs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_disable_service_logs.yaml index c71e08904ced..777fbc441434 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_disable_service_logs.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_disable_service_logs.yaml @@ -9,8 +9,15 @@ interactions: [{"parameters": {"model-version": "latest", "loggingOptOut": true, "opinionMining": false}}], "extractiveSummarizationTasks": [{"parameters": {"model-version": "latest", "loggingOptOut": true, "stringIndexType": "UnicodeCodePoint", "sentenceCount": - 3, "sortBy": "Offset"}}]}, "analysisInput": {"documents": [{"id": "0", "text": - "Test for logging disable", "language": "en"}]}}' + 3, "sortBy": "Offset"}}], "customEntityRecognitionTasks": [{"parameters": {"project-name": + "textanalytics_custom_entities_project_name", "deployment-name": "textanalytics_custom_entities_project_name", + "loggingOptOut": true}}], "customSingleClassificationTasks": [{"parameters": + {"project-name": "single_category_classify_project_name", "deployment-name": + "single_category_classify_project_name", "loggingOptOut": true}}], "customMultiClassificationTasks": + [{"parameters": {"project-name": "textanalytics_multi_category_classify_project_name", + "deployment-name": "textanalytics_multi_category_classify_project_name", "loggingOptOut": + true}}]}, "analysisInput": {"documents": [{"id": "0", "text": "Test for logging + disable", "language": "en"}]}}' headers: Accept: - application/json, text/json @@ -19,23 +26,23 @@ interactions: Connection: - keep-alive Content-Length: - - '915' + - '1490' Content-Type: - application/json User-Agent: - - azsdk-python-ai-textanalytics/5.2.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze response: body: string: '' headers: apim-request-id: - - 188a3007-12bf-45f2-bf92-a4138fb3119c + - 7ba904cd-3e4a-4782-b8af-e5137742615f date: - - Mon, 02 Aug 2021 21:29:59 GMT + - Tue, 05 Oct 2021 23:05:39 GMT operation-location: - - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze/jobs/183519e6-03c2-4c4c-9c58-8650a3cfd169 + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/7fe5a17c-3353-4a0b-bf9e-81e20800c2cc strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -43,7 +50,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '327' + - '2053' status: code: 202 message: Accepted @@ -57,19 +64,19 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-ai-textanalytics/5.2.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze/jobs/183519e6-03c2-4c4c-9c58-8650a3cfd169 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/7fe5a17c-3353-4a0b-bf9e-81e20800c2cc response: body: - string: '{"jobId":"183519e6-03c2-4c4c-9c58-8650a3cfd169","lastUpdateDateTime":"2021-08-02T21:30:01Z","createdDateTime":"2021-08-02T21:29:59Z","expirationDateTime":"2021-08-03T21:29:59Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":0,"failed":0,"inProgress":6,"total":6}}' + string: '{"jobId":"7fe5a17c-3353-4a0b-bf9e-81e20800c2cc","lastUpdateDateTime":"2021-10-05T23:05:42Z","createdDateTime":"2021-10-05T23:05:38Z","expirationDateTime":"2021-10-06T23:05:38Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":3,"failed":0,"inProgress":6,"total":9,"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:41.0218796Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:40.9155093Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:42.6063834Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' headers: apim-request-id: - - 397f3b2d-b72e-4a64-9146-0ba018e8d455 + - a2e223fb-466b-4262-96ce-f1186171bcc7 content-type: - application/json; charset=utf-8 date: - - Mon, 02 Aug 2021 21:30:04 GMT + - Tue, 05 Oct 2021 23:05:44 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -77,7 +84,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '13' + - '288' status: code: 200 message: OK @@ -91,22 +98,95 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-ai-textanalytics/5.2.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze/jobs/183519e6-03c2-4c4c-9c58-8650a3cfd169 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/7fe5a17c-3353-4a0b-bf9e-81e20800c2cc response: body: - string: '{"jobId":"183519e6-03c2-4c4c-9c58-8650a3cfd169","lastUpdateDateTime":"2021-08-02T21:30:07Z","createdDateTime":"2021-08-02T21:29:59Z","expirationDateTime":"2021-08-03T21:29:59Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":4,"failed":0,"inProgress":2,"total":6,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:07.0175711Z","taskName":"NamedEntityRecognition_latest","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityLinkingTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:06.8160554Z","taskName":"EntityLinking_latest","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"bingId":"a7b11e27-5b63-19a5-b4dd-37b71149ecac","name":"Test + string: '{"jobId":"7fe5a17c-3353-4a0b-bf9e-81e20800c2cc","lastUpdateDateTime":"2021-10-05T23:05:47Z","createdDateTime":"2021-10-05T23:05:38Z","expirationDateTime":"2021-10-06T23:05:38Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":5,"failed":0,"inProgress":4,"total":9,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:47.1949851Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:47.2121156Z","state":"succeeded","results":{"documents":[{"redactedText":"Test + for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:41.0218796Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:40.9155093Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:42.6063834Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' + headers: + apim-request-id: + - 2aa777f3-e97e-4d5d-8baa-1e9b0071fa22 + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Oct 2021 23:05:50 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '360' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/7fe5a17c-3353-4a0b-bf9e-81e20800c2cc + response: + body: + string: '{"jobId":"7fe5a17c-3353-4a0b-bf9e-81e20800c2cc","lastUpdateDateTime":"2021-10-05T23:05:54Z","createdDateTime":"2021-10-05T23:05:38Z","expirationDateTime":"2021-10-06T23:05:38Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":7,"failed":0,"inProgress":2,"total":9,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:47.1949851Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityLinkingTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:54.2247837Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"bingId":"a7b11e27-5b63-19a5-b4dd-37b71149ecac","name":"Test + (assessment)","matches":[{"text":"Test","offset":0,"length":4,"confidenceScore":0.04}],"language":"en","id":"Test + (assessment)","url":"https://en.wikipedia.org/wiki/Test_(assessment)","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:47.2121156Z","state":"succeeded","results":{"documents":[{"redactedText":"Test + for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:53.4924157Z","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:41.0218796Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:40.9155093Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:42.6063834Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' + headers: + apim-request-id: + - 220f9dbb-772e-4702-9d0f-3d47cf2fa24d + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Oct 2021 23:05:55 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '416' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/7fe5a17c-3353-4a0b-bf9e-81e20800c2cc + response: + body: + string: '{"jobId":"7fe5a17c-3353-4a0b-bf9e-81e20800c2cc","lastUpdateDateTime":"2021-10-05T23:05:57Z","createdDateTime":"2021-10-05T23:05:38Z","expirationDateTime":"2021-10-06T23:05:38Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":8,"failed":0,"inProgress":1,"total":9,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:47.1949851Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityLinkingTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:54.2247837Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"bingId":"a7b11e27-5b63-19a5-b4dd-37b71149ecac","name":"Test (assessment)","matches":[{"text":"Test","offset":0,"length":4,"confidenceScore":0.04}],"language":"en","id":"Test - (assessment)","url":"https://en.wikipedia.org/wiki/Test_(assessment)","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:06.955071Z","taskName":"PersonallyIdentifiableInformation_latest","state":"succeeded","results":{"documents":[{"redactedText":"Test - for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:07.4495809Z","taskName":"KeyPhraseExtraction_latest","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}]}}' + (assessment)","url":"https://en.wikipedia.org/wiki/Test_(assessment)","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:47.2121156Z","state":"succeeded","results":{"documents":[{"redactedText":"Test + for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"extractiveSummarizationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:57.5610052Z","state":"succeeded","results":{"documents":[{"id":"0","sentences":[{"text":"Test + for logging disable","rankScore":1.0,"offset":0,"length":24}],"warnings":[]}],"errors":[],"modelVersion":"2021-08-01"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:53.4924157Z","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:41.0218796Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:40.9155093Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:42.6063834Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' headers: apim-request-id: - - 436e11f7-ea15-4066-b80b-163924eb8f03 + - 8f346088-468f-4836-819d-bced92bac553 content-type: - application/json; charset=utf-8 date: - - Mon, 02 Aug 2021 21:30:10 GMT + - Tue, 05 Oct 2021 23:06:00 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -114,7 +194,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '189' + - '465' status: code: 200 message: OK @@ -128,23 +208,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-ai-textanalytics/5.2.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze/jobs/183519e6-03c2-4c4c-9c58-8650a3cfd169 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/7fe5a17c-3353-4a0b-bf9e-81e20800c2cc response: body: - string: '{"jobId":"183519e6-03c2-4c4c-9c58-8650a3cfd169","lastUpdateDateTime":"2021-08-02T21:30:12Z","createdDateTime":"2021-08-02T21:29:59Z","expirationDateTime":"2021-08-03T21:29:59Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":5,"failed":0,"inProgress":1,"total":6,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:07.0175711Z","taskName":"NamedEntityRecognition_latest","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityLinkingTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:06.8160554Z","taskName":"EntityLinking_latest","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"bingId":"a7b11e27-5b63-19a5-b4dd-37b71149ecac","name":"Test + string: '{"jobId":"7fe5a17c-3353-4a0b-bf9e-81e20800c2cc","lastUpdateDateTime":"2021-10-05T23:05:57Z","createdDateTime":"2021-10-05T23:05:38Z","expirationDateTime":"2021-10-06T23:05:38Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":8,"failed":0,"inProgress":1,"total":9,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:47.1949851Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityLinkingTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:54.2247837Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"bingId":"a7b11e27-5b63-19a5-b4dd-37b71149ecac","name":"Test (assessment)","matches":[{"text":"Test","offset":0,"length":4,"confidenceScore":0.04}],"language":"en","id":"Test - (assessment)","url":"https://en.wikipedia.org/wiki/Test_(assessment)","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:06.955071Z","taskName":"PersonallyIdentifiableInformation_latest","state":"succeeded","results":{"documents":[{"redactedText":"Test - for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"extractiveSummarizationTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:12.438369Z","taskName":"ExtractiveSummarization_latest","state":"succeeded","results":{"documents":[{"id":"0","sentences":[{"text":"Test - for logging disable","rankScore":1.0,"offset":0,"length":24}],"warnings":[]}],"errors":[],"modelVersion":"2021-08-01"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:07.4495809Z","taskName":"KeyPhraseExtraction_latest","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}]}}' + (assessment)","url":"https://en.wikipedia.org/wiki/Test_(assessment)","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:47.2121156Z","state":"succeeded","results":{"documents":[{"redactedText":"Test + for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"extractiveSummarizationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:57.5610052Z","state":"succeeded","results":{"documents":[{"id":"0","sentences":[{"text":"Test + for logging disable","rankScore":1.0,"offset":0,"length":24}],"warnings":[]}],"errors":[],"modelVersion":"2021-08-01"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:53.4924157Z","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:41.0218796Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:40.9155093Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:42.6063834Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' headers: apim-request-id: - - d3a06460-fe42-4df0-bd0e-1c8c88f72004 + - 23fec020-7dd0-4104-8dda-5beae5818c93 content-type: - application/json; charset=utf-8 date: - - Mon, 02 Aug 2021 21:30:15 GMT + - Tue, 05 Oct 2021 23:06:06 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -152,7 +232,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '201' + - '465' status: code: 200 message: OK @@ -166,24 +246,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-ai-textanalytics/5.2.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze/jobs/183519e6-03c2-4c4c-9c58-8650a3cfd169 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/7fe5a17c-3353-4a0b-bf9e-81e20800c2cc response: body: - string: '{"jobId":"183519e6-03c2-4c4c-9c58-8650a3cfd169","lastUpdateDateTime":"2021-08-02T21:30:18Z","createdDateTime":"2021-08-02T21:29:59Z","expirationDateTime":"2021-08-03T21:29:59Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":6,"failed":0,"inProgress":0,"total":6,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:07.0175711Z","taskName":"NamedEntityRecognition_latest","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityLinkingTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:06.8160554Z","taskName":"EntityLinking_latest","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"bingId":"a7b11e27-5b63-19a5-b4dd-37b71149ecac","name":"Test + string: '{"jobId":"7fe5a17c-3353-4a0b-bf9e-81e20800c2cc","lastUpdateDateTime":"2021-10-05T23:06:08Z","createdDateTime":"2021-10-05T23:05:38Z","expirationDateTime":"2021-10-06T23:05:38Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":9,"failed":0,"inProgress":0,"total":9,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:47.1949851Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityLinkingTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:54.2247837Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"bingId":"a7b11e27-5b63-19a5-b4dd-37b71149ecac","name":"Test (assessment)","matches":[{"text":"Test","offset":0,"length":4,"confidenceScore":0.04}],"language":"en","id":"Test - (assessment)","url":"https://en.wikipedia.org/wiki/Test_(assessment)","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:06.955071Z","taskName":"PersonallyIdentifiableInformation_latest","state":"succeeded","results":{"documents":[{"redactedText":"Test - for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"extractiveSummarizationTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:12.438369Z","taskName":"ExtractiveSummarization_latest","state":"succeeded","results":{"documents":[{"id":"0","sentences":[{"text":"Test - for logging disable","rankScore":1.0,"offset":0,"length":24}],"warnings":[]}],"errors":[],"modelVersion":"2021-08-01"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:07.4495809Z","taskName":"KeyPhraseExtraction_latest","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"sentimentAnalysisTasks":[{"lastUpdateDateTime":"2021-08-02T21:30:18.0417199Z","taskName":"SentimentAnalysis_latest","state":"succeeded","results":{"documents":[{"id":"0","sentiment":"negative","confidenceScores":{"positive":0.02,"neutral":0.12,"negative":0.86},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.02,"neutral":0.12,"negative":0.86},"offset":0,"length":24,"text":"Test - for logging disable"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}}]}}' + (assessment)","url":"https://en.wikipedia.org/wiki/Test_(assessment)","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:47.2121156Z","state":"succeeded","results":{"documents":[{"redactedText":"Test + for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"extractiveSummarizationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:57.5610052Z","state":"succeeded","results":{"documents":[{"id":"0","sentences":[{"text":"Test + for logging disable","rankScore":1.0,"offset":0,"length":24}],"warnings":[]}],"errors":[],"modelVersion":"2021-08-01"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:53.4924157Z","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"sentimentAnalysisTasks":[{"lastUpdateDateTime":"2021-10-05T23:06:08.5504043Z","state":"succeeded","results":{"documents":[{"id":"0","sentiment":"negative","confidenceScores":{"positive":0.02,"neutral":0.12,"negative":0.86},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.02,"neutral":0.12,"negative":0.86},"offset":0,"length":24,"text":"Test + for logging disable"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}}],"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:41.0218796Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:40.9155093Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:05:42.6063834Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' headers: apim-request-id: - - 0f6c1811-819e-4dd2-b0aa-12d6a83085fa + - aa1ae3f0-e3eb-455f-9c04-e472283b6891 content-type: - application/json; charset=utf-8 date: - - Mon, 02 Aug 2021 21:30:20 GMT + - Tue, 05 Oct 2021 23:06:11 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -191,7 +271,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '215' + - '627' status: code: 200 message: OK diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_multi_category_classify.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_multi_category_classify.yaml new file mode 100644 index 000000000000..d128bedf9f18 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_multi_category_classify.yaml @@ -0,0 +1,88 @@ +interactions: +- request: + body: '{"tasks": {"entityRecognitionTasks": [], "entityRecognitionPiiTasks": [], + "keyPhraseExtractionTasks": [], "entityLinkingTasks": [], "sentimentAnalysisTasks": + [], "extractiveSummarizationTasks": [], "customEntityRecognitionTasks": [], + "customSingleClassificationTasks": [], "customMultiClassificationTasks": [{"parameters": + {"project-name": "textanalytics_multi_category_classify_project_name", "deployment-name": + "textanalytics_multi_category_classify_project_name"}}]}, "analysisInput": {"documents": + [{"id": "1", "text": "A recent report by the Government Accountability Office + (GAO) found that the dramatic increase in oil and natural gas development on + federal lands over the past six years has stretched the staff of the BLM to + a point that it has been unable to meet its environmental protection responsibilities.", + "language": "en"}, {"id": "2", "text": "David Schmidt, senior vice president--Food + Safety, International Food Information Council (IFIC), Washington, D.C., discussed + the physical activity component.", "language": "en"}, {"id": "3", "text": "I + need a reservation for an indoor restaurant in China. Please don''t stop the + music. Play music and add it to my playlist", "language": "en"}]}}' + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1179' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze + response: + body: + string: '' + headers: + apim-request-id: + - 96cbcac1-f812-48c6-a629-9aeb00719340 + date: + - Tue, 05 Oct 2021 23:06:44 GMT + operation-location: + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/e8170ebe-e2dc-4586-8dbc-0a58709c196c + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '282' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/e8170ebe-e2dc-4586-8dbc-0a58709c196c?showStats=True + response: + body: + string: '{"jobId":"e8170ebe-e2dc-4586-8dbc-0a58709c196c","lastUpdateDateTime":"2021-10-05T23:06:46Z","createdDateTime":"2021-10-05T23:06:44Z","expirationDateTime":"2021-10-06T23:06:44Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":1,"failed":0,"inProgress":0,"total":1,"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:06:46.0377092Z","state":"succeeded","results":{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","classifications":[],"statistics":{"charactersCount":295,"transactionsCount":1},"warnings":[]},{"id":"2","classifications":[],"statistics":{"charactersCount":158,"transactionsCount":1},"warnings":[]},{"id":"3","classifications":[{"category":"BookRestaurant","confidenceScore":0.97}],"statistics":{"charactersCount":121,"transactionsCount":1},"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' + headers: + apim-request-id: + - 5fdd36f9-2a98-4ae2-ad17-6c6bc77e8ead + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Oct 2021 23:06:49 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '131' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_recognize_custom_entities.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_recognize_custom_entities.yaml new file mode 100644 index 000000000000..e645366bc29e --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_recognize_custom_entities.yaml @@ -0,0 +1,93 @@ +interactions: +- request: + body: '{"tasks": {"entityRecognitionTasks": [], "entityRecognitionPiiTasks": [], + "keyPhraseExtractionTasks": [], "entityLinkingTasks": [], "sentimentAnalysisTasks": + [], "extractiveSummarizationTasks": [], "customEntityRecognitionTasks": [{"parameters": + {"project-name": "textanalytics_custom_entities_project_name", "deployment-name": + "textanalytics_custom_entities_project_name"}}], "customSingleClassificationTasks": + [], "customMultiClassificationTasks": []}, "analysisInput": {"documents": [{"id": + "1", "text": "A recent report by the Government Accountability Office (GAO) + found that the dramatic increase in oil and natural gas development on federal + lands over the past six years has stretched the staff of the BLM to a point + that it has been unable to meet its environmental protection responsibilities.", + "language": "en"}, {"id": "2", "text": "David Schmidt, senior vice president--Food + Safety, International Food Information Council (IFIC), Washington, D.C., discussed + the physical activity component.", "language": "en"}, {"id": "3", "text": "I + need a reservation for an indoor restaurant in China. Please don''t stop the + music. Play music and add it to my playlist", "language": "en"}]}}' + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1179' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze + response: + body: + string: '' + headers: + apim-request-id: + - 5e163072-0a47-423c-a1a0-ca20e251555f + date: + - Tue, 05 Oct 2021 23:07:08 GMT + operation-location: + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/b40926c6-506b-42ed-b2ed-6a3a04109a6e + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '572' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/b40926c6-506b-42ed-b2ed-6a3a04109a6e?showStats=True + response: + body: + string: '{"jobId":"b40926c6-506b-42ed-b2ed-6a3a04109a6e","lastUpdateDateTime":"2021-10-05T23:07:10Z","createdDateTime":"2021-10-05T23:07:09Z","expirationDateTime":"2021-10-06T23:07:09Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":1,"failed":0,"inProgress":0,"total":1,"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:10.0734745Z","state":"succeeded","results":{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","statistics":{"charactersCount":295,"transactionsCount":1},"entities":[{"text":"Government","category":"restaurant_name","offset":23,"length":10,"confidenceScore":0.05},{"text":"Office","category":"restaurant_name","offset":49,"length":6,"confidenceScore":0.11},{"text":"GAO","category":"restaurant_name","offset":57,"length":3,"confidenceScore":0.04},{"text":"Accountability","category":"geographic_poi","offset":34,"length":14,"confidenceScore":0.07},{"text":"natural","category":"geographic_poi","offset":106,"length":7,"confidenceScore":0.04},{"text":"dramatic","category":"sort","offset":77,"length":8,"confidenceScore":0.03},{"text":"oil","category":"restaurant_type","offset":98,"length":3,"confidenceScore":0.03},{"text":"gas","category":"restaurant_type","offset":114,"length":3,"confidenceScore":0.09},{"text":"and","category":"served_dish","offset":102,"length":3,"confidenceScore":0.07},{"text":"development","category":"object_type","offset":118,"length":11,"confidenceScore":0.06},{"text":"federal","category":"state","offset":133,"length":7,"confidenceScore":0.07},{"text":"protection","category":"state","offset":267,"length":10,"confidenceScore":0.05},{"text":"lands","category":"poi","offset":141,"length":5,"confidenceScore":0.04},{"text":"BLM","category":"poi","offset":202,"length":3,"confidenceScore":0.07},{"text":"the","category":"timeRange","offset":152,"length":3,"confidenceScore":0.24},{"text":"past + six years","category":"timeRange","offset":156,"length":14,"confidenceScore":0.54}],"warnings":[]},{"id":"2","statistics":{"charactersCount":158,"transactionsCount":1},"entities":[{"text":"David + Schmidt","category":"artist","offset":0,"length":13,"confidenceScore":0.8},{"text":"Food","category":"service","offset":38,"length":4,"confidenceScore":0.03},{"text":"Safety","category":"geographic_poi","offset":43,"length":6,"confidenceScore":0.06},{"text":"International + Food","category":"geographic_poi","offset":51,"length":18,"confidenceScore":0.07},{"text":"IFIC","category":"geographic_poi","offset":91,"length":4,"confidenceScore":0.05},{"text":"Information + Council","category":"restaurant_name","offset":70,"length":19,"confidenceScore":0.1},{"text":"Washington, + D.C.","category":"state","offset":98,"length":16,"confidenceScore":0.49}],"warnings":[]},{"id":"3","statistics":{"charactersCount":121,"transactionsCount":1},"entities":[{"text":"indoor","category":"facility","offset":28,"length":6,"confidenceScore":0.57},{"text":"restaurant","category":"restaurant_type","offset":35,"length":10,"confidenceScore":0.95},{"text":"China","category":"country","offset":49,"length":5,"confidenceScore":0.48},{"text":"music","category":"music_item","offset":78,"length":5,"confidenceScore":0.63},{"text":"my","category":"playlist_owner","offset":110,"length":2,"confidenceScore":0.84}],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}]}}' + headers: + apim-request-id: + - b9cde6ac-1d05-4f10-88f4-09680209354d + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Oct 2021 23:07:13 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '82' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_single_category_classify.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_single_category_classify.yaml new file mode 100644 index 000000000000..f6029956fff9 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_single_category_classify.yaml @@ -0,0 +1,88 @@ +interactions: +- request: + body: '{"tasks": {"entityRecognitionTasks": [], "entityRecognitionPiiTasks": [], + "keyPhraseExtractionTasks": [], "entityLinkingTasks": [], "sentimentAnalysisTasks": + [], "extractiveSummarizationTasks": [], "customEntityRecognitionTasks": [], + "customSingleClassificationTasks": [{"parameters": {"project-name": "single_category_classify_project_name", + "deployment-name": "single_category_classify_project_name"}}], "customMultiClassificationTasks": + []}, "analysisInput": {"documents": [{"id": "1", "text": "A recent report by + the Government Accountability Office (GAO) found that the dramatic increase + in oil and natural gas development on federal lands over the past six years + has stretched the staff of the BLM to a point that it has been unable to meet + its environmental protection responsibilities.", "language": "en"}, {"id": "2", + "text": "David Schmidt, senior vice president--Food Safety, International Food + Information Council (IFIC), Washington, D.C., discussed the physical activity + component.", "language": "en"}, {"id": "3", "text": "I need a reservation for + an indoor restaurant in China. Please don''t stop the music. Play music and + add it to my playlist", "language": "en"}]}}' + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1179' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze + response: + body: + string: '' + headers: + apim-request-id: + - cd83bb55-93e5-4886-9649-6a26aad95d55 + date: + - Tue, 05 Oct 2021 23:06:27 GMT + operation-location: + - https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/5bb3c6f6-2fb4-402a-9b9e-cc794ef7fbdd + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '893' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/5bb3c6f6-2fb4-402a-9b9e-cc794ef7fbdd?showStats=True + response: + body: + string: '{"jobId":"5bb3c6f6-2fb4-402a-9b9e-cc794ef7fbdd","lastUpdateDateTime":"2021-10-05T23:06:28Z","createdDateTime":"2021-10-05T23:06:28Z","expirationDateTime":"2021-10-06T23:06:28Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":1,"failed":0,"inProgress":0,"total":1,"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:06:28.8225814Z","state":"succeeded","results":{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","classification":{"category":"RateBook","confidenceScore":0.76},"statistics":{"charactersCount":295,"transactionsCount":1},"warnings":[]},{"id":"2","classification":{"category":"RateBook","confidenceScore":0.57},"statistics":{"charactersCount":158,"transactionsCount":1},"warnings":[]},{"id":"3","classification":{"category":"BookRestaurant","confidenceScore":1.0},"statistics":{"charactersCount":121,"transactionsCount":1},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}]}}' + headers: + apim-request-id: + - 139dd224-f7d9-41bd-bb8a-e7ec5c3a635c + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Oct 2021 23:06:32 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '84' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_custom_partial_error.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_custom_partial_error.yaml new file mode 100644 index 000000000000..46661e2f23b3 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_custom_partial_error.yaml @@ -0,0 +1,73 @@ +interactions: +- request: + body: '{"tasks": {"entityRecognitionTasks": [], "entityRecognitionPiiTasks": [], + "keyPhraseExtractionTasks": [], "entityLinkingTasks": [], "sentimentAnalysisTasks": + [], "extractiveSummarizationTasks": [], "customEntityRecognitionTasks": [{"parameters": + {"project-name": "textanalytics_custom_entities_project_name", "deployment-name": + "textanalytics_custom_entities_project_name"}}], "customSingleClassificationTasks": + [{"parameters": {"project-name": "single_category_classify_project_name", "deployment-name": + "single_category_classify_project_name"}}], "customMultiClassificationTasks": + [{"parameters": {"project-name": "textanalytics_multi_category_classify_project_name", + "deployment-name": "textanalytics_multi_category_classify_project_name"}}]}, + "analysisInput": {"documents": [{"id": "1", "text": "A recent report by the + Government Accountability Office (GAO) found that the dramatic increase in oil + and natural gas development on federal lands over the past six years has stretched + the staff of the BLM to a point that it has been unable to meet its environmental + protection responsibilities.", "language": "en"}, {"id": "2", "text": "", "language": + "en"}]}}' + headers: + Accept: + - application/json, text/json + Content-Length: + - '1119' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze + response: + body: + string: '' + headers: + apim-request-id: 806b1de2-7682-4e86-bbbf-374f9babb42e + date: Tue, 05 Oct 2021 23:10:44 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/3abc0fde-69e4-4cfc-b1b1-4c6ccde66257 + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '382' + status: + code: 202 + message: Accepted + url: https://javatextanalyticstestresources.cognitiveservices.azure.com//text/analytics/v3.2-preview.2/analyze +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/3abc0fde-69e4-4cfc-b1b1-4c6ccde66257?showStats=True + response: + body: + string: '{"jobId":"3abc0fde-69e4-4cfc-b1b1-4c6ccde66257","lastUpdateDateTime":"2021-10-05T23:10:45Z","createdDateTime":"2021-10-05T23:10:44Z","expirationDateTime":"2021-10-06T23:10:44Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":3,"failed":0,"inProgress":0,"total":3,"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:10:45.3202607Z","state":"succeeded","results":{"statistics":{"documentsCount":2,"validDocumentsCount":1,"erroneousDocumentsCount":1,"transactionsCount":1},"documents":[{"id":"1","statistics":{"charactersCount":295,"transactionsCount":1},"entities":[{"text":"Government","category":"restaurant_name","offset":23,"length":10,"confidenceScore":0.05},{"text":"Office","category":"restaurant_name","offset":49,"length":6,"confidenceScore":0.11},{"text":"GAO","category":"restaurant_name","offset":57,"length":3,"confidenceScore":0.04},{"text":"Accountability","category":"geographic_poi","offset":34,"length":14,"confidenceScore":0.07},{"text":"natural","category":"geographic_poi","offset":106,"length":7,"confidenceScore":0.04},{"text":"dramatic","category":"sort","offset":77,"length":8,"confidenceScore":0.03},{"text":"oil","category":"restaurant_type","offset":98,"length":3,"confidenceScore":0.03},{"text":"gas","category":"restaurant_type","offset":114,"length":3,"confidenceScore":0.09},{"text":"and","category":"served_dish","offset":102,"length":3,"confidenceScore":0.07},{"text":"development","category":"object_type","offset":118,"length":11,"confidenceScore":0.06},{"text":"federal","category":"state","offset":133,"length":7,"confidenceScore":0.07},{"text":"protection","category":"state","offset":267,"length":10,"confidenceScore":0.05},{"text":"lands","category":"poi","offset":141,"length":5,"confidenceScore":0.04},{"text":"BLM","category":"poi","offset":202,"length":3,"confidenceScore":0.07},{"text":"the","category":"timeRange","offset":152,"length":3,"confidenceScore":0.24},{"text":"past + six years","category":"timeRange","offset":156,"length":14,"confidenceScore":0.54}],"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid + document in request.","innererror":{"code":"InvalidDocument","message":"Document + text is empty."}}}],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:10:45.6521471Z","state":"succeeded","results":{"statistics":{"documentsCount":2,"validDocumentsCount":1,"erroneousDocumentsCount":1,"transactionsCount":1},"documents":[{"id":"1","classification":{"category":"RateBook","confidenceScore":0.76},"statistics":{"charactersCount":295,"transactionsCount":1},"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid + document in request.","innererror":{"code":"InvalidDocument","message":"Document + text is empty."}}}],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:10:45.5933103Z","state":"succeeded","results":{"statistics":{"documentsCount":2,"validDocumentsCount":1,"erroneousDocumentsCount":1,"transactionsCount":1},"documents":[{"id":"1","classifications":[],"statistics":{"charactersCount":295,"transactionsCount":1},"warnings":[]}],"errors":[{"id":"2","error":{"code":"InvalidArgument","message":"Invalid + document in request.","innererror":{"code":"InvalidDocument","message":"Document + text is empty."}}}],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' + headers: + apim-request-id: 31a7d515-35ac-45ec-854d-c99eb57ef62b + content-type: application/json; charset=utf-8 + date: Tue, 05 Oct 2021 23:10:49 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '227' + status: + code: 200 + message: OK + url: https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/3abc0fde-69e4-4cfc-b1b1-4c6ccde66257?showStats=True +version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_disable_service_logs.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_disable_service_logs.yaml index 482d933d1b8c..5f3b4a26bd4b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_disable_service_logs.yaml +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_disable_service_logs.yaml @@ -9,106 +9,183 @@ interactions: [{"parameters": {"model-version": "latest", "loggingOptOut": true, "opinionMining": false}}], "extractiveSummarizationTasks": [{"parameters": {"model-version": "latest", "loggingOptOut": true, "stringIndexType": "UnicodeCodePoint", "sentenceCount": - 3, "sortBy": "Offset"}}]}, "analysisInput": {"documents": [{"id": "0", "text": - "Test for logging disable", "language": "en"}]}}' + 3, "sortBy": "Offset"}}], "customEntityRecognitionTasks": [{"parameters": {"project-name": + "textanalytics_custom_entities_project_name", "deployment-name": "textanalytics_custom_entities_project_name", + "loggingOptOut": true}}], "customSingleClassificationTasks": [{"parameters": + {"project-name": "single_category_classify_project_name", "deployment-name": + "single_category_classify_project_name", "loggingOptOut": true}}], "customMultiClassificationTasks": + [{"parameters": {"project-name": "textanalytics_multi_category_classify_project_name", + "deployment-name": "textanalytics_multi_category_classify_project_name", "loggingOptOut": + true}}]}, "analysisInput": {"documents": [{"id": "0", "text": "Test for logging + disable", "language": "en"}]}}' headers: Accept: - application/json, text/json Content-Length: - - '915' + - '1490' Content-Type: - application/json User-Agent: - - azsdk-python-ai-textanalytics/5.2.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze response: body: string: '' headers: - apim-request-id: 3fb79315-7a67-4783-b2b7-6d9213576ddb - date: Mon, 02 Aug 2021 21:45:38 GMT - operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze/jobs/43aedde3-0c7d-4794-a401-6cf5bedae3d8 + apim-request-id: c727d385-d2b3-4e26-ba13-6916033740ab + date: Tue, 05 Oct 2021 23:07:45 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '259' + x-envoy-upstream-service-time: '761' status: code: 202 message: Accepted - url: https://tacanaryjava.cognitiveservices.azure.com//text/analytics/v3.2-preview.1/analyze + url: https://javatextanalyticstestresources.cognitiveservices.azure.com//text/analytics/v3.2-preview.2/analyze - request: body: null headers: User-Agent: - - azsdk-python-ai-textanalytics/5.2.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze/jobs/43aedde3-0c7d-4794-a401-6cf5bedae3d8 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 response: body: - string: '{"jobId":"43aedde3-0c7d-4794-a401-6cf5bedae3d8","lastUpdateDateTime":"2021-08-02T21:45:39Z","createdDateTime":"2021-08-02T21:45:38Z","expirationDateTime":"2021-08-03T21:45:38Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":0,"failed":0,"inProgress":6,"total":6}}' + string: '{"jobId":"81e18e55-e8da-4c05-a3bb-f35dc57dd010","lastUpdateDateTime":"2021-10-05T23:07:46Z","createdDateTime":"2021-10-05T23:07:45Z","expirationDateTime":"2021-10-06T23:07:45Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":3,"failed":0,"inProgress":6,"total":9,"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.2455144Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.9850895Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.570953Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' headers: - apim-request-id: 492d4486-76b5-4ac0-a87c-6161ae061408 + apim-request-id: ea993164-2fd6-42ab-a2f0-b06ea2ec1efd content-type: application/json; charset=utf-8 - date: Mon, 02 Aug 2021 21:45:42 GMT + date: Tue, 05 Oct 2021 23:07:50 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '9' + x-envoy-upstream-service-time: '319' status: code: 200 message: OK - url: https://tacanaryjava.cognitiveservices.azure.com/text/analytics/v3.2-preview.1/analyze/jobs/43aedde3-0c7d-4794-a401-6cf5bedae3d8 + url: https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 - request: body: null headers: User-Agent: - - azsdk-python-ai-textanalytics/5.2.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze/jobs/43aedde3-0c7d-4794-a401-6cf5bedae3d8 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 response: body: - string: '{"jobId":"43aedde3-0c7d-4794-a401-6cf5bedae3d8","lastUpdateDateTime":"2021-08-02T21:45:45Z","createdDateTime":"2021-08-02T21:45:38Z","expirationDateTime":"2021-08-03T21:45:38Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":4,"failed":0,"inProgress":2,"total":6,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-08-02T21:45:45.105061Z","taskName":"NamedEntityRecognition_latest","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityLinkingTasks":[{"lastUpdateDateTime":"2021-08-02T21:45:44.7288427Z","taskName":"EntityLinking_latest","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"bingId":"a7b11e27-5b63-19a5-b4dd-37b71149ecac","name":"Test - (assessment)","matches":[{"text":"Test","offset":0,"length":4,"confidenceScore":0.04}],"language":"en","id":"Test - (assessment)","url":"https://en.wikipedia.org/wiki/Test_(assessment)","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-08-02T21:45:45.1349964Z","taskName":"PersonallyIdentifiableInformation_latest","state":"succeeded","results":{"documents":[{"redactedText":"Test - for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-08-02T21:45:44.6626774Z","taskName":"KeyPhraseExtraction_latest","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}]}}' + string: '{"jobId":"81e18e55-e8da-4c05-a3bb-f35dc57dd010","lastUpdateDateTime":"2021-10-05T23:07:54Z","createdDateTime":"2021-10-05T23:07:45Z","expirationDateTime":"2021-10-06T23:07:45Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":6,"failed":0,"inProgress":3,"total":9,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:53.5863104Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:53.667053Z","state":"succeeded","results":{"documents":[{"redactedText":"Test + for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:54.6202532Z","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.2455144Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.9850895Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.570953Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' + headers: + apim-request-id: 1c34657f-9f14-4c26-a0cd-90181b408b05 + content-type: application/json; charset=utf-8 + date: Tue, 05 Oct 2021 23:07:56 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '694' + status: + code: 200 + message: OK + url: https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 + response: + body: + string: '{"jobId":"81e18e55-e8da-4c05-a3bb-f35dc57dd010","lastUpdateDateTime":"2021-10-05T23:07:58Z","createdDateTime":"2021-10-05T23:07:45Z","expirationDateTime":"2021-10-06T23:07:45Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":7,"failed":0,"inProgress":2,"total":9,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:53.5863104Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:53.667053Z","state":"succeeded","results":{"documents":[{"redactedText":"Test + for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"extractiveSummarizationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:58.4835278Z","state":"succeeded","results":{"documents":[{"id":"0","sentences":[{"text":"Test + for logging disable","rankScore":1.0,"offset":0,"length":24}],"warnings":[]}],"errors":[],"modelVersion":"2021-08-01"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:54.6202532Z","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.2455144Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.9850895Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.570953Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' + headers: + apim-request-id: 6136feb8-6b2a-4087-8e87-7860d3b8ebc7 + content-type: application/json; charset=utf-8 + date: Tue, 05 Oct 2021 23:08:01 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '415' + status: + code: 200 + message: OK + url: https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 + response: + body: + string: '{"jobId":"81e18e55-e8da-4c05-a3bb-f35dc57dd010","lastUpdateDateTime":"2021-10-05T23:07:58Z","createdDateTime":"2021-10-05T23:07:45Z","expirationDateTime":"2021-10-06T23:07:45Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":7,"failed":0,"inProgress":2,"total":9,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:53.5863104Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:53.667053Z","state":"succeeded","results":{"documents":[{"redactedText":"Test + for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"extractiveSummarizationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:58.4835278Z","state":"succeeded","results":{"documents":[{"id":"0","sentences":[{"text":"Test + for logging disable","rankScore":1.0,"offset":0,"length":24}],"warnings":[]}],"errors":[],"modelVersion":"2021-08-01"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:54.6202532Z","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.2455144Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.9850895Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.570953Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' + headers: + apim-request-id: 00c76e3f-6f02-4ead-a52d-0d7259de19b3 + content-type: application/json; charset=utf-8 + date: Tue, 05 Oct 2021 23:08:07 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '435' + status: + code: 200 + message: OK + url: https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 + response: + body: + string: '{"jobId":"81e18e55-e8da-4c05-a3bb-f35dc57dd010","lastUpdateDateTime":"2021-10-05T23:07:58Z","createdDateTime":"2021-10-05T23:07:45Z","expirationDateTime":"2021-10-06T23:07:45Z","status":"running","errors":[],"displayName":"NA","tasks":{"completed":7,"failed":0,"inProgress":2,"total":9,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:53.5863104Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:53.667053Z","state":"succeeded","results":{"documents":[{"redactedText":"Test + for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"extractiveSummarizationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:58.4835278Z","state":"succeeded","results":{"documents":[{"id":"0","sentences":[{"text":"Test + for logging disable","rankScore":1.0,"offset":0,"length":24}],"warnings":[]}],"errors":[],"modelVersion":"2021-08-01"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:54.6202532Z","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.2455144Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.9850895Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.570953Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' headers: - apim-request-id: 598baa08-e0e0-4613-a930-9a056e59f8de + apim-request-id: 9212c5b7-e73d-4cf3-be1f-d000c1d853e3 content-type: application/json; charset=utf-8 - date: Mon, 02 Aug 2021 21:45:48 GMT + date: Tue, 05 Oct 2021 23:08:12 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '115' + x-envoy-upstream-service-time: '438' status: code: 200 message: OK - url: https://tacanaryjava.cognitiveservices.azure.com/text/analytics/v3.2-preview.1/analyze/jobs/43aedde3-0c7d-4794-a401-6cf5bedae3d8 + url: https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 - request: body: null headers: User-Agent: - - azsdk-python-ai-textanalytics/5.2.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.1/analyze/jobs/43aedde3-0c7d-4794-a401-6cf5bedae3d8 + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 response: body: - string: '{"jobId":"43aedde3-0c7d-4794-a401-6cf5bedae3d8","lastUpdateDateTime":"2021-08-02T21:45:51Z","createdDateTime":"2021-08-02T21:45:38Z","expirationDateTime":"2021-08-03T21:45:38Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":6,"failed":0,"inProgress":0,"total":6,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-08-02T21:45:45.105061Z","taskName":"NamedEntityRecognition_latest","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityLinkingTasks":[{"lastUpdateDateTime":"2021-08-02T21:45:44.7288427Z","taskName":"EntityLinking_latest","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"bingId":"a7b11e27-5b63-19a5-b4dd-37b71149ecac","name":"Test + string: '{"jobId":"81e18e55-e8da-4c05-a3bb-f35dc57dd010","lastUpdateDateTime":"2021-10-05T23:08:18Z","createdDateTime":"2021-10-05T23:07:45Z","expirationDateTime":"2021-10-06T23:07:45Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":9,"failed":0,"inProgress":0,"total":9,"entityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:53.5863104Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"text":"logging","category":"Skill","offset":9,"length":7,"confidenceScore":0.61}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityLinkingTasks":[{"lastUpdateDateTime":"2021-10-05T23:08:18.1568979Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[{"bingId":"a7b11e27-5b63-19a5-b4dd-37b71149ecac","name":"Test (assessment)","matches":[{"text":"Test","offset":0,"length":4,"confidenceScore":0.04}],"language":"en","id":"Test - (assessment)","url":"https://en.wikipedia.org/wiki/Test_(assessment)","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-08-02T21:45:45.1349964Z","taskName":"PersonallyIdentifiableInformation_latest","state":"succeeded","results":{"documents":[{"redactedText":"Test - for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"extractiveSummarizationTasks":[{"lastUpdateDateTime":"2021-08-02T21:45:51.7536788Z","taskName":"ExtractiveSummarization_latest","state":"succeeded","results":{"documents":[{"id":"0","sentences":[{"text":"Test - for logging disable","rankScore":1.0,"offset":0,"length":24}],"warnings":[]}],"errors":[],"modelVersion":"2021-08-01"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-08-02T21:45:44.6626774Z","taskName":"KeyPhraseExtraction_latest","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"sentimentAnalysisTasks":[{"lastUpdateDateTime":"2021-08-02T21:45:50.5189175Z","taskName":"SentimentAnalysis_latest","state":"succeeded","results":{"documents":[{"id":"0","sentiment":"negative","confidenceScores":{"positive":0.02,"neutral":0.12,"negative":0.86},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.02,"neutral":0.12,"negative":0.86},"offset":0,"length":24,"text":"Test - for logging disable"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}}]}}' + (assessment)","url":"https://en.wikipedia.org/wiki/Test_(assessment)","dataSource":"Wikipedia"}],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"entityRecognitionPiiTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:53.667053Z","state":"succeeded","results":{"documents":[{"redactedText":"Test + for logging disable","id":"0","entities":[],"warnings":[]}],"errors":[],"modelVersion":"2021-01-15"}}],"extractiveSummarizationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:58.4835278Z","state":"succeeded","results":{"documents":[{"id":"0","sentences":[{"text":"Test + for logging disable","rankScore":1.0,"offset":0,"length":24}],"warnings":[]}],"errors":[],"modelVersion":"2021-08-01"}}],"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:54.6202532Z","state":"succeeded","results":{"documents":[{"id":"0","keyPhrases":["Test","logging"],"warnings":[]}],"errors":[],"modelVersion":"2021-06-01"}}],"sentimentAnalysisTasks":[{"lastUpdateDateTime":"2021-10-05T23:08:18.2567362Z","state":"succeeded","results":{"documents":[{"id":"0","sentiment":"negative","confidenceScores":{"positive":0.02,"neutral":0.12,"negative":0.86},"sentences":[{"sentiment":"negative","confidenceScores":{"positive":0.02,"neutral":0.12,"negative":0.86},"offset":0,"length":24,"text":"Test + for logging disable"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}}],"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.2455144Z","state":"succeeded","results":{"documents":[{"id":"0","entities":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}],"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.9850895Z","state":"succeeded","results":{"documents":[{"id":"0","classification":{"category":"PlayMusic","confidenceScore":0.6},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}],"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:07:46.570953Z","state":"succeeded","results":{"documents":[{"id":"0","classifications":[],"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' headers: - apim-request-id: f3c6b772-94e5-4be7-9e62-738691a0f407 + apim-request-id: 84e00ab8-9522-49a9-a604-5c10792431f7 content-type: application/json; charset=utf-8 - date: Mon, 02 Aug 2021 21:45:54 GMT + date: Tue, 05 Oct 2021 23:08:18 GMT strict-transport-security: max-age=31536000; includeSubDomains; preload transfer-encoding: chunked x-content-type-options: nosniff - x-envoy-upstream-service-time: '173' + x-envoy-upstream-service-time: '556' status: code: 200 message: OK - url: https://tacanaryjava.cognitiveservices.azure.com/text/analytics/v3.2-preview.1/analyze/jobs/43aedde3-0c7d-4794-a401-6cf5bedae3d8 + url: https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/81e18e55-e8da-4c05-a3bb-f35dc57dd010 version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_multi_category_classify.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_multi_category_classify.yaml new file mode 100644 index 000000000000..a0e616b05f2e --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_multi_category_classify.yaml @@ -0,0 +1,66 @@ +interactions: +- request: + body: '{"tasks": {"entityRecognitionTasks": [], "entityRecognitionPiiTasks": [], + "keyPhraseExtractionTasks": [], "entityLinkingTasks": [], "sentimentAnalysisTasks": + [], "extractiveSummarizationTasks": [], "customEntityRecognitionTasks": [], + "customSingleClassificationTasks": [], "customMultiClassificationTasks": [{"parameters": + {"project-name": "textanalytics_multi_category_classify_project_name", "deployment-name": + "textanalytics_multi_category_classify_project_name"}}]}, "analysisInput": {"documents": + [{"id": "1", "text": "A recent report by the Government Accountability Office + (GAO) found that the dramatic increase in oil and natural gas development on + federal lands over the past six years has stretched the staff of the BLM to + a point that it has been unable to meet its environmental protection responsibilities.", + "language": "en"}, {"id": "2", "text": "David Schmidt, senior vice president--Food + Safety, International Food Information Council (IFIC), Washington, D.C., discussed + the physical activity component.", "language": "en"}, {"id": "3", "text": "I + need a reservation for an indoor restaurant in China. Please don''t stop the + music. Play music and add it to my playlist", "language": "en"}]}}' + headers: + Accept: + - application/json, text/json + Content-Length: + - '1179' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze + response: + body: + string: '' + headers: + apim-request-id: 7c71a969-2a84-49ac-a3f1-cec92cacb9b2 + date: Tue, 05 Oct 2021 23:08:59 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/d936ba8d-3660-4962-8aad-736dd13db4ec + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '713' + status: + code: 202 + message: Accepted + url: https://javatextanalyticstestresources.cognitiveservices.azure.com//text/analytics/v3.2-preview.2/analyze +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/d936ba8d-3660-4962-8aad-736dd13db4ec?showStats=True + response: + body: + string: '{"jobId":"d936ba8d-3660-4962-8aad-736dd13db4ec","lastUpdateDateTime":"2021-10-05T23:09:01Z","createdDateTime":"2021-10-05T23:08:59Z","expirationDateTime":"2021-10-06T23:08:59Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":1,"failed":0,"inProgress":0,"total":1,"customMultiClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:09:01.1688132Z","state":"succeeded","results":{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","classifications":[],"statistics":{"charactersCount":295,"transactionsCount":1},"warnings":[]},{"id":"2","classifications":[],"statistics":{"charactersCount":158,"transactionsCount":1},"warnings":[]},{"id":"3","classifications":[{"category":"BookRestaurant","confidenceScore":0.97}],"statistics":{"charactersCount":121,"transactionsCount":1},"warnings":[]}],"errors":[],"projectName":"textanalytics_multi_category_classify_project_name","deploymentName":"textanalytics_multi_category_classify_project_name"}}]}}' + headers: + apim-request-id: 19f71ab9-f935-4e20-bb1c-095d588198fd + content-type: application/json; charset=utf-8 + date: Tue, 05 Oct 2021 23:09:04 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '234' + status: + code: 200 + message: OK + url: https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/d936ba8d-3660-4962-8aad-736dd13db4ec?showStats=True +version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_recognize_custom_entities.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_recognize_custom_entities.yaml new file mode 100644 index 000000000000..71f6b4692363 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_recognize_custom_entities.yaml @@ -0,0 +1,71 @@ +interactions: +- request: + body: '{"tasks": {"entityRecognitionTasks": [], "entityRecognitionPiiTasks": [], + "keyPhraseExtractionTasks": [], "entityLinkingTasks": [], "sentimentAnalysisTasks": + [], "extractiveSummarizationTasks": [], "customEntityRecognitionTasks": [{"parameters": + {"project-name": "textanalytics_custom_entities_project_name", "deployment-name": + "textanalytics_custom_entities_project_name"}}], "customSingleClassificationTasks": + [], "customMultiClassificationTasks": []}, "analysisInput": {"documents": [{"id": + "1", "text": "A recent report by the Government Accountability Office (GAO) + found that the dramatic increase in oil and natural gas development on federal + lands over the past six years has stretched the staff of the BLM to a point + that it has been unable to meet its environmental protection responsibilities.", + "language": "en"}, {"id": "2", "text": "David Schmidt, senior vice president--Food + Safety, International Food Information Council (IFIC), Washington, D.C., discussed + the physical activity component.", "language": "en"}, {"id": "3", "text": "I + need a reservation for an indoor restaurant in China. Please don''t stop the + music. Play music and add it to my playlist", "language": "en"}]}}' + headers: + Accept: + - application/json, text/json + Content-Length: + - '1179' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze + response: + body: + string: '' + headers: + apim-request-id: db6863d0-3f37-4acd-9e4d-811693faff03 + date: Tue, 05 Oct 2021 23:09:33 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/58c4e1b8-d1a6-4ebf-b3f0-6fab77fbcf4f + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '380' + status: + code: 202 + message: Accepted + url: https://javatextanalyticstestresources.cognitiveservices.azure.com//text/analytics/v3.2-preview.2/analyze +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/58c4e1b8-d1a6-4ebf-b3f0-6fab77fbcf4f?showStats=True + response: + body: + string: '{"jobId":"58c4e1b8-d1a6-4ebf-b3f0-6fab77fbcf4f","lastUpdateDateTime":"2021-10-05T23:09:36Z","createdDateTime":"2021-10-05T23:09:32Z","expirationDateTime":"2021-10-06T23:09:32Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":1,"failed":0,"inProgress":0,"total":1,"customEntityRecognitionTasks":[{"lastUpdateDateTime":"2021-10-05T23:09:36.0391629Z","state":"succeeded","results":{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","statistics":{"charactersCount":295,"transactionsCount":1},"entities":[{"text":"Government","category":"restaurant_name","offset":23,"length":10,"confidenceScore":0.05},{"text":"Office","category":"restaurant_name","offset":49,"length":6,"confidenceScore":0.11},{"text":"GAO","category":"restaurant_name","offset":57,"length":3,"confidenceScore":0.04},{"text":"Accountability","category":"geographic_poi","offset":34,"length":14,"confidenceScore":0.07},{"text":"natural","category":"geographic_poi","offset":106,"length":7,"confidenceScore":0.04},{"text":"dramatic","category":"sort","offset":77,"length":8,"confidenceScore":0.03},{"text":"oil","category":"restaurant_type","offset":98,"length":3,"confidenceScore":0.03},{"text":"gas","category":"restaurant_type","offset":114,"length":3,"confidenceScore":0.09},{"text":"and","category":"served_dish","offset":102,"length":3,"confidenceScore":0.07},{"text":"development","category":"object_type","offset":118,"length":11,"confidenceScore":0.06},{"text":"federal","category":"state","offset":133,"length":7,"confidenceScore":0.07},{"text":"protection","category":"state","offset":267,"length":10,"confidenceScore":0.05},{"text":"lands","category":"poi","offset":141,"length":5,"confidenceScore":0.04},{"text":"BLM","category":"poi","offset":202,"length":3,"confidenceScore":0.07},{"text":"the","category":"timeRange","offset":152,"length":3,"confidenceScore":0.24},{"text":"past + six years","category":"timeRange","offset":156,"length":14,"confidenceScore":0.54}],"warnings":[]},{"id":"2","statistics":{"charactersCount":158,"transactionsCount":1},"entities":[{"text":"David + Schmidt","category":"artist","offset":0,"length":13,"confidenceScore":0.8},{"text":"Food","category":"service","offset":38,"length":4,"confidenceScore":0.03},{"text":"Safety","category":"geographic_poi","offset":43,"length":6,"confidenceScore":0.06},{"text":"International + Food","category":"geographic_poi","offset":51,"length":18,"confidenceScore":0.07},{"text":"IFIC","category":"geographic_poi","offset":91,"length":4,"confidenceScore":0.05},{"text":"Information + Council","category":"restaurant_name","offset":70,"length":19,"confidenceScore":0.1},{"text":"Washington, + D.C.","category":"state","offset":98,"length":16,"confidenceScore":0.49}],"warnings":[]},{"id":"3","statistics":{"charactersCount":121,"transactionsCount":1},"entities":[{"text":"indoor","category":"facility","offset":28,"length":6,"confidenceScore":0.57},{"text":"restaurant","category":"restaurant_type","offset":35,"length":10,"confidenceScore":0.95},{"text":"China","category":"country","offset":49,"length":5,"confidenceScore":0.48},{"text":"music","category":"music_item","offset":78,"length":5,"confidenceScore":0.63},{"text":"my","category":"playlist_owner","offset":110,"length":2,"confidenceScore":0.84}],"warnings":[]}],"errors":[],"projectName":"textanalytics_custom_entities_project_name","deploymentName":"textanalytics_custom_entities_project_name"}}]}}' + headers: + apim-request-id: 11575543-5719-4db3-a3ab-61cc7a47d667 + content-type: application/json; charset=utf-8 + date: Tue, 05 Oct 2021 23:09:37 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '79' + status: + code: 200 + message: OK + url: https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/58c4e1b8-d1a6-4ebf-b3f0-6fab77fbcf4f?showStats=True +version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_single_category_classify.yaml b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_single_category_classify.yaml new file mode 100644 index 000000000000..9d7a75edc5e8 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze_async.test_single_category_classify.yaml @@ -0,0 +1,66 @@ +interactions: +- request: + body: '{"tasks": {"entityRecognitionTasks": [], "entityRecognitionPiiTasks": [], + "keyPhraseExtractionTasks": [], "entityLinkingTasks": [], "sentimentAnalysisTasks": + [], "extractiveSummarizationTasks": [], "customEntityRecognitionTasks": [], + "customSingleClassificationTasks": [{"parameters": {"project-name": "single_category_classify_project_name", + "deployment-name": "single_category_classify_project_name"}}], "customMultiClassificationTasks": + []}, "analysisInput": {"documents": [{"id": "1", "text": "A recent report by + the Government Accountability Office (GAO) found that the dramatic increase + in oil and natural gas development on federal lands over the past six years + has stretched the staff of the BLM to a point that it has been unable to meet + its environmental protection responsibilities.", "language": "en"}, {"id": "2", + "text": "David Schmidt, senior vice president--Food Safety, International Food + Information Council (IFIC), Washington, D.C., discussed the physical activity + component.", "language": "en"}, {"id": "3", "text": "I need a reservation for + an indoor restaurant in China. Please don''t stop the music. Play music and + add it to my playlist", "language": "en"}]}}' + headers: + Accept: + - application/json, text/json + Content-Length: + - '1179' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze + response: + body: + string: '' + headers: + apim-request-id: 936b2e95-72ba-40df-af22-dce96b052f08 + date: Tue, 05 Oct 2021 23:08:30 GMT + operation-location: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/e495cf43-e89d-4db6-9cc5-523f951ff767 + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '218' + status: + code: 202 + message: Accepted + url: https://javatextanalyticstestresources.cognitiveservices.azure.com//text/analytics/v3.2-preview.2/analyze +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-textanalytics/5.2.0b2 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.2-preview.2/analyze/jobs/e495cf43-e89d-4db6-9cc5-523f951ff767?showStats=True + response: + body: + string: '{"jobId":"e495cf43-e89d-4db6-9cc5-523f951ff767","lastUpdateDateTime":"2021-10-05T23:08:32Z","createdDateTime":"2021-10-05T23:08:31Z","expirationDateTime":"2021-10-06T23:08:31Z","status":"succeeded","errors":[],"displayName":"NA","tasks":{"completed":1,"failed":0,"inProgress":0,"total":1,"customSingleClassificationTasks":[{"lastUpdateDateTime":"2021-10-05T23:08:32.0385749Z","state":"succeeded","results":{"statistics":{"documentsCount":3,"validDocumentsCount":3,"erroneousDocumentsCount":0,"transactionsCount":3},"documents":[{"id":"1","classification":{"category":"RateBook","confidenceScore":0.76},"statistics":{"charactersCount":295,"transactionsCount":1},"warnings":[]},{"id":"2","classification":{"category":"RateBook","confidenceScore":0.57},"statistics":{"charactersCount":158,"transactionsCount":1},"warnings":[]},{"id":"3","classification":{"category":"BookRestaurant","confidenceScore":1.0},"statistics":{"charactersCount":121,"transactionsCount":1},"warnings":[]}],"errors":[],"projectName":"single_category_classify_project_name","deploymentName":"single_category_classify_project_name"}}]}}' + headers: + apim-request-id: 3ff87406-a2c0-4950-8c2a-db724c03958f + content-type: application/json; charset=utf-8 + date: Tue, 05 Oct 2021 23:08:35 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + transfer-encoding: chunked + x-content-type-options: nosniff + x-envoy-upstream-service-time: '87' + status: + code: 200 + message: OK + url: https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/e495cf43-e89d-4db6-9cc5-523f951ff767?showStats=True +version: 1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py index ab2272ee4194..3656e09578aa 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py @@ -35,7 +35,13 @@ RecognizePiiEntitiesResult, ExtractSummaryAction, PiiEntityCategory, - ExtractSummaryResult + ExtractSummaryResult, + SingleCategoryClassifyAction, + MultiCategoryClassifyAction, + RecognizeCustomEntitiesAction, + SingleCategoryClassifyResult, + MultiCategoryClassifyResult, + RecognizeCustomEntitiesResult ) # pre-apply the client_cls positional argument so it needn't be explicitly passed below @@ -670,8 +676,19 @@ def test_too_many_documents(self, client): assert excinfo.value.status_code == 400 @TextAnalyticsPreparer() - @TextAnalyticsClientPreparer() - def test_disable_service_logs(self, client): + def test_disable_service_logs( + self, + textanalytics_custom_text_endpoint, + textanalytics_custom_text_key, + textanalytics_single_category_classify_project_name, + textanalytics_single_category_classify_deployment_name, + textanalytics_multi_category_classify_project_name, + textanalytics_multi_category_classify_deployment_name, + textanalytics_custom_entities_project_name, + textanalytics_custom_entities_deployment_name + ): + + client = TextAnalyticsClient(textanalytics_custom_text_endpoint, AzureKeyCredential(textanalytics_custom_text_key)) actions = [ RecognizeEntitiesAction(disable_service_logs=True), ExtractKeyPhrasesAction(disable_service_logs=True), @@ -679,6 +696,21 @@ def test_disable_service_logs(self, client): RecognizeLinkedEntitiesAction(disable_service_logs=True), AnalyzeSentimentAction(disable_service_logs=True), ExtractSummaryAction(disable_service_logs=True), + SingleCategoryClassifyAction( + project_name=textanalytics_single_category_classify_project_name, + deployment_name=textanalytics_single_category_classify_deployment_name, + disable_service_logs=True + ), + MultiCategoryClassifyAction( + project_name=textanalytics_multi_category_classify_project_name, + deployment_name=textanalytics_multi_category_classify_deployment_name, + disable_service_logs=True + ), + RecognizeCustomEntitiesAction( + project_name=textanalytics_custom_entities_project_name, + deployment_name=textanalytics_custom_entities_deployment_name, + disable_service_logs=True + ) ] for action in actions: @@ -887,3 +919,166 @@ def test_extract_summary_partial_results(self, client): assert not document_results[1][0].is_error assert isinstance(document_results[1][0], ExtractSummaryResult) + + @TextAnalyticsPreparer() + def test_single_category_classify( + self, + textanalytics_custom_text_endpoint, + textanalytics_custom_text_key, + textanalytics_single_category_classify_project_name, + textanalytics_single_category_classify_deployment_name + ): + client = TextAnalyticsClient(textanalytics_custom_text_endpoint, AzureKeyCredential(textanalytics_custom_text_key)) + docs = [ + {"id": "1", "language": "en", "text": "A recent report by the Government Accountability Office (GAO) found that the dramatic increase in oil and natural gas development on federal lands over the past six years has stretched the staff of the BLM to a point that it has been unable to meet its environmental protection responsibilities."}, + {"id": "2", "language": "en", "text": "David Schmidt, senior vice president--Food Safety, International Food Information Council (IFIC), Washington, D.C., discussed the physical activity component."}, + {"id": "3", "language": "en", "text": "I need a reservation for an indoor restaurant in China. Please don't stop the music. Play music and add it to my playlist"}, + ] + + response = client.begin_analyze_actions( + docs, + actions=[ + SingleCategoryClassifyAction( + project_name=textanalytics_single_category_classify_project_name, + deployment_name=textanalytics_single_category_classify_deployment_name + ) + ], + show_stats=True, + polling_interval=self._interval(), + ).result() + + document_results = list(response) + for doc_result in document_results: + for result in doc_result: + assert result.id + assert not result.is_error + assert not result.warnings + assert result.statistics + assert result.classification.category + assert result.classification.confidence_score + + @TextAnalyticsPreparer() + def test_multi_category_classify( + self, + textanalytics_custom_text_endpoint, + textanalytics_custom_text_key, + textanalytics_multi_category_classify_project_name, + textanalytics_multi_category_classify_deployment_name + ): + client = TextAnalyticsClient(textanalytics_custom_text_endpoint, AzureKeyCredential(textanalytics_custom_text_key)) + docs = [ + {"id": "1", "language": "en", "text": "A recent report by the Government Accountability Office (GAO) found that the dramatic increase in oil and natural gas development on federal lands over the past six years has stretched the staff of the BLM to a point that it has been unable to meet its environmental protection responsibilities."}, + {"id": "2", "language": "en", "text": "David Schmidt, senior vice president--Food Safety, International Food Information Council (IFIC), Washington, D.C., discussed the physical activity component."}, + {"id": "3", "language": "en", "text": "I need a reservation for an indoor restaurant in China. Please don't stop the music. Play music and add it to my playlist"}, + ] + + response = client.begin_analyze_actions( + docs, + actions=[ + MultiCategoryClassifyAction( + project_name=textanalytics_multi_category_classify_project_name, + deployment_name=textanalytics_multi_category_classify_deployment_name + ) + ], + show_stats=True, + polling_interval=self._interval(), + ).result() + + document_results = list(response) + for doc_result in document_results: + for result in doc_result: + assert result.id + assert not result.is_error + assert not result.warnings + assert result.statistics + for classification in result.classifications: + assert classification.category + assert classification.confidence_score + + @TextAnalyticsPreparer() + def test_recognize_custom_entities( + self, + textanalytics_custom_text_endpoint, + textanalytics_custom_text_key, + textanalytics_custom_entities_project_name, + textanalytics_custom_entities_deployment_name + ): + client = TextAnalyticsClient(textanalytics_custom_text_endpoint, AzureKeyCredential(textanalytics_custom_text_key)) + docs = [ + {"id": "1", "language": "en", "text": "A recent report by the Government Accountability Office (GAO) found that the dramatic increase in oil and natural gas development on federal lands over the past six years has stretched the staff of the BLM to a point that it has been unable to meet its environmental protection responsibilities."}, + {"id": "2", "language": "en", "text": "David Schmidt, senior vice president--Food Safety, International Food Information Council (IFIC), Washington, D.C., discussed the physical activity component."}, + {"id": "3", "language": "en", "text": "I need a reservation for an indoor restaurant in China. Please don't stop the music. Play music and add it to my playlist"}, + ] + + response = client.begin_analyze_actions( + docs, + actions=[ + RecognizeCustomEntitiesAction( + project_name=textanalytics_custom_entities_project_name, + deployment_name=textanalytics_custom_entities_deployment_name + ) + ], + show_stats=True, + polling_interval=self._interval(), + ).result() + + document_results = list(response) + for doc_result in document_results: + for result in doc_result: + assert result.id + assert not result.is_error + assert not result.warnings + assert result.statistics + for entity in result.entities: + assert entity.text + assert entity.category + assert entity.offset is not None + assert entity.length is not None + assert entity.confidence_score is not None + + @TextAnalyticsPreparer() + def test_custom_partial_error( + self, + textanalytics_custom_text_endpoint, + textanalytics_custom_text_key, + textanalytics_single_category_classify_project_name, + textanalytics_single_category_classify_deployment_name, + textanalytics_multi_category_classify_project_name, + textanalytics_multi_category_classify_deployment_name, + textanalytics_custom_entities_project_name, + textanalytics_custom_entities_deployment_name + ): + client = TextAnalyticsClient(textanalytics_custom_text_endpoint, AzureKeyCredential(textanalytics_custom_text_key)) + docs = [ + {"id": "1", "language": "en", "text": "A recent report by the Government Accountability Office (GAO) found that the dramatic increase in oil and natural gas development on federal lands over the past six years has stretched the staff of the BLM to a point that it has been unable to meet its environmental protection responsibilities."}, + {"id": "2", "language": "en", "text": ""}, + ] + + response = client.begin_analyze_actions( + docs, + actions=[ + SingleCategoryClassifyAction( + project_name=textanalytics_single_category_classify_project_name, + deployment_name=textanalytics_single_category_classify_deployment_name + ), + MultiCategoryClassifyAction( + project_name=textanalytics_multi_category_classify_project_name, + deployment_name=textanalytics_multi_category_classify_deployment_name + ), + RecognizeCustomEntitiesAction( + project_name=textanalytics_custom_entities_project_name, + deployment_name=textanalytics_custom_entities_deployment_name + ) + ], + show_stats=True, + polling_interval=self._interval(), + ).result() + + document_results = list(response) + assert len(document_results) == 2 + assert isinstance(document_results[0][0], SingleCategoryClassifyResult) + assert isinstance(document_results[0][1], MultiCategoryClassifyResult) + assert isinstance(document_results[0][2], RecognizeCustomEntitiesResult) + assert document_results[1][0].is_error + assert document_results[1][1].is_error + assert document_results[1][2].is_error diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_async.py b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_async.py index c73ffc8db329..d700675bd246 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_async.py @@ -34,7 +34,13 @@ ExtractKeyPhrasesResult, PiiEntityCategory, ExtractSummaryAction, - ExtractSummaryResult + ExtractSummaryResult, + SingleCategoryClassifyAction, + MultiCategoryClassifyAction, + RecognizeCustomEntitiesAction, + SingleCategoryClassifyResult, + MultiCategoryClassifyResult, + RecognizeCustomEntitiesResult ) # pre-apply the client_cls positional argument so it needn't be explicitly passed below @@ -710,8 +716,18 @@ async def test_too_many_documents(self, client): assert excinfo.value.status_code == 400 @TextAnalyticsPreparer() - @TextAnalyticsClientPreparer() - async def test_disable_service_logs(self, client): + async def test_disable_service_logs( + self, + textanalytics_custom_text_endpoint, + textanalytics_custom_text_key, + textanalytics_single_category_classify_project_name, + textanalytics_single_category_classify_deployment_name, + textanalytics_multi_category_classify_project_name, + textanalytics_multi_category_classify_deployment_name, + textanalytics_custom_entities_project_name, + textanalytics_custom_entities_deployment_name + ): + client = TextAnalyticsClient(textanalytics_custom_text_endpoint, AzureKeyCredential(textanalytics_custom_text_key)) actions = [ RecognizeEntitiesAction(disable_service_logs=True), ExtractKeyPhrasesAction(disable_service_logs=True), @@ -719,6 +735,21 @@ async def test_disable_service_logs(self, client): RecognizeLinkedEntitiesAction(disable_service_logs=True), AnalyzeSentimentAction(disable_service_logs=True), ExtractSummaryAction(disable_service_logs=True), + SingleCategoryClassifyAction( + project_name=textanalytics_single_category_classify_project_name, + deployment_name=textanalytics_single_category_classify_deployment_name, + disable_service_logs=True + ), + MultiCategoryClassifyAction( + project_name=textanalytics_multi_category_classify_project_name, + deployment_name=textanalytics_multi_category_classify_deployment_name, + disable_service_logs=True + ), + RecognizeCustomEntitiesAction( + project_name=textanalytics_custom_entities_project_name, + deployment_name=textanalytics_custom_entities_deployment_name, + disable_service_logs=True + ) ] for action in actions: @@ -935,3 +966,181 @@ async def test_extract_summary_partial_results(self, client): assert not document_results[1][0].is_error assert isinstance(document_results[1][0], ExtractSummaryResult) + + @TextAnalyticsPreparer() + async def test_single_category_classify( + self, + textanalytics_custom_text_endpoint, + textanalytics_custom_text_key, + textanalytics_single_category_classify_project_name, + textanalytics_single_category_classify_deployment_name + ): + client = TextAnalyticsClient(textanalytics_custom_text_endpoint, AzureKeyCredential(textanalytics_custom_text_key)) + docs = [ + {"id": "1", "language": "en", "text": "A recent report by the Government Accountability Office (GAO) found that the dramatic increase in oil and natural gas development on federal lands over the past six years has stretched the staff of the BLM to a point that it has been unable to meet its environmental protection responsibilities."}, + {"id": "2", "language": "en", "text": "David Schmidt, senior vice president--Food Safety, International Food Information Council (IFIC), Washington, D.C., discussed the physical activity component."}, + {"id": "3", "language": "en", "text": "I need a reservation for an indoor restaurant in China. Please don't stop the music. Play music and add it to my playlist"}, + ] + + async with client: + response = await (await client.begin_analyze_actions( + docs, + actions=[ + SingleCategoryClassifyAction( + project_name=textanalytics_single_category_classify_project_name, + deployment_name=textanalytics_single_category_classify_deployment_name + ), + ], + show_stats=True, + polling_interval=self._interval(), + )).result() + + document_results = [] + async for doc in response: + document_results.append(doc) + for doc_result in document_results: + for result in doc_result: + assert result.id + assert not result.is_error + assert not result.warnings + assert result.statistics + assert result.classification.category + assert result.classification.confidence_score + + @TextAnalyticsPreparer() + async def test_multi_category_classify( + self, + textanalytics_custom_text_endpoint, + textanalytics_custom_text_key, + textanalytics_multi_category_classify_project_name, + textanalytics_multi_category_classify_deployment_name + ): + client = TextAnalyticsClient(textanalytics_custom_text_endpoint, AzureKeyCredential(textanalytics_custom_text_key)) + docs = [ + {"id": "1", "language": "en", "text": "A recent report by the Government Accountability Office (GAO) found that the dramatic increase in oil and natural gas development on federal lands over the past six years has stretched the staff of the BLM to a point that it has been unable to meet its environmental protection responsibilities."}, + {"id": "2", "language": "en", "text": "David Schmidt, senior vice president--Food Safety, International Food Information Council (IFIC), Washington, D.C., discussed the physical activity component."}, + {"id": "3", "language": "en", "text": "I need a reservation for an indoor restaurant in China. Please don't stop the music. Play music and add it to my playlist"}, + ] + + async with client: + response = await (await client.begin_analyze_actions( + docs, + actions=[ + MultiCategoryClassifyAction( + project_name=textanalytics_multi_category_classify_project_name, + deployment_name=textanalytics_multi_category_classify_deployment_name + ), + ], + show_stats=True, + polling_interval=self._interval(), + )).result() + + document_results = [] + async for doc in response: + document_results.append(doc) + + document_results = list(response) + for doc_result in document_results: + for result in doc_result: + assert result.id + assert not result.is_error + assert not result.warnings + assert result.statistics + for classification in result.classifications: + assert classification.category + assert classification.confidence_score + + @TextAnalyticsPreparer() + async def test_recognize_custom_entities( + self, + textanalytics_custom_text_endpoint, + textanalytics_custom_text_key, + textanalytics_custom_entities_project_name, + textanalytics_custom_entities_deployment_name + ): + client = TextAnalyticsClient(textanalytics_custom_text_endpoint, AzureKeyCredential(textanalytics_custom_text_key)) + docs = [ + {"id": "1", "language": "en", "text": "A recent report by the Government Accountability Office (GAO) found that the dramatic increase in oil and natural gas development on federal lands over the past six years has stretched the staff of the BLM to a point that it has been unable to meet its environmental protection responsibilities."}, + {"id": "2", "language": "en", "text": "David Schmidt, senior vice president--Food Safety, International Food Information Council (IFIC), Washington, D.C., discussed the physical activity component."}, + {"id": "3", "language": "en", "text": "I need a reservation for an indoor restaurant in China. Please don't stop the music. Play music and add it to my playlist"}, + ] + + async with client: + response = await (await client.begin_analyze_actions( + docs, + actions=[ + RecognizeCustomEntitiesAction( + project_name=textanalytics_custom_entities_project_name, + deployment_name=textanalytics_custom_entities_deployment_name + ) + ], + show_stats=True, + polling_interval=self._interval(), + )).result() + + document_results = [] + async for doc in response: + document_results.append(doc) + + for doc_result in document_results: + for result in doc_result: + assert result.id + assert not result.is_error + assert not result.warnings + assert result.statistics + for entity in result.entities: + assert entity.text + assert entity.category + assert entity.offset is not None + assert entity.length is not None + assert entity.confidence_score is not None + + @TextAnalyticsPreparer() + async def test_custom_partial_error( + self, + textanalytics_custom_text_endpoint, + textanalytics_custom_text_key, + textanalytics_single_category_classify_project_name, + textanalytics_single_category_classify_deployment_name, + textanalytics_multi_category_classify_project_name, + textanalytics_multi_category_classify_deployment_name, + textanalytics_custom_entities_project_name, + textanalytics_custom_entities_deployment_name + ): + client = TextAnalyticsClient(textanalytics_custom_text_endpoint, AzureKeyCredential(textanalytics_custom_text_key)) + docs = [ + {"id": "1", "language": "en", "text": "A recent report by the Government Accountability Office (GAO) found that the dramatic increase in oil and natural gas development on federal lands over the past six years has stretched the staff of the BLM to a point that it has been unable to meet its environmental protection responsibilities."}, + {"id": "2", "language": "en", "text": ""}, + ] + async with client: + response = await (await client.begin_analyze_actions( + docs, + actions=[ + SingleCategoryClassifyAction( + project_name=textanalytics_single_category_classify_project_name, + deployment_name=textanalytics_single_category_classify_deployment_name + ), + MultiCategoryClassifyAction( + project_name=textanalytics_multi_category_classify_project_name, + deployment_name=textanalytics_multi_category_classify_deployment_name + ), + RecognizeCustomEntitiesAction( + project_name=textanalytics_custom_entities_project_name, + deployment_name=textanalytics_custom_entities_deployment_name + ) + ], + show_stats=True, + polling_interval=self._interval(), + )).result() + + document_results = [] + async for doc in response: + document_results.append(doc) + + assert len(document_results) == 2 + assert isinstance(document_results[0][0], SingleCategoryClassifyResult) + assert isinstance(document_results[0][1], MultiCategoryClassifyResult) + assert isinstance(document_results[0][2], RecognizeCustomEntitiesResult) + assert document_results[1][0].is_error + assert document_results[1][1].is_error + assert document_results[1][2].is_error diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/testcase.py b/sdk/textanalytics/azure-ai-textanalytics/tests/testcase.py index c5f440af6826..cf7737058d89 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/testcase.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/testcase.py @@ -31,6 +31,14 @@ 'textanalytics', textanalytics_test_endpoint="https://westus2.api.cognitive.microsoft.com/", textanalytics_test_api_key="fakeZmFrZV9hY29jdW50X2tleQ==", + textanalytics_custom_text_endpoint="https://westus2.api.cognitive.microsoft.com/", + textanalytics_custom_text_key="fakeZmFrZV9hY29jdW50X2tleQ==", + textanalytics_single_category_classify_project_name="single_category_classify_project_name", + textanalytics_single_category_classify_deployment_name="textanalytics_single_category_classify_deployment_name", + textanalytics_multi_category_classify_project_name="textanalytics_multi_category_classify_project_name", + textanalytics_multi_category_classify_deployment_name="textanalytics_multi_category_classify_deployment_name", + textanalytics_custom_entities_project_name="textanalytics_custom_entities_project_name", + textanalytics_custom_entities_deployment_name="textanalytics_custom_entities_deployment_name", ) diff --git a/sdk/textanalytics/tests.yml b/sdk/textanalytics/tests.yml index b5ffb1e0e8a1..4c69468b5f4e 100644 --- a/sdk/textanalytics/tests.yml +++ b/sdk/textanalytics/tests.yml @@ -13,6 +13,14 @@ stages: AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + TEXTANALYTICS_CUSTOM_TEXT_ENDPOINT: $(azure-text-analytics-custom-text-endpoint) + TEXTANALYTICS_CUSTOM_TEXT_KEY: $(azure-text-analytics-custom-text-key) + TEXTANALYTICS_SINGLE_CATEGORY_CLASSIFY_PROJECT_NAME: $(azure-text-analytics-single-category-classify-project-name) + TEXTANALYTICS_SINGLE_CATEGORY_CLASSIFY_DEPLOYMENT_NAME: $(azure-text-analytics-single-category-classify-deployment-name) + TEXTANALYTICS_MULTI_CATEGORY_CLASSIFY_PROJECT_NAME: $(azure-text-analytics-multi-category-classify-project-name) + TEXTANALYTICS_MULTI_CATEGORY_CLASSIFY_DEPLOYMENT_NAME: $(azure-text-analytics-multi-category-classify-deployment-name) + TEXTANALYTICS_CUSTOM_ENTITIES_PROJECT_NAME: $(azure-text-analytics-custom-entities-project-name) + TEXTANALYTICS_CUSTOM_ENTITIES_DEPLOYMENT_NAME: $(azure-text-analytics-custom-entities-deployment-name) TEST_MODE: 'RunLiveNoRecord' AZURE_SKIP_LIVE_RECORDING: 'True' AZURE_TEST_RUN_LIVE: 'true' diff --git a/shared_requirements.txt b/shared_requirements.txt index 6bbbac2b8904..9295039fbbfc 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -150,7 +150,7 @@ backports.functools-lru-cache >= 1.6.4; python_version == "2.7" #override azure-keyvault-keys azure-core<2.0.0,>=1.7.0 #override azure-keyvault-secrets azure-core<2.0.0,>=1.7.0 #override azure-ai-textanalytics msrest>=0.6.21 -#override azure-ai-textanalytics azure-core<2.0.0,>=1.14.0 +#override azure-ai-textanalytics azure-core<2.0.0,>=1.16.0 #override azure-ai-language-questionanswering azure-core<2.0.0,>=1.19.0 #override azure-ai-language-questionanswering msrest>=0.6.21 #override azure-search-documents azure-core<2.0.0,>=1.19.0