diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/README.md b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/README.md index 67b7536c73e..56bdb3c34ce 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/README.md +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/README.md @@ -1,27 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python -**NOTE:** If you are looking for the new, preview version of Azure Text -Analytics, please see -[azure-ai-textanalytics](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics). +This is the Microsoft Azure Cognitive Services Text Analytics Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). -This is the Microsoft Azure Cognitive Services Text Analytics Client -Library. -This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. +# Usage -For a more complete set of Azure libraries, see the -[azure sdk python release](https://aka.ms/azsdk/python/all). - -## Usage - -For code examples, see [Cognitive Services Text -Analytics](https://docs.microsoft.com/python/api/overview/azure/cognitive-services) +For code examples, see [Cognitive Services Text Analytics](https://docs.microsoft.com/python/api/overview/azure/cognitive-services) on docs.microsoft.com. -## Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-language-textanalytics%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-language-textanalytics%2FREADME.png) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/__init__.py index 9a75fc1a0e6..48d59a14cb3 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .text_analytics_client import TextAnalyticsClient -from .version import VERSION +from ._configuration import TextAnalyticsClientConfiguration +from ._text_analytics_client import TextAnalyticsClient +__all__ = ['TextAnalyticsClient', 'TextAnalyticsClientConfiguration'] -__all__ = ['TextAnalyticsClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_configuration.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_configuration.py new file mode 100644 index 00000000000..11cdcbe23fc --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_configuration.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest import Configuration + +from .version import VERSION + + +class TextAnalyticsClientConfiguration(Configuration): + """Configuration for TextAnalyticsClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Supported Cognitive Services endpoints (protocol and + hostname, for example: https://westus.api.cognitive.microsoft.com). + :type endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, endpoint, credentials): + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + base_url = '{Endpoint}/text/analytics/v3.1-preview.3' + + super(TextAnalyticsClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-cognitiveservices-language-textanalytics/{}'.format(VERSION)) + + self.endpoint = endpoint + self.credentials = credentials diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_text_analytics_client.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_text_analytics_client.py new file mode 100644 index 00000000000..633299e0717 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_text_analytics_client.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import TextAnalyticsClientConfiguration +from .operations import TextAnalyticsClientOperationsMixin +from msrest.exceptions import HttpOperationError +from . import models + + +class TextAnalyticsClient(TextAnalyticsClientOperationsMixin, SDKClient): + """The Text Analytics API is a suite of natural language processing (NLP) services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. Further documentation can be found in <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview">https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview</a> + + :ivar config: Configuration for client. + :vartype config: TextAnalyticsClientConfiguration + + :param endpoint: Supported Cognitive Services endpoints (protocol and + hostname, for example: https://westus.api.cognitive.microsoft.com). + :type endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, endpoint, credentials): + + self.config = TextAnalyticsClientConfiguration(endpoint, credentials) + super(TextAnalyticsClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = 'v3.1-preview.3' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py index be4003cc1ae..7c75a1f5e63 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py @@ -10,67 +10,203 @@ # -------------------------------------------------------------------------- try: - from .multi_language_input_py3 import MultiLanguageInput - from .multi_language_batch_input_py3 import MultiLanguageBatchInput - from .match_record_py3 import MatchRecord - from .entity_record_py3 import EntityRecord - from .document_statistics_py3 import DocumentStatistics - from .entities_batch_result_item_py3 import EntitiesBatchResultItem - from .error_record_py3 import ErrorRecord - from .request_statistics_py3 import RequestStatistics - from .entities_batch_result_py3 import EntitiesBatchResult - from .internal_error_py3 import InternalError - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .key_phrase_batch_result_item_py3 import KeyPhraseBatchResultItem - from .key_phrase_batch_result_py3 import KeyPhraseBatchResult - from .language_input_py3 import LanguageInput - from .language_batch_input_py3 import LanguageBatchInput - from .detected_language_py3 import DetectedLanguage - from .language_batch_result_item_py3 import LanguageBatchResultItem - from .language_batch_result_py3 import LanguageBatchResult - from .sentiment_batch_result_item_py3 import SentimentBatchResultItem - from .sentiment_batch_result_py3 import SentimentBatchResult + from ._models_py3 import AnalyzeBatchInput + from ._models_py3 import AnalyzeJobState + from ._models_py3 import AnalyzeJobStateTasks + from ._models_py3 import AnalyzeJobStateTasksEntityRecognitionPiiTasksItem + from ._models_py3 import AnalyzeJobStateTasksEntityRecognitionTasksItem + from ._models_py3 import AnalyzeJobStateTasksKeyPhraseExtractionTasksItem + from ._models_py3 import AspectConfidenceScoreLabel + from ._models_py3 import AspectRelation + from ._models_py3 import DetectedLanguage + from ._models_py3 import DocumentEntities + from ._models_py3 import DocumentError + from ._models_py3 import DocumentHealthcareEntities + from ._models_py3 import DocumentKeyPhrases + from ._models_py3 import DocumentLanguage + from ._models_py3 import DocumentLinkedEntities + from ._models_py3 import DocumentSentiment + from ._models_py3 import DocumentStatistics + from ._models_py3 import EntitiesResult + from ._models_py3 import EntitiesTask + from ._models_py3 import EntitiesTaskParameters + from ._models_py3 import Entity + from ._models_py3 import EntityLinkingResult + from ._models_py3 import ErrorResponse + from ._models_py3 import HealthcareEntity + from ._models_py3 import HealthcareEntityLink + from ._models_py3 import HealthcareJobState + from ._models_py3 import HealthcareRelation + from ._models_py3 import HealthcareResult + from ._models_py3 import InnerError + from ._models_py3 import JobDescriptor + from ._models_py3 import JobManifest + from ._models_py3 import JobManifestTasks + from ._models_py3 import JobMetadata + from ._models_py3 import KeyPhraseResult + from ._models_py3 import KeyPhrasesTask + from ._models_py3 import KeyPhrasesTaskParameters + from ._models_py3 import LanguageBatchInput + from ._models_py3 import LanguageInput + from ._models_py3 import LanguageResult + from ._models_py3 import LinkedEntity + from ._models_py3 import Match + from ._models_py3 import MultiLanguageBatchInput + from ._models_py3 import MultiLanguageInput + from ._models_py3 import Pagination + from ._models_py3 import PiiDocumentEntities + from ._models_py3 import PiiResult + from ._models_py3 import PiiTask + from ._models_py3 import PiiTaskParameters + from ._models_py3 import RequestStatistics + from ._models_py3 import SentenceAspect + from ._models_py3 import SentenceOpinion + from ._models_py3 import SentenceSentiment + from ._models_py3 import SentimentConfidenceScorePerLabel + from ._models_py3 import SentimentResponse + from ._models_py3 import TasksState + from ._models_py3 import TaskState + from ._models_py3 import TextAnalyticsError + from ._models_py3 import TextAnalyticsWarning except (SyntaxError, ImportError): - from .multi_language_input import MultiLanguageInput - from .multi_language_batch_input import MultiLanguageBatchInput - from .match_record import MatchRecord - from .entity_record import EntityRecord - from .document_statistics import DocumentStatistics - from .entities_batch_result_item import EntitiesBatchResultItem - from .error_record import ErrorRecord - from .request_statistics import RequestStatistics - from .entities_batch_result import EntitiesBatchResult - from .internal_error import InternalError - from .error_response import ErrorResponse, ErrorResponseException - from .key_phrase_batch_result_item import KeyPhraseBatchResultItem - from .key_phrase_batch_result import KeyPhraseBatchResult - from .language_input import LanguageInput - from .language_batch_input import LanguageBatchInput - from .detected_language import DetectedLanguage - from .language_batch_result_item import LanguageBatchResultItem - from .language_batch_result import LanguageBatchResult - from .sentiment_batch_result_item import SentimentBatchResultItem - from .sentiment_batch_result import SentimentBatchResult + from ._models import AnalyzeBatchInput + from ._models import AnalyzeJobState + from ._models import AnalyzeJobStateTasks + from ._models import AnalyzeJobStateTasksEntityRecognitionPiiTasksItem + from ._models import AnalyzeJobStateTasksEntityRecognitionTasksItem + from ._models import AnalyzeJobStateTasksKeyPhraseExtractionTasksItem + from ._models import AspectConfidenceScoreLabel + from ._models import AspectRelation + from ._models import DetectedLanguage + from ._models import DocumentEntities + from ._models import DocumentError + from ._models import DocumentHealthcareEntities + from ._models import DocumentKeyPhrases + from ._models import DocumentLanguage + from ._models import DocumentLinkedEntities + from ._models import DocumentSentiment + from ._models import DocumentStatistics + from ._models import EntitiesResult + from ._models import EntitiesTask + from ._models import EntitiesTaskParameters + from ._models import Entity + from ._models import EntityLinkingResult + from ._models import ErrorResponse + from ._models import HealthcareEntity + from ._models import HealthcareEntityLink + from ._models import HealthcareJobState + from ._models import HealthcareRelation + from ._models import HealthcareResult + from ._models import InnerError + from ._models import JobDescriptor + from ._models import JobManifest + from ._models import JobManifestTasks + from ._models import JobMetadata + from ._models import KeyPhraseResult + from ._models import KeyPhrasesTask + from ._models import KeyPhrasesTaskParameters + from ._models import LanguageBatchInput + from ._models import LanguageInput + from ._models import LanguageResult + from ._models import LinkedEntity + from ._models import Match + from ._models import MultiLanguageBatchInput + from ._models import MultiLanguageInput + from ._models import Pagination + from ._models import PiiDocumentEntities + from ._models import PiiResult + from ._models import PiiTask + from ._models import PiiTaskParameters + from ._models import RequestStatistics + from ._models import SentenceAspect + from ._models import SentenceOpinion + from ._models import SentenceSentiment + from ._models import SentimentConfidenceScorePerLabel + from ._models import SentimentResponse + from ._models import TasksState + from ._models import TaskState + from ._models import TextAnalyticsError + from ._models import TextAnalyticsWarning +from ._text_analytics_client_enums import ( + AspectRelationType, + DocumentSentimentValue, + ErrorCodeValue, + InnerErrorCodeValue, + SentenceSentimentValue, + State, + StringIndexType, + StringIndexTypeResponse, + TokenSentimentValue, + WarningCodeValue, +) __all__ = [ - 'MultiLanguageInput', - 'MultiLanguageBatchInput', - 'MatchRecord', - 'EntityRecord', + 'AnalyzeBatchInput', + 'AnalyzeJobState', + 'AnalyzeJobStateTasks', + 'AnalyzeJobStateTasksEntityRecognitionPiiTasksItem', + 'AnalyzeJobStateTasksEntityRecognitionTasksItem', + 'AnalyzeJobStateTasksKeyPhraseExtractionTasksItem', + 'AspectConfidenceScoreLabel', + 'AspectRelation', + 'DetectedLanguage', + 'DocumentEntities', + 'DocumentError', + 'DocumentHealthcareEntities', + 'DocumentKeyPhrases', + 'DocumentLanguage', + 'DocumentLinkedEntities', + 'DocumentSentiment', 'DocumentStatistics', - 'EntitiesBatchResultItem', - 'ErrorRecord', - 'RequestStatistics', - 'EntitiesBatchResult', - 'InternalError', - 'ErrorResponse', 'ErrorResponseException', - 'KeyPhraseBatchResultItem', - 'KeyPhraseBatchResult', - 'LanguageInput', + 'EntitiesResult', + 'EntitiesTask', + 'EntitiesTaskParameters', + 'Entity', + 'EntityLinkingResult', + 'ErrorResponse', + 'HealthcareEntity', + 'HealthcareEntityLink', + 'HealthcareJobState', + 'HealthcareRelation', + 'HealthcareResult', + 'InnerError', + 'JobDescriptor', + 'JobManifest', + 'JobManifestTasks', + 'JobMetadata', + 'KeyPhraseResult', + 'KeyPhrasesTask', + 'KeyPhrasesTaskParameters', 'LanguageBatchInput', - 'DetectedLanguage', - 'LanguageBatchResultItem', - 'LanguageBatchResult', - 'SentimentBatchResultItem', - 'SentimentBatchResult', + 'LanguageInput', + 'LanguageResult', + 'LinkedEntity', + 'Match', + 'MultiLanguageBatchInput', + 'MultiLanguageInput', + 'Pagination', + 'PiiDocumentEntities', + 'PiiResult', + 'PiiTask', + 'PiiTaskParameters', + 'RequestStatistics', + 'SentenceAspect', + 'SentenceOpinion', + 'SentenceSentiment', + 'SentimentConfidenceScorePerLabel', + 'SentimentResponse', + 'TasksState', + 'TaskState', + 'TextAnalyticsError', + 'TextAnalyticsWarning', + 'StringIndexTypeResponse', + 'ErrorCodeValue', + 'InnerErrorCodeValue', + 'WarningCodeValue', + 'State', + 'DocumentSentimentValue', + 'SentenceSentimentValue', + 'TokenSentimentValue', + 'AspectRelationType', + 'StringIndexType', ] diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models.py new file mode 100644 index 00000000000..5efa425c7b3 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models.py @@ -0,0 +1,2130 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AnalyzeBatchInput(Model): + """AnalyzeBatchInput. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Optional display name for the analysis job. + :type display_name: str + :param analysis_input: Required. + :type analysis_input: + ~azure.cognitiveservices.language.textanalytics.models.MultiLanguageBatchInput + :param tasks: Required. The set of tasks to execute on the input + documents. Cannot specify the same task more than once. + :type tasks: + ~azure.cognitiveservices.language.textanalytics.models.JobManifestTasks + """ + + _validation = { + 'analysis_input': {'required': True}, + 'tasks': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'analysis_input': {'key': 'analysisInput', 'type': 'MultiLanguageBatchInput'}, + 'tasks': {'key': 'tasks', 'type': 'JobManifestTasks'}, + } + + def __init__(self, **kwargs): + super(AnalyzeBatchInput, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.analysis_input = kwargs.get('analysis_input', None) + self.tasks = kwargs.get('tasks', None) + + +class AnalyzeJobState(Model): + """AnalyzeJobState. + + All required parameters must be populated in order to send to Azure. + + :param created_date_time: Required. + :type created_date_time: datetime + :param display_name: + :type display_name: str + :param expiration_date_time: + :type expiration_date_time: datetime + :param job_id: Required. + :type job_id: str + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param status: Required. Possible values include: 'notStarted', 'running', + 'succeeded', 'failed', 'cancelled', 'cancelling', 'partiallyCompleted' + :type status: str or + ~azure.cognitiveservices.language.textanalytics.models.State + :param tasks: Required. + :type tasks: + ~azure.cognitiveservices.language.textanalytics.models.AnalyzeJobStateTasks + :param errors: + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param next_link: + :type next_link: str + """ + + _validation = { + 'created_date_time': {'required': True}, + 'job_id': {'required': True}, + 'last_update_date_time': {'required': True}, + 'status': {'required': True}, + 'tasks': {'required': True}, + } + + _attribute_map = { + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'State'}, + 'tasks': {'key': 'tasks', 'type': 'AnalyzeJobStateTasks'}, + 'errors': {'key': 'errors', 'type': '[TextAnalyticsError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AnalyzeJobState, self).__init__(**kwargs) + self.created_date_time = kwargs.get('created_date_time', None) + self.display_name = kwargs.get('display_name', None) + self.expiration_date_time = kwargs.get('expiration_date_time', None) + self.job_id = kwargs.get('job_id', None) + self.last_update_date_time = kwargs.get('last_update_date_time', None) + self.status = kwargs.get('status', None) + self.tasks = kwargs.get('tasks', None) + self.errors = kwargs.get('errors', None) + self.statistics = kwargs.get('statistics', None) + self.next_link = kwargs.get('next_link', None) + + +class AnalyzeJobStateTasks(Model): + """AnalyzeJobStateTasks. + + All required parameters must be populated in order to send to Azure. + + :param details: + :type details: + list[~azure.cognitiveservices.language.textanalytics.models.TaskState] + :param completed: Required. + :type completed: int + :param failed: Required. + :type failed: int + :param in_progress: Required. + :type in_progress: int + :param total: Required. + :type total: int + :param entity_recognition_tasks: + :type entity_recognition_tasks: + list[~azure.cognitiveservices.language.textanalytics.models.AnalyzeJobStateTasksEntityRecognitionTasksItem] + :param entity_recognition_pii_tasks: + :type entity_recognition_pii_tasks: + list[~azure.cognitiveservices.language.textanalytics.models.AnalyzeJobStateTasksEntityRecognitionPiiTasksItem] + :param key_phrase_extraction_tasks: + :type key_phrase_extraction_tasks: + list[~azure.cognitiveservices.language.textanalytics.models.AnalyzeJobStateTasksKeyPhraseExtractionTasksItem] + """ + + _validation = { + 'completed': {'required': True}, + 'failed': {'required': True}, + 'in_progress': {'required': True}, + 'total': {'required': True}, + } + + _attribute_map = { + 'details': {'key': 'details', 'type': '[TaskState]'}, + 'completed': {'key': 'completed', 'type': 'int'}, + 'failed': {'key': 'failed', 'type': 'int'}, + 'in_progress': {'key': 'inProgress', 'type': 'int'}, + 'total': {'key': 'total', 'type': 'int'}, + 'entity_recognition_tasks': {'key': 'entityRecognitionTasks', 'type': '[AnalyzeJobStateTasksEntityRecognitionTasksItem]'}, + 'entity_recognition_pii_tasks': {'key': 'entityRecognitionPiiTasks', 'type': '[AnalyzeJobStateTasksEntityRecognitionPiiTasksItem]'}, + 'key_phrase_extraction_tasks': {'key': 'keyPhraseExtractionTasks', 'type': '[AnalyzeJobStateTasksKeyPhraseExtractionTasksItem]'}, + } + + def __init__(self, **kwargs): + super(AnalyzeJobStateTasks, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.completed = kwargs.get('completed', None) + self.failed = kwargs.get('failed', None) + self.in_progress = kwargs.get('in_progress', None) + self.total = kwargs.get('total', None) + self.entity_recognition_tasks = kwargs.get('entity_recognition_tasks', None) + self.entity_recognition_pii_tasks = kwargs.get('entity_recognition_pii_tasks', None) + self.key_phrase_extraction_tasks = kwargs.get('key_phrase_extraction_tasks', None) + + +class TaskState(Model): + """TaskState. + + All required parameters must be populated in order to send to Azure. + + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param name: Required. + :type name: str + :param status: Required. + :type status: object + """ + + _validation = { + 'last_update_date_time': {'required': True}, + 'name': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(TaskState, self).__init__(**kwargs) + self.last_update_date_time = kwargs.get('last_update_date_time', None) + self.name = kwargs.get('name', None) + self.status = kwargs.get('status', None) + + +class AnalyzeJobStateTasksEntityRecognitionPiiTasksItem(TaskState): + """AnalyzeJobStateTasksEntityRecognitionPiiTasksItem. + + All required parameters must be populated in order to send to Azure. + + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param name: Required. + :type name: str + :param status: Required. + :type status: object + :param results: + :type results: + ~azure.cognitiveservices.language.textanalytics.models.PiiResult + """ + + _validation = { + 'last_update_date_time': {'required': True}, + 'name': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'results': {'key': 'results', 'type': 'PiiResult'}, + } + + def __init__(self, **kwargs): + super(AnalyzeJobStateTasksEntityRecognitionPiiTasksItem, self).__init__(**kwargs) + self.results = kwargs.get('results', None) + + +class AnalyzeJobStateTasksEntityRecognitionTasksItem(TaskState): + """AnalyzeJobStateTasksEntityRecognitionTasksItem. + + All required parameters must be populated in order to send to Azure. + + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param name: Required. + :type name: str + :param status: Required. + :type status: object + :param results: + :type results: + ~azure.cognitiveservices.language.textanalytics.models.EntitiesResult + """ + + _validation = { + 'last_update_date_time': {'required': True}, + 'name': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'results': {'key': 'results', 'type': 'EntitiesResult'}, + } + + def __init__(self, **kwargs): + super(AnalyzeJobStateTasksEntityRecognitionTasksItem, self).__init__(**kwargs) + self.results = kwargs.get('results', None) + + +class AnalyzeJobStateTasksKeyPhraseExtractionTasksItem(TaskState): + """AnalyzeJobStateTasksKeyPhraseExtractionTasksItem. + + All required parameters must be populated in order to send to Azure. + + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param name: Required. + :type name: str + :param status: Required. + :type status: object + :param results: + :type results: + ~azure.cognitiveservices.language.textanalytics.models.KeyPhraseResult + """ + + _validation = { + 'last_update_date_time': {'required': True}, + 'name': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'results': {'key': 'results', 'type': 'KeyPhraseResult'}, + } + + def __init__(self, **kwargs): + super(AnalyzeJobStateTasksKeyPhraseExtractionTasksItem, self).__init__(**kwargs) + self.results = kwargs.get('results', None) + + +class AspectConfidenceScoreLabel(Model): + """Represents the confidence scores across all sentiment classes: positive, + neutral, negative. + + All required parameters must be populated in order to send to Azure. + + :param positive: Required. + :type positive: float + :param negative: Required. + :type negative: float + """ + + _validation = { + 'positive': {'required': True}, + 'negative': {'required': True}, + } + + _attribute_map = { + 'positive': {'key': 'positive', 'type': 'float'}, + 'negative': {'key': 'negative', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(AspectConfidenceScoreLabel, self).__init__(**kwargs) + self.positive = kwargs.get('positive', None) + self.negative = kwargs.get('negative', None) + + +class AspectRelation(Model): + """AspectRelation. + + All required parameters must be populated in order to send to Azure. + + :param relation_type: Required. The type related to the aspect. Possible + values include: 'opinion', 'aspect' + :type relation_type: str or + ~azure.cognitiveservices.language.textanalytics.models.AspectRelationType + :param ref: Required. The JSON pointer indicating the linked object. + :type ref: str + """ + + _validation = { + 'relation_type': {'required': True}, + 'ref': {'required': True}, + } + + _attribute_map = { + 'relation_type': {'key': 'relationType', 'type': 'AspectRelationType'}, + 'ref': {'key': 'ref', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AspectRelation, self).__init__(**kwargs) + self.relation_type = kwargs.get('relation_type', None) + self.ref = kwargs.get('ref', None) + + +class DetectedLanguage(Model): + """DetectedLanguage. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Long name of a detected language (e.g. English, + French). + :type name: str + :param iso6391_name: Required. A two letter representation of the detected + language according to the ISO 639-1 standard (e.g. en, fr). + :type iso6391_name: str + :param confidence_score: Required. A confidence score between 0 and 1. + Scores close to 1 indicate 100% certainty that the identified language is + true. + :type confidence_score: float + """ + + _validation = { + 'name': {'required': True}, + 'iso6391_name': {'required': True}, + 'confidence_score': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, + 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DetectedLanguage, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.iso6391_name = kwargs.get('iso6391_name', None) + self.confidence_score = kwargs.get('confidence_score', None) + + +class DocumentEntities(Model): + """DocumentEntities. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param entities: Required. Recognized entities in the document. + :type entities: + list[~azure.cognitiveservices.language.textanalytics.models.Entity] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'entities': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[Entity]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, **kwargs): + super(DocumentEntities, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.entities = kwargs.get('entities', None) + self.warnings = kwargs.get('warnings', None) + self.statistics = kwargs.get('statistics', None) + + +class DocumentError(Model): + """DocumentError. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Document Id. + :type id: str + :param error: Required. Document Error. + :type error: + ~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsError + """ + + _validation = { + 'id': {'required': True}, + 'error': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'TextAnalyticsError'}, + } + + def __init__(self, **kwargs): + super(DocumentError, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.error = kwargs.get('error', None) + + +class DocumentHealthcareEntities(Model): + """DocumentHealthcareEntities. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param entities: Required. Healthcare entities. + :type entities: + list[~azure.cognitiveservices.language.textanalytics.models.HealthcareEntity] + :param relations: Required. Healthcare entity relations. + :type relations: + list[~azure.cognitiveservices.language.textanalytics.models.HealthcareRelation] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'entities': {'required': True}, + 'relations': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[HealthcareEntity]'}, + 'relations': {'key': 'relations', 'type': '[HealthcareRelation]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, **kwargs): + super(DocumentHealthcareEntities, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.entities = kwargs.get('entities', None) + self.relations = kwargs.get('relations', None) + self.warnings = kwargs.get('warnings', None) + self.statistics = kwargs.get('statistics', None) + + +class DocumentKeyPhrases(Model): + """DocumentKeyPhrases. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param key_phrases: Required. A list of representative words or phrases. + The number of key phrases returned is proportional to the number of words + in the input document. + :type key_phrases: list[str] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'key_phrases': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, **kwargs): + super(DocumentKeyPhrases, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.key_phrases = kwargs.get('key_phrases', None) + self.warnings = kwargs.get('warnings', None) + self.statistics = kwargs.get('statistics', None) + + +class DocumentLanguage(Model): + """DocumentLanguage. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param detected_language: Required. Detected Language. + :type detected_language: + ~azure.cognitiveservices.language.textanalytics.models.DetectedLanguage + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'detected_language': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'detected_language': {'key': 'detectedLanguage', 'type': 'DetectedLanguage'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, **kwargs): + super(DocumentLanguage, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.detected_language = kwargs.get('detected_language', None) + self.warnings = kwargs.get('warnings', None) + self.statistics = kwargs.get('statistics', None) + + +class DocumentLinkedEntities(Model): + """DocumentLinkedEntities. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param entities: Required. Recognized well-known entities in the document. + :type entities: + list[~azure.cognitiveservices.language.textanalytics.models.LinkedEntity] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'entities': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[LinkedEntity]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, **kwargs): + super(DocumentLinkedEntities, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.entities = kwargs.get('entities', None) + self.warnings = kwargs.get('warnings', None) + self.statistics = kwargs.get('statistics', None) + + +class DocumentSentiment(Model): + """DocumentSentiment. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param sentiment: Required. Predicted sentiment for document (Negative, + Neutral, Positive, or Mixed). Possible values include: 'positive', + 'neutral', 'negative', 'mixed' + :type sentiment: str or + ~azure.cognitiveservices.language.textanalytics.models.DocumentSentimentValue + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + :param confidence_scores: Required. Document level sentiment confidence + scores between 0 and 1 for each sentiment class. + :type confidence_scores: + ~azure.cognitiveservices.language.textanalytics.models.SentimentConfidenceScorePerLabel + :param sentences: Required. Sentence level sentiment analysis. + :type sentences: + list[~azure.cognitiveservices.language.textanalytics.models.SentenceSentiment] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + """ + + _validation = { + 'id': {'required': True}, + 'sentiment': {'required': True}, + 'confidence_scores': {'required': True}, + 'sentences': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'sentiment': {'key': 'sentiment', 'type': 'DocumentSentimentValue'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + 'confidence_scores': {'key': 'confidenceScores', 'type': 'SentimentConfidenceScorePerLabel'}, + 'sentences': {'key': 'sentences', 'type': '[SentenceSentiment]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + } + + def __init__(self, **kwargs): + super(DocumentSentiment, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.sentiment = kwargs.get('sentiment', None) + self.statistics = kwargs.get('statistics', None) + self.confidence_scores = kwargs.get('confidence_scores', None) + self.sentences = kwargs.get('sentences', None) + self.warnings = kwargs.get('warnings', None) + + +class DocumentStatistics(Model): + """if showStats=true was specified in the request this field will contain + information about the document payload. + + All required parameters must be populated in order to send to Azure. + + :param characters_count: Required. Number of text elements recognized in + the document. + :type characters_count: int + :param transactions_count: Required. Number of transactions for the + document. + :type transactions_count: int + """ + + _validation = { + 'characters_count': {'required': True}, + 'transactions_count': {'required': True}, + } + + _attribute_map = { + 'characters_count': {'key': 'charactersCount', 'type': 'int'}, + 'transactions_count': {'key': 'transactionsCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DocumentStatistics, self).__init__(**kwargs) + self.characters_count = kwargs.get('characters_count', None) + self.transactions_count = kwargs.get('transactions_count', None) + + +class EntitiesResult(Model): + """EntitiesResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentEntities] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentEntities]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntitiesResult, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + self.errors = kwargs.get('errors', None) + self.statistics = kwargs.get('statistics', None) + self.model_version = kwargs.get('model_version', None) + + +class EntitiesTask(Model): + """EntitiesTask. + + :param parameters: + :type parameters: + ~azure.cognitiveservices.language.textanalytics.models.EntitiesTaskParameters + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': 'EntitiesTaskParameters'}, + } + + def __init__(self, **kwargs): + super(EntitiesTask, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) + + +class EntitiesTaskParameters(Model): + """EntitiesTaskParameters. + + :param model_version: Default value: "latest" . + :type model_version: str + :param string_index_type: Possible values include: 'TextElements_v8', + 'UnicodeCodePoint', 'Utf16CodeUnit'. Default value: "TextElements_v8" . + :type string_index_type: str or + ~azure.cognitiveservices.language.textanalytics.models.StringIndexTypeResponse + """ + + _attribute_map = { + 'model_version': {'key': 'model-version', 'type': 'str'}, + 'string_index_type': {'key': 'stringIndexType', 'type': 'StringIndexTypeResponse'}, + } + + def __init__(self, **kwargs): + super(EntitiesTaskParameters, self).__init__(**kwargs) + self.model_version = kwargs.get('model_version', "latest") + self.string_index_type = kwargs.get('string_index_type', "TextElements_v8") + + +class Entity(Model): + """Entity. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. Entity text as appears in the request. + :type text: str + :param category: Required. Entity type. + :type category: str + :param subcategory: (Optional) Entity sub type. + :type subcategory: str + :param offset: Required. Start position for the entity text. Use of + different 'stringIndexType' values can affect the offset returned. + :type offset: int + :param length: Required. Length for the entity text. Use of different + 'stringIndexType' values can affect the length returned. + :type length: int + :param confidence_score: Required. Confidence score between 0 and 1 of the + extracted entity. + :type confidence_score: float + """ + + _validation = { + 'text': {'required': True}, + 'category': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + 'confidence_score': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'subcategory': {'key': 'subcategory', 'type': 'str'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(Entity, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.category = kwargs.get('category', None) + self.subcategory = kwargs.get('subcategory', None) + self.offset = kwargs.get('offset', None) + self.length = kwargs.get('length', None) + self.confidence_score = kwargs.get('confidence_score', None) + + +class EntityLinkingResult(Model): + """EntityLinkingResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentLinkedEntities] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentLinkedEntities]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityLinkingResult, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + self.errors = kwargs.get('errors', None) + self.statistics = kwargs.get('statistics', None) + self.model_version = kwargs.get('model_version', None) + + +class ErrorResponse(Model): + """ErrorResponse. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. Document Error. + :type error: + ~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsError + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'TextAnalyticsError'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class HealthcareEntity(Entity): + """HealthcareEntity. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. Entity text as appears in the request. + :type text: str + :param category: Required. Entity type. + :type category: str + :param subcategory: (Optional) Entity sub type. + :type subcategory: str + :param offset: Required. Start position for the entity text. Use of + different 'stringIndexType' values can affect the offset returned. + :type offset: int + :param length: Required. Length for the entity text. Use of different + 'stringIndexType' values can affect the length returned. + :type length: int + :param confidence_score: Required. Confidence score between 0 and 1 of the + extracted entity. + :type confidence_score: float + :param is_negated: Required. + :type is_negated: bool + :param links: Entity references in known data sources. + :type links: + list[~azure.cognitiveservices.language.textanalytics.models.HealthcareEntityLink] + """ + + _validation = { + 'text': {'required': True}, + 'category': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + 'confidence_score': {'required': True}, + 'is_negated': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'subcategory': {'key': 'subcategory', 'type': 'str'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, + 'is_negated': {'key': 'isNegated', 'type': 'bool'}, + 'links': {'key': 'links', 'type': '[HealthcareEntityLink]'}, + } + + def __init__(self, **kwargs): + super(HealthcareEntity, self).__init__(**kwargs) + self.is_negated = kwargs.get('is_negated', None) + self.links = kwargs.get('links', None) + + +class HealthcareEntityLink(Model): + """HealthcareEntityLink. + + All required parameters must be populated in order to send to Azure. + + :param data_source: Required. Entity Catalog. Examples include: UMLS, CHV, + MSH, etc. + :type data_source: str + :param id: Required. Entity id in the given source catalog. + :type id: str + """ + + _validation = { + 'data_source': {'required': True}, + 'id': {'required': True}, + } + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HealthcareEntityLink, self).__init__(**kwargs) + self.data_source = kwargs.get('data_source', None) + self.id = kwargs.get('id', None) + + +class HealthcareJobState(Model): + """HealthcareJobState. + + All required parameters must be populated in order to send to Azure. + + :param created_date_time: Required. + :type created_date_time: datetime + :param display_name: + :type display_name: str + :param expiration_date_time: + :type expiration_date_time: datetime + :param job_id: Required. + :type job_id: str + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param status: Required. Possible values include: 'notStarted', 'running', + 'succeeded', 'failed', 'cancelled', 'cancelling', 'partiallyCompleted' + :type status: str or + ~azure.cognitiveservices.language.textanalytics.models.State + :param results: + :type results: + ~azure.cognitiveservices.language.textanalytics.models.HealthcareResult + :param errors: + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsError] + :param next_link: + :type next_link: str + """ + + _validation = { + 'created_date_time': {'required': True}, + 'job_id': {'required': True}, + 'last_update_date_time': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'State'}, + 'results': {'key': 'results', 'type': 'HealthcareResult'}, + 'errors': {'key': 'errors', 'type': '[TextAnalyticsError]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HealthcareJobState, self).__init__(**kwargs) + self.created_date_time = kwargs.get('created_date_time', None) + self.display_name = kwargs.get('display_name', None) + self.expiration_date_time = kwargs.get('expiration_date_time', None) + self.job_id = kwargs.get('job_id', None) + self.last_update_date_time = kwargs.get('last_update_date_time', None) + self.status = kwargs.get('status', None) + self.results = kwargs.get('results', None) + self.errors = kwargs.get('errors', None) + self.next_link = kwargs.get('next_link', None) + + +class HealthcareRelation(Model): + """HealthcareRelation. + + All required parameters must be populated in order to send to Azure. + + :param relation_type: Required. Type of relation. Examples include: + `DosageOfMedication` or 'FrequencyOfMedication', etc. + :type relation_type: str + :param bidirectional: Required. If true the relation between the entities + is bidirectional, otherwise directionality is source to target. + :type bidirectional: bool + :param source: Required. Reference link to the source entity. + :type source: str + :param target: Required. Reference link to the target entity. + :type target: str + """ + + _validation = { + 'relation_type': {'required': True}, + 'bidirectional': {'required': True}, + 'source': {'required': True}, + 'target': {'required': True}, + } + + _attribute_map = { + 'relation_type': {'key': 'relationType', 'type': 'str'}, + 'bidirectional': {'key': 'bidirectional', 'type': 'bool'}, + 'source': {'key': 'source', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HealthcareRelation, self).__init__(**kwargs) + self.relation_type = kwargs.get('relation_type', None) + self.bidirectional = kwargs.get('bidirectional', None) + self.source = kwargs.get('source', None) + self.target = kwargs.get('target', None) + + +class HealthcareResult(Model): + """HealthcareResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentHealthcareEntities] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentHealthcareEntities]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HealthcareResult, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + self.errors = kwargs.get('errors', None) + self.statistics = kwargs.get('statistics', None) + self.model_version = kwargs.get('model_version', None) + + +class InnerError(Model): + """InnerError. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code. Possible values include: + 'InvalidParameterValue', 'InvalidRequestBodyFormat', 'EmptyRequest', + 'MissingInputRecords', 'InvalidDocument', 'ModelVersionIncorrect', + 'InvalidDocumentBatch', 'UnsupportedLanguageCode', 'InvalidCountryHint' + :type code: str or + ~azure.cognitiveservices.language.textanalytics.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.cognitiveservices.language.textanalytics.models.InnerError + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '{str}'}, + 'target': {'key': 'target', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + self.target = kwargs.get('target', None) + self.innererror = kwargs.get('innererror', None) + + +class JobDescriptor(Model): + """JobDescriptor. + + :param display_name: Optional display name for the analysis job. + :type display_name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobDescriptor, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + + +class JobManifest(Model): + """JobManifest. + + All required parameters must be populated in order to send to Azure. + + :param tasks: Required. The set of tasks to execute on the input + documents. Cannot specify the same task more than once. + :type tasks: + ~azure.cognitiveservices.language.textanalytics.models.JobManifestTasks + """ + + _validation = { + 'tasks': {'required': True}, + } + + _attribute_map = { + 'tasks': {'key': 'tasks', 'type': 'JobManifestTasks'}, + } + + def __init__(self, **kwargs): + super(JobManifest, self).__init__(**kwargs) + self.tasks = kwargs.get('tasks', None) + + +class JobManifestTasks(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.cognitiveservices.language.textanalytics.models.EntitiesTask] + :param entity_recognition_pii_tasks: + :type entity_recognition_pii_tasks: + list[~azure.cognitiveservices.language.textanalytics.models.PiiTask] + :param key_phrase_extraction_tasks: + :type key_phrase_extraction_tasks: + list[~azure.cognitiveservices.language.textanalytics.models.KeyPhrasesTask] + """ + + _attribute_map = { + 'entity_recognition_tasks': {'key': 'entityRecognitionTasks', 'type': '[EntitiesTask]'}, + 'entity_recognition_pii_tasks': {'key': 'entityRecognitionPiiTasks', 'type': '[PiiTask]'}, + 'key_phrase_extraction_tasks': {'key': 'keyPhraseExtractionTasks', 'type': '[KeyPhrasesTask]'}, + } + + def __init__(self, **kwargs): + super(JobManifestTasks, self).__init__(**kwargs) + self.entity_recognition_tasks = kwargs.get('entity_recognition_tasks', None) + self.entity_recognition_pii_tasks = kwargs.get('entity_recognition_pii_tasks', None) + self.key_phrase_extraction_tasks = kwargs.get('key_phrase_extraction_tasks', None) + + +class JobMetadata(Model): + """JobMetadata. + + All required parameters must be populated in order to send to Azure. + + :param created_date_time: Required. + :type created_date_time: datetime + :param display_name: + :type display_name: str + :param expiration_date_time: + :type expiration_date_time: datetime + :param job_id: Required. + :type job_id: str + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param status: Required. Possible values include: 'notStarted', 'running', + 'succeeded', 'failed', 'cancelled', 'cancelling', 'partiallyCompleted' + :type status: str or + ~azure.cognitiveservices.language.textanalytics.models.State + """ + + _validation = { + 'created_date_time': {'required': True}, + 'job_id': {'required': True}, + 'last_update_date_time': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(JobMetadata, self).__init__(**kwargs) + self.created_date_time = kwargs.get('created_date_time', None) + self.display_name = kwargs.get('display_name', None) + self.expiration_date_time = kwargs.get('expiration_date_time', None) + self.job_id = kwargs.get('job_id', None) + self.last_update_date_time = kwargs.get('last_update_date_time', None) + self.status = kwargs.get('status', None) + + +class KeyPhraseResult(Model): + """KeyPhraseResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentKeyPhrases] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentKeyPhrases]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyPhraseResult, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + self.errors = kwargs.get('errors', None) + self.statistics = kwargs.get('statistics', None) + self.model_version = kwargs.get('model_version', None) + + +class KeyPhrasesTask(Model): + """KeyPhrasesTask. + + :param parameters: + :type parameters: + ~azure.cognitiveservices.language.textanalytics.models.KeyPhrasesTaskParameters + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': 'KeyPhrasesTaskParameters'}, + } + + def __init__(self, **kwargs): + super(KeyPhrasesTask, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) + + +class KeyPhrasesTaskParameters(Model): + """KeyPhrasesTaskParameters. + + :param model_version: Default value: "latest" . + :type model_version: str + """ + + _attribute_map = { + 'model_version': {'key': 'model-version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyPhrasesTaskParameters, self).__init__(**kwargs) + self.model_version = kwargs.get('model_version', "latest") + + +class LanguageBatchInput(Model): + """LanguageBatchInput. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.LanguageInput] + """ + + _validation = { + 'documents': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[LanguageInput]'}, + } + + def __init__(self, **kwargs): + super(LanguageBatchInput, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + + +class LanguageInput(Model): + """LanguageInput. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param text: Required. + :type text: str + :param country_hint: + :type country_hint: str + """ + + _validation = { + 'id': {'required': True}, + 'text': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'country_hint': {'key': 'countryHint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LanguageInput, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.text = kwargs.get('text', None) + self.country_hint = kwargs.get('country_hint', None) + + +class LanguageResult(Model): + """LanguageResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentLanguage] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentLanguage]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LanguageResult, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + self.errors = kwargs.get('errors', None) + self.statistics = kwargs.get('statistics', None) + self.model_version = kwargs.get('model_version', None) + + +class LinkedEntity(Model): + """LinkedEntity. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Entity Linking formal name. + :type name: str + :param matches: Required. List of instances this entity appears in the + text. + :type matches: + list[~azure.cognitiveservices.language.textanalytics.models.Match] + :param language: Required. Language used in the data source. + :type language: str + :param id: Unique identifier of the recognized entity from the data + source. + :type id: str + :param url: Required. URL for the entity's page from the data source. + :type url: str + :param data_source: Required. Data source used to extract entity linking, + such as Wiki/Bing etc. + :type data_source: str + :param bing_id: Bing Entity Search API unique identifier of the recognized + entity. + :type bing_id: str + """ + + _validation = { + 'name': {'required': True}, + 'matches': {'required': True}, + 'language': {'required': True}, + 'url': {'required': True}, + 'data_source': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'matches': {'key': 'matches', 'type': '[Match]'}, + 'language': {'key': 'language', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LinkedEntity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.matches = kwargs.get('matches', None) + self.language = kwargs.get('language', None) + self.id = kwargs.get('id', None) + self.url = kwargs.get('url', None) + self.data_source = kwargs.get('data_source', None) + self.bing_id = kwargs.get('bing_id', None) + + +class Match(Model): + """Match. + + All required parameters must be populated in order to send to Azure. + + :param confidence_score: Required. If a well-known item is recognized, a + decimal number denoting the confidence level between 0 and 1 will be + returned. + :type confidence_score: float + :param text: Required. Entity text as appears in the request. + :type text: str + :param offset: Required. Start position for the entity match text. + :type offset: int + :param length: Required. Length for the entity match text. + :type length: int + """ + + _validation = { + 'confidence_score': {'required': True}, + 'text': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + } + + _attribute_map = { + 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, + 'text': {'key': 'text', 'type': 'str'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Match, self).__init__(**kwargs) + self.confidence_score = kwargs.get('confidence_score', None) + self.text = kwargs.get('text', None) + self.offset = kwargs.get('offset', None) + self.length = kwargs.get('length', None) + + +class MultiLanguageBatchInput(Model): + """Contains a set of input documents to be analyzed by the service. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. The set of documents to process as part of + this batch. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + """ + + _validation = { + 'documents': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, + } + + def __init__(self, **kwargs): + super(MultiLanguageBatchInput, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + + +class MultiLanguageInput(Model): + """Contains an input document to be analyzed by the service. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A unique, non-empty document identifier. + :type id: str + :param text: Required. The input text to process. + :type text: str + :param language: (Optional) This is the 2 letter ISO 639-1 representation + of a language. For example, use "en" for English; "es" for Spanish etc. If + not set, use "en" for English as default. + :type language: str + """ + + _validation = { + 'id': {'required': True}, + 'text': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'language': {'key': 'language', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MultiLanguageInput, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.text = kwargs.get('text', None) + self.language = kwargs.get('language', None) + + +class Pagination(Model): + """Pagination. + + :param next_link: + :type next_link: str + """ + + _attribute_map = { + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Pagination, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + + +class PiiDocumentEntities(Model): + """PiiDocumentEntities. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param redacted_text: Required. Returns redacted text. + :type redacted_text: str + :param entities: Required. Recognized entities in the document. + :type entities: + list[~azure.cognitiveservices.language.textanalytics.models.Entity] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'redacted_text': {'required': True}, + 'entities': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'redacted_text': {'key': 'redactedText', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[Entity]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, **kwargs): + super(PiiDocumentEntities, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.redacted_text = kwargs.get('redacted_text', None) + self.entities = kwargs.get('entities', None) + self.warnings = kwargs.get('warnings', None) + self.statistics = kwargs.get('statistics', None) + + +class PiiResult(Model): + """PiiResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.PiiDocumentEntities] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[PiiDocumentEntities]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PiiResult, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + self.errors = kwargs.get('errors', None) + self.statistics = kwargs.get('statistics', None) + self.model_version = kwargs.get('model_version', None) + + +class PiiTask(Model): + """PiiTask. + + :param parameters: + :type parameters: + ~azure.cognitiveservices.language.textanalytics.models.PiiTaskParameters + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': 'PiiTaskParameters'}, + } + + def __init__(self, **kwargs): + super(PiiTask, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) + + +class PiiTaskParameters(Model): + """PiiTaskParameters. + + :param domain: Possible values include: 'phi', 'none'. Default value: + "none" . + :type domain: str or + ~azure.cognitiveservices.language.textanalytics.models.enum + :param model_version: Default value: "latest" . + :type model_version: str + :param string_index_type: Possible values include: 'TextElements_v8', + 'UnicodeCodePoint', 'Utf16CodeUnit'. Default value: "TextElements_v8" . + :type string_index_type: str or + ~azure.cognitiveservices.language.textanalytics.models.StringIndexTypeResponse + """ + + _attribute_map = { + 'domain': {'key': 'domain', 'type': 'str'}, + 'model_version': {'key': 'model-version', 'type': 'str'}, + 'string_index_type': {'key': 'stringIndexType', 'type': 'StringIndexTypeResponse'}, + } + + def __init__(self, **kwargs): + super(PiiTaskParameters, self).__init__(**kwargs) + self.domain = kwargs.get('domain', "none") + self.model_version = kwargs.get('model_version', "latest") + self.string_index_type = kwargs.get('string_index_type', "TextElements_v8") + + +class RequestStatistics(Model): + """if showStats=true was specified in the request this field will contain + information about the request payload. + + All required parameters must be populated in order to send to Azure. + + :param documents_count: Required. Number of documents submitted in the + request. + :type documents_count: int + :param valid_documents_count: Required. Number of valid documents. This + excludes empty, over-size limit or non-supported languages documents. + :type valid_documents_count: int + :param erroneous_documents_count: Required. Number of invalid documents. + This includes empty, over-size limit or non-supported languages documents. + :type erroneous_documents_count: int + :param transactions_count: Required. Number of transactions for the + request. + :type transactions_count: long + """ + + _validation = { + 'documents_count': {'required': True}, + 'valid_documents_count': {'required': True}, + 'erroneous_documents_count': {'required': True}, + 'transactions_count': {'required': True}, + } + + _attribute_map = { + 'documents_count': {'key': 'documentsCount', 'type': 'int'}, + 'valid_documents_count': {'key': 'validDocumentsCount', 'type': 'int'}, + 'erroneous_documents_count': {'key': 'erroneousDocumentsCount', 'type': 'int'}, + 'transactions_count': {'key': 'transactionsCount', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(RequestStatistics, self).__init__(**kwargs) + self.documents_count = kwargs.get('documents_count', None) + self.valid_documents_count = kwargs.get('valid_documents_count', None) + self.erroneous_documents_count = kwargs.get('erroneous_documents_count', None) + self.transactions_count = kwargs.get('transactions_count', None) + + +class SentenceAspect(Model): + """SentenceAspect. + + All required parameters must be populated in order to send to Azure. + + :param sentiment: Required. Aspect level sentiment for the aspect in the + sentence. Possible values include: 'positive', 'mixed', 'negative' + :type sentiment: str or + ~azure.cognitiveservices.language.textanalytics.models.TokenSentimentValue + :param confidence_scores: Required. Aspect level sentiment confidence + scores for the aspect in the sentence. + :type confidence_scores: + ~azure.cognitiveservices.language.textanalytics.models.AspectConfidenceScoreLabel + :param offset: Required. The aspect offset from the start of the sentence. + :type offset: int + :param length: Required. The length of the aspect. + :type length: int + :param text: Required. The aspect text detected. + :type text: str + :param relations: Required. The array of either opinion or aspect object + which is related to the aspect. + :type relations: + list[~azure.cognitiveservices.language.textanalytics.models.AspectRelation] + """ + + _validation = { + 'sentiment': {'required': True}, + 'confidence_scores': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + 'text': {'required': True}, + 'relations': {'required': True}, + } + + _attribute_map = { + 'sentiment': {'key': 'sentiment', 'type': 'TokenSentimentValue'}, + 'confidence_scores': {'key': 'confidenceScores', 'type': 'AspectConfidenceScoreLabel'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'}, + 'relations': {'key': 'relations', 'type': '[AspectRelation]'}, + } + + def __init__(self, **kwargs): + super(SentenceAspect, self).__init__(**kwargs) + self.sentiment = kwargs.get('sentiment', None) + self.confidence_scores = kwargs.get('confidence_scores', None) + self.offset = kwargs.get('offset', None) + self.length = kwargs.get('length', None) + self.text = kwargs.get('text', None) + self.relations = kwargs.get('relations', None) + + +class SentenceOpinion(Model): + """SentenceOpinion. + + All required parameters must be populated in order to send to Azure. + + :param sentiment: Required. Opinion level sentiment for the aspect in the + sentence. Possible values include: 'positive', 'mixed', 'negative' + :type sentiment: str or + ~azure.cognitiveservices.language.textanalytics.models.TokenSentimentValue + :param confidence_scores: Required. Opinion level sentiment confidence + scores for the aspect in the sentence. + :type confidence_scores: + ~azure.cognitiveservices.language.textanalytics.models.AspectConfidenceScoreLabel + :param offset: Required. The opinion offset from the start of the + sentence. + :type offset: int + :param length: Required. The length of the opinion. + :type length: int + :param text: Required. The aspect text detected. + :type text: str + :param is_negated: Required. The indicator representing if the opinion is + negated. + :type is_negated: bool + """ + + _validation = { + 'sentiment': {'required': True}, + 'confidence_scores': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + 'text': {'required': True}, + 'is_negated': {'required': True}, + } + + _attribute_map = { + 'sentiment': {'key': 'sentiment', 'type': 'TokenSentimentValue'}, + 'confidence_scores': {'key': 'confidenceScores', 'type': 'AspectConfidenceScoreLabel'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'}, + 'is_negated': {'key': 'isNegated', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SentenceOpinion, self).__init__(**kwargs) + self.sentiment = kwargs.get('sentiment', None) + self.confidence_scores = kwargs.get('confidence_scores', None) + self.offset = kwargs.get('offset', None) + self.length = kwargs.get('length', None) + self.text = kwargs.get('text', None) + self.is_negated = kwargs.get('is_negated', None) + + +class SentenceSentiment(Model): + """SentenceSentiment. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. The sentence text. + :type text: str + :param sentiment: Required. The predicted Sentiment for the sentence. + Possible values include: 'positive', 'neutral', 'negative' + :type sentiment: str or + ~azure.cognitiveservices.language.textanalytics.models.SentenceSentimentValue + :param confidence_scores: Required. The sentiment confidence score between + 0 and 1 for the sentence for all classes. + :type confidence_scores: + ~azure.cognitiveservices.language.textanalytics.models.SentimentConfidenceScorePerLabel + :param offset: Required. The sentence offset from the start of the + document. + :type offset: int + :param length: Required. The length of the sentence. + :type length: int + :param aspects: The array of aspect object for the sentence. + :type aspects: + list[~azure.cognitiveservices.language.textanalytics.models.SentenceAspect] + :param opinions: The array of opinion object for the sentence. + :type opinions: + list[~azure.cognitiveservices.language.textanalytics.models.SentenceOpinion] + """ + + _validation = { + 'text': {'required': True}, + 'sentiment': {'required': True}, + 'confidence_scores': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'sentiment': {'key': 'sentiment', 'type': 'SentenceSentimentValue'}, + 'confidence_scores': {'key': 'confidenceScores', 'type': 'SentimentConfidenceScorePerLabel'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'aspects': {'key': 'aspects', 'type': '[SentenceAspect]'}, + 'opinions': {'key': 'opinions', 'type': '[SentenceOpinion]'}, + } + + def __init__(self, **kwargs): + super(SentenceSentiment, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.sentiment = kwargs.get('sentiment', None) + self.confidence_scores = kwargs.get('confidence_scores', None) + self.offset = kwargs.get('offset', None) + self.length = kwargs.get('length', None) + self.aspects = kwargs.get('aspects', None) + self.opinions = kwargs.get('opinions', None) + + +class SentimentConfidenceScorePerLabel(Model): + """Represents the confidence scores between 0 and 1 across all sentiment + classes: positive, neutral, negative. + + All required parameters must be populated in order to send to Azure. + + :param positive: Required. + :type positive: float + :param neutral: Required. + :type neutral: float + :param negative: Required. + :type negative: float + """ + + _validation = { + 'positive': {'required': True}, + 'neutral': {'required': True}, + 'negative': {'required': True}, + } + + _attribute_map = { + 'positive': {'key': 'positive', 'type': 'float'}, + 'neutral': {'key': 'neutral', 'type': 'float'}, + 'negative': {'key': 'negative', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(SentimentConfidenceScorePerLabel, self).__init__(**kwargs) + self.positive = kwargs.get('positive', None) + self.neutral = kwargs.get('neutral', None) + self.negative = kwargs.get('negative', None) + + +class SentimentResponse(Model): + """SentimentResponse. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Sentiment analysis per document. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentSentiment] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentSentiment]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SentimentResponse, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + self.errors = kwargs.get('errors', None) + self.statistics = kwargs.get('statistics', None) + self.model_version = kwargs.get('model_version', None) + + +class TasksState(Model): + """TasksState. + + All required parameters must be populated in order to send to Azure. + + :param tasks: Required. + :type tasks: + ~azure.cognitiveservices.language.textanalytics.models.AnalyzeJobStateTasks + """ + + _validation = { + 'tasks': {'required': True}, + } + + _attribute_map = { + 'tasks': {'key': 'tasks', 'type': 'AnalyzeJobStateTasks'}, + } + + def __init__(self, **kwargs): + super(TasksState, self).__init__(**kwargs) + self.tasks = kwargs.get('tasks', None) + + +class TextAnalyticsError(Model): + """TextAnalyticsError. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code. Possible values include: + 'InvalidRequest', 'InvalidArgument', 'InternalServerError', + 'ServiceUnavailable', 'NotFound' + :type code: str or + ~azure.cognitiveservices.language.textanalytics.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.cognitiveservices.language.textanalytics.models.InnerError + :param details: Details about specific errors that led to this reported + error. + :type details: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsError] + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'ErrorCodeValue'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'details': {'key': 'details', 'type': '[TextAnalyticsError]'}, + } + + def __init__(self, **kwargs): + super(TextAnalyticsError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.innererror = kwargs.get('innererror', None) + self.details = kwargs.get('details', None) + + +class TextAnalyticsWarning(Model): + """TextAnalyticsWarning. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code. Possible values include: + 'LongWordsInDocument', 'DocumentTruncated' + :type code: str or + ~azure.cognitiveservices.language.textanalytics.models.WarningCodeValue + :param message: Required. Warning message. + :type message: str + :param target_ref: A JSON pointer reference indicating the target object. + :type target_ref: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target_ref': {'key': 'targetRef', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TextAnalyticsWarning, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target_ref = kwargs.get('target_ref', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models_py3.py new file mode 100644 index 00000000000..cafaf560200 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models_py3.py @@ -0,0 +1,2130 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AnalyzeBatchInput(Model): + """AnalyzeBatchInput. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Optional display name for the analysis job. + :type display_name: str + :param analysis_input: Required. + :type analysis_input: + ~azure.cognitiveservices.language.textanalytics.models.MultiLanguageBatchInput + :param tasks: Required. The set of tasks to execute on the input + documents. Cannot specify the same task more than once. + :type tasks: + ~azure.cognitiveservices.language.textanalytics.models.JobManifestTasks + """ + + _validation = { + 'analysis_input': {'required': True}, + 'tasks': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'analysis_input': {'key': 'analysisInput', 'type': 'MultiLanguageBatchInput'}, + 'tasks': {'key': 'tasks', 'type': 'JobManifestTasks'}, + } + + def __init__(self, *, analysis_input, tasks, display_name: str=None, **kwargs) -> None: + super(AnalyzeBatchInput, self).__init__(**kwargs) + self.display_name = display_name + self.analysis_input = analysis_input + self.tasks = tasks + + +class AnalyzeJobState(Model): + """AnalyzeJobState. + + All required parameters must be populated in order to send to Azure. + + :param created_date_time: Required. + :type created_date_time: datetime + :param display_name: + :type display_name: str + :param expiration_date_time: + :type expiration_date_time: datetime + :param job_id: Required. + :type job_id: str + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param status: Required. Possible values include: 'notStarted', 'running', + 'succeeded', 'failed', 'cancelled', 'cancelling', 'partiallyCompleted' + :type status: str or + ~azure.cognitiveservices.language.textanalytics.models.State + :param tasks: Required. + :type tasks: + ~azure.cognitiveservices.language.textanalytics.models.AnalyzeJobStateTasks + :param errors: + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param next_link: + :type next_link: str + """ + + _validation = { + 'created_date_time': {'required': True}, + 'job_id': {'required': True}, + 'last_update_date_time': {'required': True}, + 'status': {'required': True}, + 'tasks': {'required': True}, + } + + _attribute_map = { + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'State'}, + 'tasks': {'key': 'tasks', 'type': 'AnalyzeJobStateTasks'}, + 'errors': {'key': 'errors', 'type': '[TextAnalyticsError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__(self, *, created_date_time, job_id: str, last_update_date_time, status, tasks, display_name: str=None, expiration_date_time=None, errors=None, statistics=None, next_link: str=None, **kwargs) -> None: + super(AnalyzeJobState, self).__init__(**kwargs) + self.created_date_time = created_date_time + self.display_name = display_name + self.expiration_date_time = expiration_date_time + self.job_id = job_id + self.last_update_date_time = last_update_date_time + self.status = status + self.tasks = tasks + self.errors = errors + self.statistics = statistics + self.next_link = next_link + + +class AnalyzeJobStateTasks(Model): + """AnalyzeJobStateTasks. + + All required parameters must be populated in order to send to Azure. + + :param details: + :type details: + list[~azure.cognitiveservices.language.textanalytics.models.TaskState] + :param completed: Required. + :type completed: int + :param failed: Required. + :type failed: int + :param in_progress: Required. + :type in_progress: int + :param total: Required. + :type total: int + :param entity_recognition_tasks: + :type entity_recognition_tasks: + list[~azure.cognitiveservices.language.textanalytics.models.AnalyzeJobStateTasksEntityRecognitionTasksItem] + :param entity_recognition_pii_tasks: + :type entity_recognition_pii_tasks: + list[~azure.cognitiveservices.language.textanalytics.models.AnalyzeJobStateTasksEntityRecognitionPiiTasksItem] + :param key_phrase_extraction_tasks: + :type key_phrase_extraction_tasks: + list[~azure.cognitiveservices.language.textanalytics.models.AnalyzeJobStateTasksKeyPhraseExtractionTasksItem] + """ + + _validation = { + 'completed': {'required': True}, + 'failed': {'required': True}, + 'in_progress': {'required': True}, + 'total': {'required': True}, + } + + _attribute_map = { + 'details': {'key': 'details', 'type': '[TaskState]'}, + 'completed': {'key': 'completed', 'type': 'int'}, + 'failed': {'key': 'failed', 'type': 'int'}, + 'in_progress': {'key': 'inProgress', 'type': 'int'}, + 'total': {'key': 'total', 'type': 'int'}, + 'entity_recognition_tasks': {'key': 'entityRecognitionTasks', 'type': '[AnalyzeJobStateTasksEntityRecognitionTasksItem]'}, + 'entity_recognition_pii_tasks': {'key': 'entityRecognitionPiiTasks', 'type': '[AnalyzeJobStateTasksEntityRecognitionPiiTasksItem]'}, + 'key_phrase_extraction_tasks': {'key': 'keyPhraseExtractionTasks', 'type': '[AnalyzeJobStateTasksKeyPhraseExtractionTasksItem]'}, + } + + def __init__(self, *, completed: int, failed: int, in_progress: int, total: int, details=None, entity_recognition_tasks=None, entity_recognition_pii_tasks=None, key_phrase_extraction_tasks=None, **kwargs) -> None: + super(AnalyzeJobStateTasks, self).__init__(**kwargs) + self.details = details + self.completed = completed + self.failed = failed + self.in_progress = in_progress + self.total = total + self.entity_recognition_tasks = entity_recognition_tasks + self.entity_recognition_pii_tasks = entity_recognition_pii_tasks + self.key_phrase_extraction_tasks = key_phrase_extraction_tasks + + +class TaskState(Model): + """TaskState. + + All required parameters must be populated in order to send to Azure. + + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param name: Required. + :type name: str + :param status: Required. + :type status: object + """ + + _validation = { + 'last_update_date_time': {'required': True}, + 'name': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + } + + def __init__(self, *, last_update_date_time, name: str, status, **kwargs) -> None: + super(TaskState, self).__init__(**kwargs) + self.last_update_date_time = last_update_date_time + self.name = name + self.status = status + + +class AnalyzeJobStateTasksEntityRecognitionPiiTasksItem(TaskState): + """AnalyzeJobStateTasksEntityRecognitionPiiTasksItem. + + All required parameters must be populated in order to send to Azure. + + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param name: Required. + :type name: str + :param status: Required. + :type status: object + :param results: + :type results: + ~azure.cognitiveservices.language.textanalytics.models.PiiResult + """ + + _validation = { + 'last_update_date_time': {'required': True}, + 'name': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'results': {'key': 'results', 'type': 'PiiResult'}, + } + + def __init__(self, *, last_update_date_time, name: str, status, results=None, **kwargs) -> None: + super(AnalyzeJobStateTasksEntityRecognitionPiiTasksItem, self).__init__(last_update_date_time=last_update_date_time, name=name, status=status, **kwargs) + self.results = results + + +class AnalyzeJobStateTasksEntityRecognitionTasksItem(TaskState): + """AnalyzeJobStateTasksEntityRecognitionTasksItem. + + All required parameters must be populated in order to send to Azure. + + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param name: Required. + :type name: str + :param status: Required. + :type status: object + :param results: + :type results: + ~azure.cognitiveservices.language.textanalytics.models.EntitiesResult + """ + + _validation = { + 'last_update_date_time': {'required': True}, + 'name': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'results': {'key': 'results', 'type': 'EntitiesResult'}, + } + + def __init__(self, *, last_update_date_time, name: str, status, results=None, **kwargs) -> None: + super(AnalyzeJobStateTasksEntityRecognitionTasksItem, self).__init__(last_update_date_time=last_update_date_time, name=name, status=status, **kwargs) + self.results = results + + +class AnalyzeJobStateTasksKeyPhraseExtractionTasksItem(TaskState): + """AnalyzeJobStateTasksKeyPhraseExtractionTasksItem. + + All required parameters must be populated in order to send to Azure. + + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param name: Required. + :type name: str + :param status: Required. + :type status: object + :param results: + :type results: + ~azure.cognitiveservices.language.textanalytics.models.KeyPhraseResult + """ + + _validation = { + 'last_update_date_time': {'required': True}, + 'name': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'object'}, + 'results': {'key': 'results', 'type': 'KeyPhraseResult'}, + } + + def __init__(self, *, last_update_date_time, name: str, status, results=None, **kwargs) -> None: + super(AnalyzeJobStateTasksKeyPhraseExtractionTasksItem, self).__init__(last_update_date_time=last_update_date_time, name=name, status=status, **kwargs) + self.results = results + + +class AspectConfidenceScoreLabel(Model): + """Represents the confidence scores across all sentiment classes: positive, + neutral, negative. + + All required parameters must be populated in order to send to Azure. + + :param positive: Required. + :type positive: float + :param negative: Required. + :type negative: float + """ + + _validation = { + 'positive': {'required': True}, + 'negative': {'required': True}, + } + + _attribute_map = { + 'positive': {'key': 'positive', 'type': 'float'}, + 'negative': {'key': 'negative', 'type': 'float'}, + } + + def __init__(self, *, positive: float, negative: float, **kwargs) -> None: + super(AspectConfidenceScoreLabel, self).__init__(**kwargs) + self.positive = positive + self.negative = negative + + +class AspectRelation(Model): + """AspectRelation. + + All required parameters must be populated in order to send to Azure. + + :param relation_type: Required. The type related to the aspect. Possible + values include: 'opinion', 'aspect' + :type relation_type: str or + ~azure.cognitiveservices.language.textanalytics.models.AspectRelationType + :param ref: Required. The JSON pointer indicating the linked object. + :type ref: str + """ + + _validation = { + 'relation_type': {'required': True}, + 'ref': {'required': True}, + } + + _attribute_map = { + 'relation_type': {'key': 'relationType', 'type': 'AspectRelationType'}, + 'ref': {'key': 'ref', 'type': 'str'}, + } + + def __init__(self, *, relation_type, ref: str, **kwargs) -> None: + super(AspectRelation, self).__init__(**kwargs) + self.relation_type = relation_type + self.ref = ref + + +class DetectedLanguage(Model): + """DetectedLanguage. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Long name of a detected language (e.g. English, + French). + :type name: str + :param iso6391_name: Required. A two letter representation of the detected + language according to the ISO 639-1 standard (e.g. en, fr). + :type iso6391_name: str + :param confidence_score: Required. A confidence score between 0 and 1. + Scores close to 1 indicate 100% certainty that the identified language is + true. + :type confidence_score: float + """ + + _validation = { + 'name': {'required': True}, + 'iso6391_name': {'required': True}, + 'confidence_score': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, + 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, + } + + def __init__(self, *, name: str, iso6391_name: str, confidence_score: float, **kwargs) -> None: + super(DetectedLanguage, self).__init__(**kwargs) + self.name = name + self.iso6391_name = iso6391_name + self.confidence_score = confidence_score + + +class DocumentEntities(Model): + """DocumentEntities. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param entities: Required. Recognized entities in the document. + :type entities: + list[~azure.cognitiveservices.language.textanalytics.models.Entity] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'entities': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[Entity]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, *, id: str, entities, warnings, statistics=None, **kwargs) -> None: + super(DocumentEntities, self).__init__(**kwargs) + self.id = id + self.entities = entities + self.warnings = warnings + self.statistics = statistics + + +class DocumentError(Model): + """DocumentError. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Document Id. + :type id: str + :param error: Required. Document Error. + :type error: + ~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsError + """ + + _validation = { + 'id': {'required': True}, + 'error': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'TextAnalyticsError'}, + } + + def __init__(self, *, id: str, error, **kwargs) -> None: + super(DocumentError, self).__init__(**kwargs) + self.id = id + self.error = error + + +class DocumentHealthcareEntities(Model): + """DocumentHealthcareEntities. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param entities: Required. Healthcare entities. + :type entities: + list[~azure.cognitiveservices.language.textanalytics.models.HealthcareEntity] + :param relations: Required. Healthcare entity relations. + :type relations: + list[~azure.cognitiveservices.language.textanalytics.models.HealthcareRelation] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'entities': {'required': True}, + 'relations': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[HealthcareEntity]'}, + 'relations': {'key': 'relations', 'type': '[HealthcareRelation]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, *, id: str, entities, relations, warnings, statistics=None, **kwargs) -> None: + super(DocumentHealthcareEntities, self).__init__(**kwargs) + self.id = id + self.entities = entities + self.relations = relations + self.warnings = warnings + self.statistics = statistics + + +class DocumentKeyPhrases(Model): + """DocumentKeyPhrases. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param key_phrases: Required. A list of representative words or phrases. + The number of key phrases returned is proportional to the number of words + in the input document. + :type key_phrases: list[str] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'key_phrases': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, *, id: str, key_phrases, warnings, statistics=None, **kwargs) -> None: + super(DocumentKeyPhrases, self).__init__(**kwargs) + self.id = id + self.key_phrases = key_phrases + self.warnings = warnings + self.statistics = statistics + + +class DocumentLanguage(Model): + """DocumentLanguage. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param detected_language: Required. Detected Language. + :type detected_language: + ~azure.cognitiveservices.language.textanalytics.models.DetectedLanguage + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'detected_language': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'detected_language': {'key': 'detectedLanguage', 'type': 'DetectedLanguage'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, *, id: str, detected_language, warnings, statistics=None, **kwargs) -> None: + super(DocumentLanguage, self).__init__(**kwargs) + self.id = id + self.detected_language = detected_language + self.warnings = warnings + self.statistics = statistics + + +class DocumentLinkedEntities(Model): + """DocumentLinkedEntities. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param entities: Required. Recognized well-known entities in the document. + :type entities: + list[~azure.cognitiveservices.language.textanalytics.models.LinkedEntity] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'entities': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[LinkedEntity]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, *, id: str, entities, warnings, statistics=None, **kwargs) -> None: + super(DocumentLinkedEntities, self).__init__(**kwargs) + self.id = id + self.entities = entities + self.warnings = warnings + self.statistics = statistics + + +class DocumentSentiment(Model): + """DocumentSentiment. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param sentiment: Required. Predicted sentiment for document (Negative, + Neutral, Positive, or Mixed). Possible values include: 'positive', + 'neutral', 'negative', 'mixed' + :type sentiment: str or + ~azure.cognitiveservices.language.textanalytics.models.DocumentSentimentValue + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + :param confidence_scores: Required. Document level sentiment confidence + scores between 0 and 1 for each sentiment class. + :type confidence_scores: + ~azure.cognitiveservices.language.textanalytics.models.SentimentConfidenceScorePerLabel + :param sentences: Required. Sentence level sentiment analysis. + :type sentences: + list[~azure.cognitiveservices.language.textanalytics.models.SentenceSentiment] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + """ + + _validation = { + 'id': {'required': True}, + 'sentiment': {'required': True}, + 'confidence_scores': {'required': True}, + 'sentences': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'sentiment': {'key': 'sentiment', 'type': 'DocumentSentimentValue'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + 'confidence_scores': {'key': 'confidenceScores', 'type': 'SentimentConfidenceScorePerLabel'}, + 'sentences': {'key': 'sentences', 'type': '[SentenceSentiment]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + } + + def __init__(self, *, id: str, sentiment, confidence_scores, sentences, warnings, statistics=None, **kwargs) -> None: + super(DocumentSentiment, self).__init__(**kwargs) + self.id = id + self.sentiment = sentiment + self.statistics = statistics + self.confidence_scores = confidence_scores + self.sentences = sentences + self.warnings = warnings + + +class DocumentStatistics(Model): + """if showStats=true was specified in the request this field will contain + information about the document payload. + + All required parameters must be populated in order to send to Azure. + + :param characters_count: Required. Number of text elements recognized in + the document. + :type characters_count: int + :param transactions_count: Required. Number of transactions for the + document. + :type transactions_count: int + """ + + _validation = { + 'characters_count': {'required': True}, + 'transactions_count': {'required': True}, + } + + _attribute_map = { + 'characters_count': {'key': 'charactersCount', 'type': 'int'}, + 'transactions_count': {'key': 'transactionsCount', 'type': 'int'}, + } + + def __init__(self, *, characters_count: int, transactions_count: int, **kwargs) -> None: + super(DocumentStatistics, self).__init__(**kwargs) + self.characters_count = characters_count + self.transactions_count = transactions_count + + +class EntitiesResult(Model): + """EntitiesResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentEntities] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentEntities]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, *, documents, errors, model_version: str, statistics=None, **kwargs) -> None: + super(EntitiesResult, self).__init__(**kwargs) + self.documents = documents + self.errors = errors + self.statistics = statistics + self.model_version = model_version + + +class EntitiesTask(Model): + """EntitiesTask. + + :param parameters: + :type parameters: + ~azure.cognitiveservices.language.textanalytics.models.EntitiesTaskParameters + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': 'EntitiesTaskParameters'}, + } + + def __init__(self, *, parameters=None, **kwargs) -> None: + super(EntitiesTask, self).__init__(**kwargs) + self.parameters = parameters + + +class EntitiesTaskParameters(Model): + """EntitiesTaskParameters. + + :param model_version: Default value: "latest" . + :type model_version: str + :param string_index_type: Possible values include: 'TextElements_v8', + 'UnicodeCodePoint', 'Utf16CodeUnit'. Default value: "TextElements_v8" . + :type string_index_type: str or + ~azure.cognitiveservices.language.textanalytics.models.StringIndexTypeResponse + """ + + _attribute_map = { + 'model_version': {'key': 'model-version', 'type': 'str'}, + 'string_index_type': {'key': 'stringIndexType', 'type': 'StringIndexTypeResponse'}, + } + + def __init__(self, *, model_version: str="latest", string_index_type="TextElements_v8", **kwargs) -> None: + super(EntitiesTaskParameters, self).__init__(**kwargs) + self.model_version = model_version + self.string_index_type = string_index_type + + +class Entity(Model): + """Entity. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. Entity text as appears in the request. + :type text: str + :param category: Required. Entity type. + :type category: str + :param subcategory: (Optional) Entity sub type. + :type subcategory: str + :param offset: Required. Start position for the entity text. Use of + different 'stringIndexType' values can affect the offset returned. + :type offset: int + :param length: Required. Length for the entity text. Use of different + 'stringIndexType' values can affect the length returned. + :type length: int + :param confidence_score: Required. Confidence score between 0 and 1 of the + extracted entity. + :type confidence_score: float + """ + + _validation = { + 'text': {'required': True}, + 'category': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + 'confidence_score': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'subcategory': {'key': 'subcategory', 'type': 'str'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, + } + + def __init__(self, *, text: str, category: str, offset: int, length: int, confidence_score: float, subcategory: str=None, **kwargs) -> None: + super(Entity, self).__init__(**kwargs) + self.text = text + self.category = category + self.subcategory = subcategory + self.offset = offset + self.length = length + self.confidence_score = confidence_score + + +class EntityLinkingResult(Model): + """EntityLinkingResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentLinkedEntities] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentLinkedEntities]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, *, documents, errors, model_version: str, statistics=None, **kwargs) -> None: + super(EntityLinkingResult, self).__init__(**kwargs) + self.documents = documents + self.errors = errors + self.statistics = statistics + self.model_version = model_version + + +class ErrorResponse(Model): + """ErrorResponse. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. Document Error. + :type error: + ~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsError + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'TextAnalyticsError'}, + } + + def __init__(self, *, error, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class HealthcareEntity(Entity): + """HealthcareEntity. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. Entity text as appears in the request. + :type text: str + :param category: Required. Entity type. + :type category: str + :param subcategory: (Optional) Entity sub type. + :type subcategory: str + :param offset: Required. Start position for the entity text. Use of + different 'stringIndexType' values can affect the offset returned. + :type offset: int + :param length: Required. Length for the entity text. Use of different + 'stringIndexType' values can affect the length returned. + :type length: int + :param confidence_score: Required. Confidence score between 0 and 1 of the + extracted entity. + :type confidence_score: float + :param is_negated: Required. + :type is_negated: bool + :param links: Entity references in known data sources. + :type links: + list[~azure.cognitiveservices.language.textanalytics.models.HealthcareEntityLink] + """ + + _validation = { + 'text': {'required': True}, + 'category': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + 'confidence_score': {'required': True}, + 'is_negated': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'subcategory': {'key': 'subcategory', 'type': 'str'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, + 'is_negated': {'key': 'isNegated', 'type': 'bool'}, + 'links': {'key': 'links', 'type': '[HealthcareEntityLink]'}, + } + + def __init__(self, *, text: str, category: str, offset: int, length: int, confidence_score: float, is_negated: bool, subcategory: str=None, links=None, **kwargs) -> None: + super(HealthcareEntity, self).__init__(text=text, category=category, subcategory=subcategory, offset=offset, length=length, confidence_score=confidence_score, **kwargs) + self.is_negated = is_negated + self.links = links + + +class HealthcareEntityLink(Model): + """HealthcareEntityLink. + + All required parameters must be populated in order to send to Azure. + + :param data_source: Required. Entity Catalog. Examples include: UMLS, CHV, + MSH, etc. + :type data_source: str + :param id: Required. Entity id in the given source catalog. + :type id: str + """ + + _validation = { + 'data_source': {'required': True}, + 'id': {'required': True}, + } + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, data_source: str, id: str, **kwargs) -> None: + super(HealthcareEntityLink, self).__init__(**kwargs) + self.data_source = data_source + self.id = id + + +class HealthcareJobState(Model): + """HealthcareJobState. + + All required parameters must be populated in order to send to Azure. + + :param created_date_time: Required. + :type created_date_time: datetime + :param display_name: + :type display_name: str + :param expiration_date_time: + :type expiration_date_time: datetime + :param job_id: Required. + :type job_id: str + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param status: Required. Possible values include: 'notStarted', 'running', + 'succeeded', 'failed', 'cancelled', 'cancelling', 'partiallyCompleted' + :type status: str or + ~azure.cognitiveservices.language.textanalytics.models.State + :param results: + :type results: + ~azure.cognitiveservices.language.textanalytics.models.HealthcareResult + :param errors: + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsError] + :param next_link: + :type next_link: str + """ + + _validation = { + 'created_date_time': {'required': True}, + 'job_id': {'required': True}, + 'last_update_date_time': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'State'}, + 'results': {'key': 'results', 'type': 'HealthcareResult'}, + 'errors': {'key': 'errors', 'type': '[TextAnalyticsError]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__(self, *, created_date_time, job_id: str, last_update_date_time, status, display_name: str=None, expiration_date_time=None, results=None, errors=None, next_link: str=None, **kwargs) -> None: + super(HealthcareJobState, self).__init__(**kwargs) + self.created_date_time = created_date_time + self.display_name = display_name + self.expiration_date_time = expiration_date_time + self.job_id = job_id + self.last_update_date_time = last_update_date_time + self.status = status + self.results = results + self.errors = errors + self.next_link = next_link + + +class HealthcareRelation(Model): + """HealthcareRelation. + + All required parameters must be populated in order to send to Azure. + + :param relation_type: Required. Type of relation. Examples include: + `DosageOfMedication` or 'FrequencyOfMedication', etc. + :type relation_type: str + :param bidirectional: Required. If true the relation between the entities + is bidirectional, otherwise directionality is source to target. + :type bidirectional: bool + :param source: Required. Reference link to the source entity. + :type source: str + :param target: Required. Reference link to the target entity. + :type target: str + """ + + _validation = { + 'relation_type': {'required': True}, + 'bidirectional': {'required': True}, + 'source': {'required': True}, + 'target': {'required': True}, + } + + _attribute_map = { + 'relation_type': {'key': 'relationType', 'type': 'str'}, + 'bidirectional': {'key': 'bidirectional', 'type': 'bool'}, + 'source': {'key': 'source', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, relation_type: str, bidirectional: bool, source: str, target: str, **kwargs) -> None: + super(HealthcareRelation, self).__init__(**kwargs) + self.relation_type = relation_type + self.bidirectional = bidirectional + self.source = source + self.target = target + + +class HealthcareResult(Model): + """HealthcareResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentHealthcareEntities] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentHealthcareEntities]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, *, documents, errors, model_version: str, statistics=None, **kwargs) -> None: + super(HealthcareResult, self).__init__(**kwargs) + self.documents = documents + self.errors = errors + self.statistics = statistics + self.model_version = model_version + + +class InnerError(Model): + """InnerError. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code. Possible values include: + 'InvalidParameterValue', 'InvalidRequestBodyFormat', 'EmptyRequest', + 'MissingInputRecords', 'InvalidDocument', 'ModelVersionIncorrect', + 'InvalidDocumentBatch', 'UnsupportedLanguageCode', 'InvalidCountryHint' + :type code: str or + ~azure.cognitiveservices.language.textanalytics.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.cognitiveservices.language.textanalytics.models.InnerError + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '{str}'}, + 'target': {'key': 'target', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, *, code, message: str, details=None, target: str=None, innererror=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + self.target = target + self.innererror = innererror + + +class JobDescriptor(Model): + """JobDescriptor. + + :param display_name: Optional display name for the analysis job. + :type display_name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, **kwargs) -> None: + super(JobDescriptor, self).__init__(**kwargs) + self.display_name = display_name + + +class JobManifest(Model): + """JobManifest. + + All required parameters must be populated in order to send to Azure. + + :param tasks: Required. The set of tasks to execute on the input + documents. Cannot specify the same task more than once. + :type tasks: + ~azure.cognitiveservices.language.textanalytics.models.JobManifestTasks + """ + + _validation = { + 'tasks': {'required': True}, + } + + _attribute_map = { + 'tasks': {'key': 'tasks', 'type': 'JobManifestTasks'}, + } + + def __init__(self, *, tasks, **kwargs) -> None: + super(JobManifest, self).__init__(**kwargs) + self.tasks = tasks + + +class JobManifestTasks(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.cognitiveservices.language.textanalytics.models.EntitiesTask] + :param entity_recognition_pii_tasks: + :type entity_recognition_pii_tasks: + list[~azure.cognitiveservices.language.textanalytics.models.PiiTask] + :param key_phrase_extraction_tasks: + :type key_phrase_extraction_tasks: + list[~azure.cognitiveservices.language.textanalytics.models.KeyPhrasesTask] + """ + + _attribute_map = { + 'entity_recognition_tasks': {'key': 'entityRecognitionTasks', 'type': '[EntitiesTask]'}, + 'entity_recognition_pii_tasks': {'key': 'entityRecognitionPiiTasks', 'type': '[PiiTask]'}, + 'key_phrase_extraction_tasks': {'key': 'keyPhraseExtractionTasks', 'type': '[KeyPhrasesTask]'}, + } + + def __init__(self, *, entity_recognition_tasks=None, entity_recognition_pii_tasks=None, key_phrase_extraction_tasks=None, **kwargs) -> None: + super(JobManifestTasks, self).__init__(**kwargs) + self.entity_recognition_tasks = entity_recognition_tasks + self.entity_recognition_pii_tasks = entity_recognition_pii_tasks + self.key_phrase_extraction_tasks = key_phrase_extraction_tasks + + +class JobMetadata(Model): + """JobMetadata. + + All required parameters must be populated in order to send to Azure. + + :param created_date_time: Required. + :type created_date_time: datetime + :param display_name: + :type display_name: str + :param expiration_date_time: + :type expiration_date_time: datetime + :param job_id: Required. + :type job_id: str + :param last_update_date_time: Required. + :type last_update_date_time: datetime + :param status: Required. Possible values include: 'notStarted', 'running', + 'succeeded', 'failed', 'cancelled', 'cancelling', 'partiallyCompleted' + :type status: str or + ~azure.cognitiveservices.language.textanalytics.models.State + """ + + _validation = { + 'created_date_time': {'required': True}, + 'job_id': {'required': True}, + 'last_update_date_time': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'expiration_date_time': {'key': 'expirationDateTime', 'type': 'iso-8601'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'last_update_date_time': {'key': 'lastUpdateDateTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'State'}, + } + + def __init__(self, *, created_date_time, job_id: str, last_update_date_time, status, display_name: str=None, expiration_date_time=None, **kwargs) -> None: + super(JobMetadata, self).__init__(**kwargs) + self.created_date_time = created_date_time + self.display_name = display_name + self.expiration_date_time = expiration_date_time + self.job_id = job_id + self.last_update_date_time = last_update_date_time + self.status = status + + +class KeyPhraseResult(Model): + """KeyPhraseResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentKeyPhrases] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentKeyPhrases]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, *, documents, errors, model_version: str, statistics=None, **kwargs) -> None: + super(KeyPhraseResult, self).__init__(**kwargs) + self.documents = documents + self.errors = errors + self.statistics = statistics + self.model_version = model_version + + +class KeyPhrasesTask(Model): + """KeyPhrasesTask. + + :param parameters: + :type parameters: + ~azure.cognitiveservices.language.textanalytics.models.KeyPhrasesTaskParameters + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': 'KeyPhrasesTaskParameters'}, + } + + def __init__(self, *, parameters=None, **kwargs) -> None: + super(KeyPhrasesTask, self).__init__(**kwargs) + self.parameters = parameters + + +class KeyPhrasesTaskParameters(Model): + """KeyPhrasesTaskParameters. + + :param model_version: Default value: "latest" . + :type model_version: str + """ + + _attribute_map = { + 'model_version': {'key': 'model-version', 'type': 'str'}, + } + + def __init__(self, *, model_version: str="latest", **kwargs) -> None: + super(KeyPhrasesTaskParameters, self).__init__(**kwargs) + self.model_version = model_version + + +class LanguageBatchInput(Model): + """LanguageBatchInput. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.LanguageInput] + """ + + _validation = { + 'documents': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[LanguageInput]'}, + } + + def __init__(self, *, documents, **kwargs) -> None: + super(LanguageBatchInput, self).__init__(**kwargs) + self.documents = documents + + +class LanguageInput(Model): + """LanguageInput. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param text: Required. + :type text: str + :param country_hint: + :type country_hint: str + """ + + _validation = { + 'id': {'required': True}, + 'text': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'country_hint': {'key': 'countryHint', 'type': 'str'}, + } + + def __init__(self, *, id: str, text: str, country_hint: str=None, **kwargs) -> None: + super(LanguageInput, self).__init__(**kwargs) + self.id = id + self.text = text + self.country_hint = country_hint + + +class LanguageResult(Model): + """LanguageResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentLanguage] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentLanguage]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, *, documents, errors, model_version: str, statistics=None, **kwargs) -> None: + super(LanguageResult, self).__init__(**kwargs) + self.documents = documents + self.errors = errors + self.statistics = statistics + self.model_version = model_version + + +class LinkedEntity(Model): + """LinkedEntity. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Entity Linking formal name. + :type name: str + :param matches: Required. List of instances this entity appears in the + text. + :type matches: + list[~azure.cognitiveservices.language.textanalytics.models.Match] + :param language: Required. Language used in the data source. + :type language: str + :param id: Unique identifier of the recognized entity from the data + source. + :type id: str + :param url: Required. URL for the entity's page from the data source. + :type url: str + :param data_source: Required. Data source used to extract entity linking, + such as Wiki/Bing etc. + :type data_source: str + :param bing_id: Bing Entity Search API unique identifier of the recognized + entity. + :type bing_id: str + """ + + _validation = { + 'name': {'required': True}, + 'matches': {'required': True}, + 'language': {'required': True}, + 'url': {'required': True}, + 'data_source': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'matches': {'key': 'matches', 'type': '[Match]'}, + 'language': {'key': 'language', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + def __init__(self, *, name: str, matches, language: str, url: str, data_source: str, id: str=None, bing_id: str=None, **kwargs) -> None: + super(LinkedEntity, self).__init__(**kwargs) + self.name = name + self.matches = matches + self.language = language + self.id = id + self.url = url + self.data_source = data_source + self.bing_id = bing_id + + +class Match(Model): + """Match. + + All required parameters must be populated in order to send to Azure. + + :param confidence_score: Required. If a well-known item is recognized, a + decimal number denoting the confidence level between 0 and 1 will be + returned. + :type confidence_score: float + :param text: Required. Entity text as appears in the request. + :type text: str + :param offset: Required. Start position for the entity match text. + :type offset: int + :param length: Required. Length for the entity match text. + :type length: int + """ + + _validation = { + 'confidence_score': {'required': True}, + 'text': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + } + + _attribute_map = { + 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, + 'text': {'key': 'text', 'type': 'str'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + } + + def __init__(self, *, confidence_score: float, text: str, offset: int, length: int, **kwargs) -> None: + super(Match, self).__init__(**kwargs) + self.confidence_score = confidence_score + self.text = text + self.offset = offset + self.length = length + + +class MultiLanguageBatchInput(Model): + """Contains a set of input documents to be analyzed by the service. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. The set of documents to process as part of + this batch. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + """ + + _validation = { + 'documents': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, + } + + def __init__(self, *, documents, **kwargs) -> None: + super(MultiLanguageBatchInput, self).__init__(**kwargs) + self.documents = documents + + +class MultiLanguageInput(Model): + """Contains an input document to be analyzed by the service. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A unique, non-empty document identifier. + :type id: str + :param text: Required. The input text to process. + :type text: str + :param language: (Optional) This is the 2 letter ISO 639-1 representation + of a language. For example, use "en" for English; "es" for Spanish etc. If + not set, use "en" for English as default. + :type language: str + """ + + _validation = { + 'id': {'required': True}, + 'text': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'language': {'key': 'language', 'type': 'str'}, + } + + def __init__(self, *, id: str, text: str, language: str=None, **kwargs) -> None: + super(MultiLanguageInput, self).__init__(**kwargs) + self.id = id + self.text = text + self.language = language + + +class Pagination(Model): + """Pagination. + + :param next_link: + :type next_link: str + """ + + _attribute_map = { + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__(self, *, next_link: str=None, **kwargs) -> None: + super(Pagination, self).__init__(**kwargs) + self.next_link = next_link + + +class PiiDocumentEntities(Model): + """PiiDocumentEntities. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Unique, non-empty document identifier. + :type id: str + :param redacted_text: Required. Returns redacted text. + :type redacted_text: str + :param entities: Required. Recognized entities in the document. + :type entities: + list[~azure.cognitiveservices.language.textanalytics.models.Entity] + :param warnings: Required. Warnings encountered while processing document. + :type warnings: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsWarning] + :param statistics: if showStats=true was specified in the request this + field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'id': {'required': True}, + 'redacted_text': {'required': True}, + 'entities': {'required': True}, + 'warnings': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'redacted_text': {'key': 'redactedText', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[Entity]'}, + 'warnings': {'key': 'warnings', 'type': '[TextAnalyticsWarning]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, *, id: str, redacted_text: str, entities, warnings, statistics=None, **kwargs) -> None: + super(PiiDocumentEntities, self).__init__(**kwargs) + self.id = id + self.redacted_text = redacted_text + self.entities = entities + self.warnings = warnings + self.statistics = statistics + + +class PiiResult(Model): + """PiiResult. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Response by document + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.PiiDocumentEntities] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[PiiDocumentEntities]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, *, documents, errors, model_version: str, statistics=None, **kwargs) -> None: + super(PiiResult, self).__init__(**kwargs) + self.documents = documents + self.errors = errors + self.statistics = statistics + self.model_version = model_version + + +class PiiTask(Model): + """PiiTask. + + :param parameters: + :type parameters: + ~azure.cognitiveservices.language.textanalytics.models.PiiTaskParameters + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': 'PiiTaskParameters'}, + } + + def __init__(self, *, parameters=None, **kwargs) -> None: + super(PiiTask, self).__init__(**kwargs) + self.parameters = parameters + + +class PiiTaskParameters(Model): + """PiiTaskParameters. + + :param domain: Possible values include: 'phi', 'none'. Default value: + "none" . + :type domain: str or + ~azure.cognitiveservices.language.textanalytics.models.enum + :param model_version: Default value: "latest" . + :type model_version: str + :param string_index_type: Possible values include: 'TextElements_v8', + 'UnicodeCodePoint', 'Utf16CodeUnit'. Default value: "TextElements_v8" . + :type string_index_type: str or + ~azure.cognitiveservices.language.textanalytics.models.StringIndexTypeResponse + """ + + _attribute_map = { + 'domain': {'key': 'domain', 'type': 'str'}, + 'model_version': {'key': 'model-version', 'type': 'str'}, + 'string_index_type': {'key': 'stringIndexType', 'type': 'StringIndexTypeResponse'}, + } + + def __init__(self, *, domain="none", model_version: str="latest", string_index_type="TextElements_v8", **kwargs) -> None: + super(PiiTaskParameters, self).__init__(**kwargs) + self.domain = domain + self.model_version = model_version + self.string_index_type = string_index_type + + +class RequestStatistics(Model): + """if showStats=true was specified in the request this field will contain + information about the request payload. + + All required parameters must be populated in order to send to Azure. + + :param documents_count: Required. Number of documents submitted in the + request. + :type documents_count: int + :param valid_documents_count: Required. Number of valid documents. This + excludes empty, over-size limit or non-supported languages documents. + :type valid_documents_count: int + :param erroneous_documents_count: Required. Number of invalid documents. + This includes empty, over-size limit or non-supported languages documents. + :type erroneous_documents_count: int + :param transactions_count: Required. Number of transactions for the + request. + :type transactions_count: long + """ + + _validation = { + 'documents_count': {'required': True}, + 'valid_documents_count': {'required': True}, + 'erroneous_documents_count': {'required': True}, + 'transactions_count': {'required': True}, + } + + _attribute_map = { + 'documents_count': {'key': 'documentsCount', 'type': 'int'}, + 'valid_documents_count': {'key': 'validDocumentsCount', 'type': 'int'}, + 'erroneous_documents_count': {'key': 'erroneousDocumentsCount', 'type': 'int'}, + 'transactions_count': {'key': 'transactionsCount', 'type': 'long'}, + } + + def __init__(self, *, documents_count: int, valid_documents_count: int, erroneous_documents_count: int, transactions_count: int, **kwargs) -> None: + super(RequestStatistics, self).__init__(**kwargs) + self.documents_count = documents_count + self.valid_documents_count = valid_documents_count + self.erroneous_documents_count = erroneous_documents_count + self.transactions_count = transactions_count + + +class SentenceAspect(Model): + """SentenceAspect. + + All required parameters must be populated in order to send to Azure. + + :param sentiment: Required. Aspect level sentiment for the aspect in the + sentence. Possible values include: 'positive', 'mixed', 'negative' + :type sentiment: str or + ~azure.cognitiveservices.language.textanalytics.models.TokenSentimentValue + :param confidence_scores: Required. Aspect level sentiment confidence + scores for the aspect in the sentence. + :type confidence_scores: + ~azure.cognitiveservices.language.textanalytics.models.AspectConfidenceScoreLabel + :param offset: Required. The aspect offset from the start of the sentence. + :type offset: int + :param length: Required. The length of the aspect. + :type length: int + :param text: Required. The aspect text detected. + :type text: str + :param relations: Required. The array of either opinion or aspect object + which is related to the aspect. + :type relations: + list[~azure.cognitiveservices.language.textanalytics.models.AspectRelation] + """ + + _validation = { + 'sentiment': {'required': True}, + 'confidence_scores': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + 'text': {'required': True}, + 'relations': {'required': True}, + } + + _attribute_map = { + 'sentiment': {'key': 'sentiment', 'type': 'TokenSentimentValue'}, + 'confidence_scores': {'key': 'confidenceScores', 'type': 'AspectConfidenceScoreLabel'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'}, + 'relations': {'key': 'relations', 'type': '[AspectRelation]'}, + } + + def __init__(self, *, sentiment, confidence_scores, offset: int, length: int, text: str, relations, **kwargs) -> None: + super(SentenceAspect, self).__init__(**kwargs) + self.sentiment = sentiment + self.confidence_scores = confidence_scores + self.offset = offset + self.length = length + self.text = text + self.relations = relations + + +class SentenceOpinion(Model): + """SentenceOpinion. + + All required parameters must be populated in order to send to Azure. + + :param sentiment: Required. Opinion level sentiment for the aspect in the + sentence. Possible values include: 'positive', 'mixed', 'negative' + :type sentiment: str or + ~azure.cognitiveservices.language.textanalytics.models.TokenSentimentValue + :param confidence_scores: Required. Opinion level sentiment confidence + scores for the aspect in the sentence. + :type confidence_scores: + ~azure.cognitiveservices.language.textanalytics.models.AspectConfidenceScoreLabel + :param offset: Required. The opinion offset from the start of the + sentence. + :type offset: int + :param length: Required. The length of the opinion. + :type length: int + :param text: Required. The aspect text detected. + :type text: str + :param is_negated: Required. The indicator representing if the opinion is + negated. + :type is_negated: bool + """ + + _validation = { + 'sentiment': {'required': True}, + 'confidence_scores': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + 'text': {'required': True}, + 'is_negated': {'required': True}, + } + + _attribute_map = { + 'sentiment': {'key': 'sentiment', 'type': 'TokenSentimentValue'}, + 'confidence_scores': {'key': 'confidenceScores', 'type': 'AspectConfidenceScoreLabel'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'}, + 'is_negated': {'key': 'isNegated', 'type': 'bool'}, + } + + def __init__(self, *, sentiment, confidence_scores, offset: int, length: int, text: str, is_negated: bool, **kwargs) -> None: + super(SentenceOpinion, self).__init__(**kwargs) + self.sentiment = sentiment + self.confidence_scores = confidence_scores + self.offset = offset + self.length = length + self.text = text + self.is_negated = is_negated + + +class SentenceSentiment(Model): + """SentenceSentiment. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. The sentence text. + :type text: str + :param sentiment: Required. The predicted Sentiment for the sentence. + Possible values include: 'positive', 'neutral', 'negative' + :type sentiment: str or + ~azure.cognitiveservices.language.textanalytics.models.SentenceSentimentValue + :param confidence_scores: Required. The sentiment confidence score between + 0 and 1 for the sentence for all classes. + :type confidence_scores: + ~azure.cognitiveservices.language.textanalytics.models.SentimentConfidenceScorePerLabel + :param offset: Required. The sentence offset from the start of the + document. + :type offset: int + :param length: Required. The length of the sentence. + :type length: int + :param aspects: The array of aspect object for the sentence. + :type aspects: + list[~azure.cognitiveservices.language.textanalytics.models.SentenceAspect] + :param opinions: The array of opinion object for the sentence. + :type opinions: + list[~azure.cognitiveservices.language.textanalytics.models.SentenceOpinion] + """ + + _validation = { + 'text': {'required': True}, + 'sentiment': {'required': True}, + 'confidence_scores': {'required': True}, + 'offset': {'required': True}, + 'length': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'sentiment': {'key': 'sentiment', 'type': 'SentenceSentimentValue'}, + 'confidence_scores': {'key': 'confidenceScores', 'type': 'SentimentConfidenceScorePerLabel'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + 'aspects': {'key': 'aspects', 'type': '[SentenceAspect]'}, + 'opinions': {'key': 'opinions', 'type': '[SentenceOpinion]'}, + } + + def __init__(self, *, text: str, sentiment, confidence_scores, offset: int, length: int, aspects=None, opinions=None, **kwargs) -> None: + super(SentenceSentiment, self).__init__(**kwargs) + self.text = text + self.sentiment = sentiment + self.confidence_scores = confidence_scores + self.offset = offset + self.length = length + self.aspects = aspects + self.opinions = opinions + + +class SentimentConfidenceScorePerLabel(Model): + """Represents the confidence scores between 0 and 1 across all sentiment + classes: positive, neutral, negative. + + All required parameters must be populated in order to send to Azure. + + :param positive: Required. + :type positive: float + :param neutral: Required. + :type neutral: float + :param negative: Required. + :type negative: float + """ + + _validation = { + 'positive': {'required': True}, + 'neutral': {'required': True}, + 'negative': {'required': True}, + } + + _attribute_map = { + 'positive': {'key': 'positive', 'type': 'float'}, + 'neutral': {'key': 'neutral', 'type': 'float'}, + 'negative': {'key': 'negative', 'type': 'float'}, + } + + def __init__(self, *, positive: float, neutral: float, negative: float, **kwargs) -> None: + super(SentimentConfidenceScorePerLabel, self).__init__(**kwargs) + self.positive = positive + self.neutral = neutral + self.negative = negative + + +class SentimentResponse(Model): + """SentimentResponse. + + All required parameters must be populated in order to send to Azure. + + :param documents: Required. Sentiment analysis per document. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentSentiment] + :param errors: Required. Errors by document id. + :type errors: + list[~azure.cognitiveservices.language.textanalytics.models.DocumentError] + :param statistics: + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + :param model_version: Required. This field indicates which model is used + for scoring. + :type model_version: str + """ + + _validation = { + 'documents': {'required': True}, + 'errors': {'required': True}, + 'model_version': {'required': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[DocumentSentiment]'}, + 'errors': {'key': 'errors', 'type': '[DocumentError]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, + } + + def __init__(self, *, documents, errors, model_version: str, statistics=None, **kwargs) -> None: + super(SentimentResponse, self).__init__(**kwargs) + self.documents = documents + self.errors = errors + self.statistics = statistics + self.model_version = model_version + + +class TasksState(Model): + """TasksState. + + All required parameters must be populated in order to send to Azure. + + :param tasks: Required. + :type tasks: + ~azure.cognitiveservices.language.textanalytics.models.AnalyzeJobStateTasks + """ + + _validation = { + 'tasks': {'required': True}, + } + + _attribute_map = { + 'tasks': {'key': 'tasks', 'type': 'AnalyzeJobStateTasks'}, + } + + def __init__(self, *, tasks, **kwargs) -> None: + super(TasksState, self).__init__(**kwargs) + self.tasks = tasks + + +class TextAnalyticsError(Model): + """TextAnalyticsError. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code. Possible values include: + 'InvalidRequest', 'InvalidArgument', 'InternalServerError', + 'ServiceUnavailable', 'NotFound' + :type code: str or + ~azure.cognitiveservices.language.textanalytics.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.cognitiveservices.language.textanalytics.models.InnerError + :param details: Details about specific errors that led to this reported + error. + :type details: + list[~azure.cognitiveservices.language.textanalytics.models.TextAnalyticsError] + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'ErrorCodeValue'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'details': {'key': 'details', 'type': '[TextAnalyticsError]'}, + } + + def __init__(self, *, code, message: str, target: str=None, innererror=None, details=None, **kwargs) -> None: + super(TextAnalyticsError, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.innererror = innererror + self.details = details + + +class TextAnalyticsWarning(Model): + """TextAnalyticsWarning. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code. Possible values include: + 'LongWordsInDocument', 'DocumentTruncated' + :type code: str or + ~azure.cognitiveservices.language.textanalytics.models.WarningCodeValue + :param message: Required. Warning message. + :type message: str + :param target_ref: A JSON pointer reference indicating the target object. + :type target_ref: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target_ref': {'key': 'targetRef', 'type': 'str'}, + } + + def __init__(self, *, code, message: str, target_ref: str=None, **kwargs) -> None: + super(TextAnalyticsWarning, self).__init__(**kwargs) + self.code = code + self.message = message + self.target_ref = target_ref diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_text_analytics_client_enums.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_text_analytics_client_enums.py new file mode 100644 index 00000000000..d0070590a15 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_text_analytics_client_enums.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class StringIndexTypeResponse(str, Enum): + + text_elements_v8 = "TextElements_v8" #: Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo. + unicode_code_point = "UnicodeCodePoint" #: Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python. + utf16_code_unit = "Utf16CodeUnit" #: Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript. + + +class ErrorCodeValue(str, Enum): + + invalid_request = "InvalidRequest" + invalid_argument = "InvalidArgument" + internal_server_error = "InternalServerError" + service_unavailable = "ServiceUnavailable" + not_found = "NotFound" + + +class InnerErrorCodeValue(str, Enum): + + invalid_parameter_value = "InvalidParameterValue" + invalid_request_body_format = "InvalidRequestBodyFormat" + empty_request = "EmptyRequest" + missing_input_records = "MissingInputRecords" + invalid_document = "InvalidDocument" + model_version_incorrect = "ModelVersionIncorrect" + invalid_document_batch = "InvalidDocumentBatch" + unsupported_language_code = "UnsupportedLanguageCode" + invalid_country_hint = "InvalidCountryHint" + + +class WarningCodeValue(str, Enum): + + long_words_in_document = "LongWordsInDocument" + document_truncated = "DocumentTruncated" + + +class State(str, Enum): + + not_started = "notStarted" + running = "running" + succeeded = "succeeded" + failed = "failed" + cancelled = "cancelled" + cancelling = "cancelling" + partially_completed = "partiallyCompleted" + + +class DocumentSentimentValue(str, Enum): + + positive = "positive" + neutral = "neutral" + negative = "negative" + mixed = "mixed" + + +class SentenceSentimentValue(str, Enum): + + positive = "positive" + neutral = "neutral" + negative = "negative" + + +class TokenSentimentValue(str, Enum): + + positive = "positive" + mixed = "mixed" + negative = "negative" + + +class AspectRelationType(str, Enum): + + opinion = "opinion" + aspect = "aspect" + + +class StringIndexType(str, Enum): + + text_elements_v8 = "TextElements_v8" #: Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo. + unicode_code_point = "UnicodeCodePoint" #: Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python. + utf16_code_unit = "Utf16CodeUnit" #: Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript. diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py deleted file mode 100644 index 4741f83e264..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DetectedLanguage(Model): - """DetectedLanguage. - - :param name: Long name of a detected language (e.g. English, French). - :type name: str - :param iso6391_name: A two letter representation of the detected language - according to the ISO 639-1 standard (e.g. en, fr). - :type iso6391_name: str - :param score: A confidence score between 0 and 1. Scores close to 1 - indicate 100% certainty that the identified language is true. - :type score: float - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, - 'score': {'key': 'score', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(DetectedLanguage, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.iso6391_name = kwargs.get('iso6391_name', None) - self.score = kwargs.get('score', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language_py3.py deleted file mode 100644 index 87824c274b5..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DetectedLanguage(Model): - """DetectedLanguage. - - :param name: Long name of a detected language (e.g. English, French). - :type name: str - :param iso6391_name: A two letter representation of the detected language - according to the ISO 639-1 standard (e.g. en, fr). - :type iso6391_name: str - :param score: A confidence score between 0 and 1. Scores close to 1 - indicate 100% certainty that the identified language is true. - :type score: float - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, - 'score': {'key': 'score', 'type': 'float'}, - } - - def __init__(self, *, name: str=None, iso6391_name: str=None, score: float=None, **kwargs) -> None: - super(DetectedLanguage, self).__init__(**kwargs) - self.name = name - self.iso6391_name = iso6391_name - self.score = score diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics.py deleted file mode 100644 index d1eb5f21f89..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DocumentStatistics(Model): - """DocumentStatistics. - - :param characters_count: Number of text elements recognized in the - document. - :type characters_count: int - :param transactions_count: Number of transactions for the document. - :type transactions_count: int - """ - - _attribute_map = { - 'characters_count': {'key': 'charactersCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(DocumentStatistics, self).__init__(**kwargs) - self.characters_count = kwargs.get('characters_count', None) - self.transactions_count = kwargs.get('transactions_count', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics_py3.py deleted file mode 100644 index 1b54590697d..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DocumentStatistics(Model): - """DocumentStatistics. - - :param characters_count: Number of text elements recognized in the - document. - :type characters_count: int - :param transactions_count: Number of transactions for the document. - :type transactions_count: int - """ - - _attribute_map = { - 'characters_count': {'key': 'charactersCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'int'}, - } - - def __init__(self, *, characters_count: int=None, transactions_count: int=None, **kwargs) -> None: - super(DocumentStatistics, self).__init__(**kwargs) - self.characters_count = characters_count - self.transactions_count = transactions_count diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result.py deleted file mode 100644 index b507c8eb712..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EntitiesBatchResult(Model): - """EntitiesBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs): - super(EntitiesBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item.py deleted file mode 100644 index e79c98b04f3..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EntitiesBatchResultItem(Model): - """EntitiesBatchResultItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: Unique, non-empty document identifier. - :type id: str - :ivar entities: Recognized entities in the document. - :vartype entities: - list[~azure.cognitiveservices.language.textanalytics.models.EntityRecord] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _validation = { - 'entities': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[EntityRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, **kwargs): - super(EntitiesBatchResultItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.entities = None - self.statistics = kwargs.get('statistics', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_py3.py deleted file mode 100644 index 57c68b4f7b2..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EntitiesBatchResultItem(Model): - """EntitiesBatchResultItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: Unique, non-empty document identifier. - :type id: str - :ivar entities: Recognized entities in the document. - :vartype entities: - list[~azure.cognitiveservices.language.textanalytics.models.EntityRecord] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _validation = { - 'entities': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[EntityRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, *, id: str=None, statistics=None, **kwargs) -> None: - super(EntitiesBatchResultItem, self).__init__(**kwargs) - self.id = id - self.entities = None - self.statistics = statistics diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_py3.py deleted file mode 100644 index 2f739f07316..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EntitiesBatchResult(Model): - """EntitiesBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs) -> None: - super(EntitiesBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py deleted file mode 100644 index ba979614227..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EntityRecord(Model): - """EntityRecord. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param name: Entity formal name. - :type name: str - :param matches: List of instances this entity appears in the text. - :type matches: - list[~azure.cognitiveservices.language.textanalytics.models.MatchRecord] - :param wikipedia_language: Wikipedia language for which the WikipediaId - and WikipediaUrl refers to. - :type wikipedia_language: str - :param wikipedia_id: Wikipedia unique identifier of the recognized entity. - :type wikipedia_id: str - :ivar wikipedia_url: URL for the entity's Wikipedia page. - :vartype wikipedia_url: str - :param bing_id: Bing unique identifier of the recognized entity. Use in - conjunction with the Bing Entity Search API to fetch additional relevant - information. - :type bing_id: str - :param type: Entity type from Named Entity Recognition model - :type type: str - :param sub_type: Entity sub type from Named Entity Recognition model - :type sub_type: str - """ - - _validation = { - 'wikipedia_url': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'matches': {'key': 'matches', 'type': '[MatchRecord]'}, - 'wikipedia_language': {'key': 'wikipediaLanguage', 'type': 'str'}, - 'wikipedia_id': {'key': 'wikipediaId', 'type': 'str'}, - 'wikipedia_url': {'key': 'wikipediaUrl', 'type': 'str'}, - 'bing_id': {'key': 'bingId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sub_type': {'key': 'subType', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EntityRecord, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.matches = kwargs.get('matches', None) - self.wikipedia_language = kwargs.get('wikipedia_language', None) - self.wikipedia_id = kwargs.get('wikipedia_id', None) - self.wikipedia_url = None - self.bing_id = kwargs.get('bing_id', None) - self.type = kwargs.get('type', None) - self.sub_type = kwargs.get('sub_type', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_py3.py deleted file mode 100644 index a857d52fa3c..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EntityRecord(Model): - """EntityRecord. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param name: Entity formal name. - :type name: str - :param matches: List of instances this entity appears in the text. - :type matches: - list[~azure.cognitiveservices.language.textanalytics.models.MatchRecord] - :param wikipedia_language: Wikipedia language for which the WikipediaId - and WikipediaUrl refers to. - :type wikipedia_language: str - :param wikipedia_id: Wikipedia unique identifier of the recognized entity. - :type wikipedia_id: str - :ivar wikipedia_url: URL for the entity's Wikipedia page. - :vartype wikipedia_url: str - :param bing_id: Bing unique identifier of the recognized entity. Use in - conjunction with the Bing Entity Search API to fetch additional relevant - information. - :type bing_id: str - :param type: Entity type from Named Entity Recognition model - :type type: str - :param sub_type: Entity sub type from Named Entity Recognition model - :type sub_type: str - """ - - _validation = { - 'wikipedia_url': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'matches': {'key': 'matches', 'type': '[MatchRecord]'}, - 'wikipedia_language': {'key': 'wikipediaLanguage', 'type': 'str'}, - 'wikipedia_id': {'key': 'wikipediaId', 'type': 'str'}, - 'wikipedia_url': {'key': 'wikipediaUrl', 'type': 'str'}, - 'bing_id': {'key': 'bingId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sub_type': {'key': 'subType', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, matches=None, wikipedia_language: str=None, wikipedia_id: str=None, bing_id: str=None, type: str=None, sub_type: str=None, **kwargs) -> None: - super(EntityRecord, self).__init__(**kwargs) - self.name = name - self.matches = matches - self.wikipedia_language = wikipedia_language - self.wikipedia_id = wikipedia_id - self.wikipedia_url = None - self.bing_id = bing_id - self.type = type - self.sub_type = sub_type diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py deleted file mode 100644 index 22283996cab..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ErrorRecord(Model): - """ErrorRecord. - - :param id: Input document unique identifier the error refers to. - :type id: str - :param message: Error message. - :type message: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorRecord, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.message = kwargs.get('message', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record_py3.py deleted file mode 100644 index 3ddcbca03f2..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ErrorRecord(Model): - """ErrorRecord. - - :param id: Input document unique identifier the error refers to. - :type id: str - :param message: Error message. - :type message: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, message: str=None, **kwargs) -> None: - super(ErrorRecord, self).__init__(**kwargs) - self.id = id - self.message = message diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py deleted file mode 100644 index 3a0197f190f..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """ErrorResponse. - - :param code: - :type code: str - :param message: - :type message: str - :param target: - :type target: str - :param inner_error: - :type inner_error: - ~azure.cognitiveservices.language.textanalytics.models.InternalError - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.inner_error = kwargs.get('inner_error', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response_py3.py deleted file mode 100644 index 92d27200024..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """ErrorResponse. - - :param code: - :type code: str - :param message: - :type message: str - :param target: - :type target: str - :param inner_error: - :type inner_error: - ~azure.cognitiveservices.language.textanalytics.models.InternalError - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, - } - - def __init__(self, *, code: str=None, message: str=None, target: str=None, inner_error=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.inner_error = inner_error - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py deleted file mode 100644 index 1b40432d6d2..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InternalError(Model): - """InternalError. - - :param code: - :type code: str - :param message: - :type message: str - :param inner_error: - :type inner_error: - ~azure.cognitiveservices.language.textanalytics.models.InternalError - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, - } - - def __init__(self, **kwargs): - super(InternalError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.inner_error = kwargs.get('inner_error', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error_py3.py deleted file mode 100644 index db1299ef21d..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InternalError(Model): - """InternalError. - - :param code: - :type code: str - :param message: - :type message: str - :param inner_error: - :type inner_error: - ~azure.cognitiveservices.language.textanalytics.models.InternalError - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, - } - - def __init__(self, *, code: str=None, message: str=None, inner_error=None, **kwargs) -> None: - super(InternalError, self).__init__(**kwargs) - self.code = code - self.message = message - self.inner_error = inner_error diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py deleted file mode 100644 index c266bdc98a8..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class KeyPhraseBatchResult(Model): - """KeyPhraseBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: =(Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[KeyPhraseBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs): - super(KeyPhraseBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py deleted file mode 100644 index 622b6a4e996..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class KeyPhraseBatchResultItem(Model): - """KeyPhraseBatchResultItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: Unique, non-empty document identifier. - :type id: str - :ivar key_phrases: A list of representative words or phrases. The number - of key phrases returned is proportional to the number of words in the - input document. - :vartype key_phrases: list[str] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _validation = { - 'key_phrases': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, **kwargs): - super(KeyPhraseBatchResultItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.key_phrases = None - self.statistics = kwargs.get('statistics', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item_py3.py deleted file mode 100644 index 0571d654739..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class KeyPhraseBatchResultItem(Model): - """KeyPhraseBatchResultItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: Unique, non-empty document identifier. - :type id: str - :ivar key_phrases: A list of representative words or phrases. The number - of key phrases returned is proportional to the number of words in the - input document. - :vartype key_phrases: list[str] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _validation = { - 'key_phrases': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, *, id: str=None, statistics=None, **kwargs) -> None: - super(KeyPhraseBatchResultItem, self).__init__(**kwargs) - self.id = id - self.key_phrases = None - self.statistics = statistics diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_py3.py deleted file mode 100644 index c8f5219dc6a..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class KeyPhraseBatchResult(Model): - """KeyPhraseBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: =(Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[KeyPhraseBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs) -> None: - super(KeyPhraseBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input.py deleted file mode 100644 index d9471a2aa72..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class LanguageBatchInput(Model): - """LanguageBatchInput. - - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.LanguageInput] - """ - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[LanguageInput]'}, - } - - def __init__(self, **kwargs): - super(LanguageBatchInput, self).__init__(**kwargs) - self.documents = kwargs.get('documents', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input_py3.py deleted file mode 100644 index 6e6a757b96a..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class LanguageBatchInput(Model): - """LanguageBatchInput. - - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.LanguageInput] - """ - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[LanguageInput]'}, - } - - def __init__(self, *, documents=None, **kwargs) -> None: - super(LanguageBatchInput, self).__init__(**kwargs) - self.documents = documents diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py deleted file mode 100644 index 23204992ed6..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class LanguageBatchResult(Model): - """LanguageBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.LanguageBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[LanguageBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs): - super(LanguageBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py deleted file mode 100644 index ef5a17f0132..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class LanguageBatchResultItem(Model): - """LanguageBatchResultItem. - - :param id: Unique, non-empty document identifier. - :type id: str - :param detected_languages: A list of extracted languages. - :type detected_languages: - list[~azure.cognitiveservices.language.textanalytics.models.DetectedLanguage] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'detected_languages': {'key': 'detectedLanguages', 'type': '[DetectedLanguage]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, **kwargs): - super(LanguageBatchResultItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.detected_languages = kwargs.get('detected_languages', None) - self.statistics = kwargs.get('statistics', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item_py3.py deleted file mode 100644 index 3d3c499aeea..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class LanguageBatchResultItem(Model): - """LanguageBatchResultItem. - - :param id: Unique, non-empty document identifier. - :type id: str - :param detected_languages: A list of extracted languages. - :type detected_languages: - list[~azure.cognitiveservices.language.textanalytics.models.DetectedLanguage] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'detected_languages': {'key': 'detectedLanguages', 'type': '[DetectedLanguage]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, *, id: str=None, detected_languages=None, statistics=None, **kwargs) -> None: - super(LanguageBatchResultItem, self).__init__(**kwargs) - self.id = id - self.detected_languages = detected_languages - self.statistics = statistics diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_py3.py deleted file mode 100644 index 7abe7d1b7bb..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class LanguageBatchResult(Model): - """LanguageBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.LanguageBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[LanguageBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs) -> None: - super(LanguageBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input.py deleted file mode 100644 index d79347938d7..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class LanguageInput(Model): - """LanguageInput. - - :param country_hint: - :type country_hint: str - :param id: Unique, non-empty document identifier. - :type id: str - :param text: - :type text: str - """ - - _attribute_map = { - 'country_hint': {'key': 'countryHint', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LanguageInput, self).__init__(**kwargs) - self.country_hint = kwargs.get('country_hint', None) - self.id = kwargs.get('id', None) - self.text = kwargs.get('text', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input_py3.py deleted file mode 100644 index 2cc72da091b..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class LanguageInput(Model): - """LanguageInput. - - :param country_hint: - :type country_hint: str - :param id: Unique, non-empty document identifier. - :type id: str - :param text: - :type text: str - """ - - _attribute_map = { - 'country_hint': {'key': 'countryHint', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - } - - def __init__(self, *, country_hint: str=None, id: str=None, text: str=None, **kwargs) -> None: - super(LanguageInput, self).__init__(**kwargs) - self.country_hint = country_hint - self.id = id - self.text = text diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record.py deleted file mode 100644 index 8ca1d6e5d7f..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MatchRecord(Model): - """MatchRecord. - - :param wikipedia_score: (optional) If a well-known item with Wikipedia - link is recognized, a decimal number denoting the confidence level of the - Wikipedia info will be returned. - :type wikipedia_score: float - :param entity_type_score: (optional) If an entity type is recognized, a - decimal number denoting the confidence level of the entity type will be - returned. - :type entity_type_score: float - :param text: Entity text as appears in the request. - :type text: str - :param offset: Start position (in Unicode characters) for the entity match - text. - :type offset: int - :param length: Length (in Unicode characters) for the entity match text. - :type length: int - """ - - _attribute_map = { - 'wikipedia_score': {'key': 'wikipediaScore', 'type': 'float'}, - 'entity_type_score': {'key': 'entityTypeScore', 'type': 'float'}, - 'text': {'key': 'text', 'type': 'str'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(MatchRecord, self).__init__(**kwargs) - self.wikipedia_score = kwargs.get('wikipedia_score', None) - self.entity_type_score = kwargs.get('entity_type_score', None) - self.text = kwargs.get('text', None) - self.offset = kwargs.get('offset', None) - self.length = kwargs.get('length', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py deleted file mode 100644 index 49995a79c23..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MatchRecord(Model): - """MatchRecord. - - :param wikipedia_score: (optional) If a well-known item with Wikipedia - link is recognized, a decimal number denoting the confidence level of the - Wikipedia info will be returned. - :type wikipedia_score: float - :param entity_type_score: (optional) If an entity type is recognized, a - decimal number denoting the confidence level of the entity type will be - returned. - :type entity_type_score: float - :param text: Entity text as appears in the request. - :type text: str - :param offset: Start position (in Unicode characters) for the entity match - text. - :type offset: int - :param length: Length (in Unicode characters) for the entity match text. - :type length: int - """ - - _attribute_map = { - 'wikipedia_score': {'key': 'wikipediaScore', 'type': 'float'}, - 'entity_type_score': {'key': 'entityTypeScore', 'type': 'float'}, - 'text': {'key': 'text', 'type': 'str'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - } - - def __init__(self, *, wikipedia_score: float=None, entity_type_score: float=None, text: str=None, offset: int=None, length: int=None, **kwargs) -> None: - super(MatchRecord, self).__init__(**kwargs) - self.wikipedia_score = wikipedia_score - self.entity_type_score = entity_type_score - self.text = text - self.offset = offset - self.length = length diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py deleted file mode 100644 index 8c9c5d313a6..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MultiLanguageBatchInput(Model): - """MultiLanguageBatchInput. - - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] - """ - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, - } - - def __init__(self, **kwargs): - super(MultiLanguageBatchInput, self).__init__(**kwargs) - self.documents = kwargs.get('documents', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input_py3.py deleted file mode 100644 index cbacf2d992f..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MultiLanguageBatchInput(Model): - """MultiLanguageBatchInput. - - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] - """ - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, - } - - def __init__(self, *, documents=None, **kwargs) -> None: - super(MultiLanguageBatchInput, self).__init__(**kwargs) - self.documents = documents diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py deleted file mode 100644 index da37a13ce08..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MultiLanguageInput(Model): - """MultiLanguageInput. - - :param language: This is the 2 letter ISO 639-1 representation of a - language. For example, use "en" for English; "es" for Spanish etc., - :type language: str - :param id: Unique, non-empty document identifier. - :type id: str - :param text: - :type text: str - """ - - _attribute_map = { - 'language': {'key': 'language', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MultiLanguageInput, self).__init__(**kwargs) - self.language = kwargs.get('language', None) - self.id = kwargs.get('id', None) - self.text = kwargs.get('text', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input_py3.py deleted file mode 100644 index bd81650513d..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MultiLanguageInput(Model): - """MultiLanguageInput. - - :param language: This is the 2 letter ISO 639-1 representation of a - language. For example, use "en" for English; "es" for Spanish etc., - :type language: str - :param id: Unique, non-empty document identifier. - :type id: str - :param text: - :type text: str - """ - - _attribute_map = { - 'language': {'key': 'language', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - } - - def __init__(self, *, language: str=None, id: str=None, text: str=None, **kwargs) -> None: - super(MultiLanguageInput, self).__init__(**kwargs) - self.language = language - self.id = id - self.text = text diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics.py deleted file mode 100644 index b8cc2657523..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class RequestStatistics(Model): - """RequestStatistics. - - :param documents_count: Number of documents submitted in the request. - :type documents_count: int - :param valid_documents_count: Number of valid documents. This excludes - empty, over-size limit or non-supported languages documents. - :type valid_documents_count: int - :param erroneous_documents_count: Number of invalid documents. This - includes empty, over-size limit or non-supported languages documents. - :type erroneous_documents_count: int - :param transactions_count: Number of transactions for the request. - :type transactions_count: long - """ - - _attribute_map = { - 'documents_count': {'key': 'documentsCount', 'type': 'int'}, - 'valid_documents_count': {'key': 'validDocumentsCount', 'type': 'int'}, - 'erroneous_documents_count': {'key': 'erroneousDocumentsCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'long'}, - } - - def __init__(self, **kwargs): - super(RequestStatistics, self).__init__(**kwargs) - self.documents_count = kwargs.get('documents_count', None) - self.valid_documents_count = kwargs.get('valid_documents_count', None) - self.erroneous_documents_count = kwargs.get('erroneous_documents_count', None) - self.transactions_count = kwargs.get('transactions_count', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics_py3.py deleted file mode 100644 index c93b32bba4c..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class RequestStatistics(Model): - """RequestStatistics. - - :param documents_count: Number of documents submitted in the request. - :type documents_count: int - :param valid_documents_count: Number of valid documents. This excludes - empty, over-size limit or non-supported languages documents. - :type valid_documents_count: int - :param erroneous_documents_count: Number of invalid documents. This - includes empty, over-size limit or non-supported languages documents. - :type erroneous_documents_count: int - :param transactions_count: Number of transactions for the request. - :type transactions_count: long - """ - - _attribute_map = { - 'documents_count': {'key': 'documentsCount', 'type': 'int'}, - 'valid_documents_count': {'key': 'validDocumentsCount', 'type': 'int'}, - 'erroneous_documents_count': {'key': 'erroneousDocumentsCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'long'}, - } - - def __init__(self, *, documents_count: int=None, valid_documents_count: int=None, erroneous_documents_count: int=None, transactions_count: int=None, **kwargs) -> None: - super(RequestStatistics, self).__init__(**kwargs) - self.documents_count = documents_count - self.valid_documents_count = valid_documents_count - self.erroneous_documents_count = erroneous_documents_count - self.transactions_count = transactions_count diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py deleted file mode 100644 index 7fb12b8178b..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SentimentBatchResult(Model): - """SentimentBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.SentimentBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[SentimentBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs): - super(SentimentBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py deleted file mode 100644 index 731682c6332..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SentimentBatchResultItem(Model): - """SentimentBatchResultItem. - - :param id: Unique, non-empty document identifier. - :type id: str - :param score: A decimal number between 0 and 1 denoting the sentiment of - the document. A score above 0.7 usually refers to a positive document - while a score below 0.3 normally has a negative connotation. Mid values - refer to neutral text. - :type score: float - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'score': {'key': 'score', 'type': 'float'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, **kwargs): - super(SentimentBatchResultItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.score = kwargs.get('score', None) - self.statistics = kwargs.get('statistics', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item_py3.py deleted file mode 100644 index c8acccf078c..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SentimentBatchResultItem(Model): - """SentimentBatchResultItem. - - :param id: Unique, non-empty document identifier. - :type id: str - :param score: A decimal number between 0 and 1 denoting the sentiment of - the document. A score above 0.7 usually refers to a positive document - while a score below 0.3 normally has a negative connotation. Mid values - refer to neutral text. - :type score: float - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'score': {'key': 'score', 'type': 'float'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, *, id: str=None, score: float=None, statistics=None, **kwargs) -> None: - super(SentimentBatchResultItem, self).__init__(**kwargs) - self.id = id - self.score = score - self.statistics = statistics diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_py3.py deleted file mode 100644 index 33acf655a97..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SentimentBatchResult(Model): - """SentimentBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.SentimentBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[SentimentBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs) -> None: - super(SentimentBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/__init__.py new file mode 100644 index 00000000000..e87e22b4936 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._text_analytics_client_operations import TextAnalyticsClientOperationsMixin + +__all__ = [ + 'TextAnalyticsClientOperationsMixin', +] diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/_text_analytics_client_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/_text_analytics_client_operations.py new file mode 100644 index 00000000000..275b4a678cf --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/_text_analytics_client_operations.py @@ -0,0 +1,908 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse +from msrest.exceptions import HttpOperationError +from .. import models + + +class TextAnalyticsClientOperationsMixin(object): + + def analyze( + self, body=None, custom_headers=None, raw=False, **operation_config): + """Submit analysis job. + + Submit a collection of text documents for analysis. Specify one or more + unique tasks to be executed. + + :param body: Collection of documents to analyze and tasks to execute. + :type body: + ~azure.cognitiveservices.language.textanalytics.models.AnalyzeBatchInput + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ErrorResponse or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.textanalytics.models.ErrorResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.analyze.metadata['url'] + 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 = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'AnalyzeBatchInput') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 400, 500]: + raise HttpOperationError(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + header_dict = { + 'Operation-Location': 'str', + } + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + header_dict = { + 'Operation-Location': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + analyze.metadata = {'url': '/analyze'} + + def analyze_status( + self, job_id, show_stats=None, top=20, skip=0, custom_headers=None, raw=False, **operation_config): + """Get analysis status and results. + + Get the status of an analysis job. A job may consist of one or more + tasks. Once all tasks are completed, the job will transition to the + completed state and results will be available for each task. + + :param job_id: Job ID + :type job_id: str + :param show_stats: (Optional) if set to true, response will contain + request and document level statistics. + :type show_stats: bool + :param top: (Optional) Set the maximum number of results per task. + When both $top and $skip are specified, $skip is applied first. + :type top: int + :param skip: (Optional) Set the number of elements to offset in the + response. When both $top and $skip are specified, $skip is applied + first. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.analyze_status.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'jobId': self._serialize.url("job_id", job_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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 = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404, 500]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AnalyzeJobState', response) + if response.status_code == 404: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + analyze_status.metadata = {'url': '/analyze/jobs/{jobId}'} + + def health_status( + self, job_id, top=20, skip=0, show_stats=None, custom_headers=None, raw=False, **operation_config): + """Get healthcare analysis job status and results. + + Get details of the healthcare prediction job specified by the jobId. + + :param job_id: Job ID + :type job_id: str + :param top: (Optional) Set the maximum number of results per task. + When both $top and $skip are specified, $skip is applied first. + :type top: int + :param skip: (Optional) Set the number of elements to offset in the + response. When both $top and $skip are specified, $skip is applied + first. + :type skip: int + :param show_stats: (Optional) if set to true, response will contain + request and document level statistics. + :type show_stats: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.health_status.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'jobId': self._serialize.url("job_id", job_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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 = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404, 500]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HealthcareJobState', response) + if response.status_code == 404: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + health_status.metadata = {'url': '/entities/health/jobs/{jobId}'} + + def cancel_health_job( + self, job_id, custom_headers=None, raw=False, **operation_config): + """Cancel healthcare prediction job. + + Cancel healthcare prediction job. + + :param job_id: Job ID + :type job_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ErrorResponse or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.textanalytics.models.ErrorResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.cancel_health_job.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'jobId': self._serialize.url("job_id", job_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 404, 500]: + raise HttpOperationError(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 404: + deserialized = self._deserialize('ErrorResponse', response) + header_dict = { + 'Operation-Location': 'str', + } + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + header_dict = { + 'Operation-Location': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + cancel_health_job.metadata = {'url': '/entities/health/jobs/{jobId}'} + + def health( + self, documents, model_version=None, string_index_type="TextElements_v8", custom_headers=None, raw=False, **operation_config): + """Submit healthcare analysis job. + + Start a healthcare analysis job to recognize healthcare related + entities (drugs, conditions, symptoms, etc) and their relations. + + :param documents: The set of documents to process as part of this + batch. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + :param model_version: (Optional) This value indicates which model will + be used for scoring. If a model-version is not specified, the API + should default to the latest, non-preview version. + :type model_version: str + :param string_index_type: (Optional) Specifies the method used to + interpret string offsets. Defaults to Text Elements (Graphemes) + according to Unicode v8.0.0. For additional information see + https://aka.ms/text-analytics-offsets. Possible values include: + 'TextElements_v8', 'UnicodeCodePoint', 'Utf16CodeUnit' + :type string_index_type: str or + ~azure.cognitiveservices.language.textanalytics.models.StringIndexType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ErrorResponse or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.textanalytics.models.ErrorResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + input = models.MultiLanguageBatchInput(documents=documents) + + # Construct URL + url = self.health.metadata['url'] + 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 = {} + if model_version is not None: + query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') + if string_index_type is not None: + query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(input, 'MultiLanguageBatchInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 400, 500]: + raise HttpOperationError(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + header_dict = { + 'Operation-Location': 'str', + } + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + header_dict = { + 'Operation-Location': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + health.metadata = {'url': '/entities/health/jobs'} + + def entities_recognition_general( + self, documents, model_version=None, show_stats=None, string_index_type="TextElements_v8", custom_headers=None, raw=False, **operation_config): + """Named Entity Recognition. + + The API returns a list of general named entities in a given document. + For the list of supported entity types, check Supported Entity Types in Text Analytics + API. See the Supported languages + in Text Analytics API for the list of enabled languages. + + :param documents: The set of documents to process as part of this + batch. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + :param model_version: (Optional) This value indicates which model will + be used for scoring. If a model-version is not specified, the API + should default to the latest, non-preview version. + :type model_version: str + :param show_stats: (Optional) if set to true, response will contain + request and document level statistics. + :type show_stats: bool + :param string_index_type: (Optional) Specifies the method used to + interpret string offsets. Defaults to Text Elements (Graphemes) + according to Unicode v8.0.0. For additional information see + https://aka.ms/text-analytics-offsets. Possible values include: + 'TextElements_v8', 'UnicodeCodePoint', 'Utf16CodeUnit' + :type string_index_type: str or + ~azure.cognitiveservices.language.textanalytics.models.StringIndexType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + input = models.MultiLanguageBatchInput(documents=documents) + + # Construct URL + url = self.entities_recognition_general.metadata['url'] + 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 = {} + if model_version is not None: + query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') + if string_index_type is not None: + query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(input, 'MultiLanguageBatchInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 500]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EntitiesResult', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + entities_recognition_general.metadata = {'url': '/entities/recognition/general'} + + def entities_recognition_pii( + self, documents, model_version=None, show_stats=None, domain=None, string_index_type="TextElements_v8", custom_headers=None, raw=False, **operation_config): + """Entities containing personal information. + + The API returns a list of entities with personal information (\"SSN\", + \"Bank Account\" etc) in the document. For the list of supported entity + types, check Supported Entity Types + in Text Analytics API. See the Supported languages in Text Analytics + API for the list of enabled languages. + . + + :param documents: The set of documents to process as part of this + batch. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + :param model_version: (Optional) This value indicates which model will + be used for scoring. If a model-version is not specified, the API + should default to the latest, non-preview version. + :type model_version: str + :param show_stats: (Optional) if set to true, response will contain + request and document level statistics. + :type show_stats: bool + :param domain: (Optional) if specified, will set the PII domain to + include only a subset of the entity categories. Possible values + include: 'PHI', 'none'. + :type domain: str + :param string_index_type: (Optional) Specifies the method used to + interpret string offsets. Defaults to Text Elements (Graphemes) + according to Unicode v8.0.0. For additional information see + https://aka.ms/text-analytics-offsets. Possible values include: + 'TextElements_v8', 'UnicodeCodePoint', 'Utf16CodeUnit' + :type string_index_type: str or + ~azure.cognitiveservices.language.textanalytics.models.StringIndexType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + input = models.MultiLanguageBatchInput(documents=documents) + + # Construct URL + url = self.entities_recognition_pii.metadata['url'] + 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 = {} + if model_version is not None: + query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') + if domain is not None: + query_parameters['domain'] = self._serialize.query("domain", domain, 'str') + if string_index_type is not None: + query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(input, 'MultiLanguageBatchInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 500]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PiiResult', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + entities_recognition_pii.metadata = {'url': '/entities/recognition/pii'} + + def entities_linking( + self, documents, model_version=None, show_stats=None, string_index_type="TextElements_v8", custom_headers=None, raw=False, **operation_config): + """Linked entities from a well-known knowledge base. + + The API returns a list of recognized entities with links to a + well-known knowledge base. See the Supported languages in Text Analytics + API for the list of enabled languages. + + :param documents: The set of documents to process as part of this + batch. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + :param model_version: (Optional) This value indicates which model will + be used for scoring. If a model-version is not specified, the API + should default to the latest, non-preview version. + :type model_version: str + :param show_stats: (Optional) if set to true, response will contain + request and document level statistics. + :type show_stats: bool + :param string_index_type: (Optional) Specifies the method used to + interpret string offsets. Defaults to Text Elements (Graphemes) + according to Unicode v8.0.0. For additional information see + https://aka.ms/text-analytics-offsets. Possible values include: + 'TextElements_v8', 'UnicodeCodePoint', 'Utf16CodeUnit' + :type string_index_type: str or + ~azure.cognitiveservices.language.textanalytics.models.StringIndexType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + input = models.MultiLanguageBatchInput(documents=documents) + + # Construct URL + url = self.entities_linking.metadata['url'] + 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 = {} + if model_version is not None: + query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') + if string_index_type is not None: + query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(input, 'MultiLanguageBatchInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 500]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EntityLinkingResult', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + entities_linking.metadata = {'url': '/entities/linking'} + + def key_phrases( + self, documents, model_version=None, show_stats=None, custom_headers=None, raw=False, **operation_config): + """Key Phrases. + + The API returns a list of strings denoting the key phrases in the input + text. See the Supported languages in + Text Analytics API for the list of enabled languages. + + :param documents: The set of documents to process as part of this + batch. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + :param model_version: (Optional) This value indicates which model will + be used for scoring. If a model-version is not specified, the API + should default to the latest, non-preview version. + :type model_version: str + :param show_stats: (Optional) if set to true, response will contain + request and document level statistics. + :type show_stats: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + input = models.MultiLanguageBatchInput(documents=documents) + + # Construct URL + url = self.key_phrases.metadata['url'] + 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 = {} + 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 = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(input, 'MultiLanguageBatchInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 500]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('KeyPhraseResult', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + key_phrases.metadata = {'url': '/keyPhrases'} + + def languages( + self, documents, model_version=None, show_stats=None, custom_headers=None, raw=False, **operation_config): + """Detect Language. + + The API returns the detected language and a numeric score between 0 and + 1. Scores close to 1 indicate 100% certainty that the identified + language is true. See the Supported + languages in Text Analytics API for the list of enabled languages. + + :param documents: + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.LanguageInput] + :param model_version: (Optional) This value indicates which model will + be used for scoring. If a model-version is not specified, the API + should default to the latest, non-preview version. + :type model_version: str + :param show_stats: (Optional) if set to true, response will contain + request and document level statistics. + :type show_stats: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + input = models.LanguageBatchInput(documents=documents) + + # Construct URL + url = self.languages.metadata['url'] + 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 = {} + 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 = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(input, 'LanguageBatchInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 500]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LanguageResult', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + languages.metadata = {'url': '/languages'} + + def sentiment( + self, documents, model_version=None, show_stats=None, opinion_mining=None, string_index_type="TextElements_v8", custom_headers=None, raw=False, **operation_config): + """Sentiment. + + The API returns a detailed sentiment analysis for the input text. The + analysis is done in multiple levels of granularity, start from the a + document level, down to sentence and key terms (aspects) and opinions. + + :param documents: The set of documents to process as part of this + batch. + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + :param model_version: (Optional) This value indicates which model will + be used for scoring. If a model-version is not specified, the API + should default to the latest, non-preview version. + :type model_version: str + :param show_stats: (Optional) if set to true, response will contain + request and document level statistics. + :type show_stats: bool + :param opinion_mining: (Optional) if set to true, response will + contain input and document level statistics including aspect-based + sentiment analysis results. + :type opinion_mining: bool + :param string_index_type: (Optional) Specifies the method used to + interpret string offsets. Defaults to Text Elements (Graphemes) + according to Unicode v8.0.0. For additional information see + https://aka.ms/text-analytics-offsets. Possible values include: + 'TextElements_v8', 'UnicodeCodePoint', 'Utf16CodeUnit' + :type string_index_type: str or + ~azure.cognitiveservices.language.textanalytics.models.StringIndexType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + input = models.MultiLanguageBatchInput(documents=documents) + + # Construct URL + url = self.sentiment.metadata['url'] + 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 = {} + if model_version is not None: + query_parameters['model-version'] = self._serialize.query("model_version", model_version, 'str') + if show_stats is not None: + query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') + if opinion_mining is not None: + query_parameters['opinionMining'] = self._serialize.query("opinion_mining", opinion_mining, 'bool') + if string_index_type is not None: + query_parameters['stringIndexType'] = self._serialize.query("string_index_type", string_index_type, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(input, 'MultiLanguageBatchInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 500]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SentimentResponse', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + sentiment.metadata = {'url': '/sentiment'} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_client.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_client.py deleted file mode 100644 index 76dacf5ef41..00000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_client.py +++ /dev/null @@ -1,377 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.service_client import SDKClient -from msrest import Configuration, Serializer, Deserializer -from .version import VERSION -from msrest.pipeline import ClientRawResponse -from msrest.exceptions import HttpOperationError -from . import models - - -class TextAnalyticsClientConfiguration(Configuration): - """Configuration for TextAnalyticsClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Supported Cognitive Services endpoints (protocol and - hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - :param credentials: Subscription credentials which uniquely identify - client subscription. - :type credentials: None - """ - - def __init__( - self, endpoint, credentials): - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - base_url = '{Endpoint}/text/analytics/v2.1' - - super(TextAnalyticsClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-cognitiveservices-language-textanalytics/{}'.format(VERSION)) - - self.endpoint = endpoint - self.credentials = credentials - - -class TextAnalyticsClient(SDKClient): - """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 - - :ivar config: Configuration for client. - :vartype config: TextAnalyticsClientConfiguration - - :param endpoint: Supported Cognitive Services endpoints (protocol and - hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - :param credentials: Subscription credentials which uniquely identify - client subscription. - :type credentials: None - """ - - def __init__( - self, endpoint, credentials): - - self.config = TextAnalyticsClientConfiguration(endpoint, credentials) - super(TextAnalyticsClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = 'v2.1' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - - def detect_language( - self, show_stats=None, documents=None, custom_headers=None, raw=False, **operation_config): - """The API returns the detected language and a numeric score between 0 and - 1. - - Scores close to 1 indicate 100% certainty that the identified language - is true. A total of 120 languages are supported. - - :param show_stats: (optional) if set to true, response will contain - input and document level statistics. - :type show_stats: bool - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.LanguageInput] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: LanguageBatchResult or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.textanalytics.models.LanguageBatchResult - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - language_batch_input = None - if documents is not None: - language_batch_input = models.LanguageBatchInput(documents=documents) - - # Construct URL - url = self.detect_language.metadata['url'] - 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 = {} - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - if language_batch_input is not None: - body_content = self._serialize.body(language_batch_input, 'LanguageBatchInput') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('LanguageBatchResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - detect_language.metadata = {'url': '/languages'} - - def entities( - self, show_stats=None, documents=None, custom_headers=None, raw=False, **operation_config): - """The API returns a list of recognized entities in a given document. - - To get even more information on each recognized entity we recommend - using the Bing Entity Search API by querying for the recognized - entities names. See the Supported - languages in Text Analytics API for the list of enabled languages. - - :param show_stats: (optional) if set to true, response will contain - input and document level statistics. - :type show_stats: bool - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: EntitiesBatchResult or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResult - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - multi_language_batch_input = None - if documents is not None: - multi_language_batch_input = models.MultiLanguageBatchInput(documents=documents) - - # Construct URL - url = self.entities.metadata['url'] - 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 = {} - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - if multi_language_batch_input is not None: - body_content = self._serialize.body(multi_language_batch_input, 'MultiLanguageBatchInput') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('EntitiesBatchResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - entities.metadata = {'url': '/entities'} - - def key_phrases( - self, show_stats=None, documents=None, custom_headers=None, raw=False, **operation_config): - """The API returns a list of strings denoting the key talking points in - the input text. - - See the Text - Analytics Documentation for details about the languages that are - supported by key phrase extraction. - - :param show_stats: (optional) if set to true, response will contain - input and document level statistics. - :type show_stats: bool - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: KeyPhraseBatchResult or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResult - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - multi_language_batch_input = None - if documents is not None: - multi_language_batch_input = models.MultiLanguageBatchInput(documents=documents) - - # Construct URL - url = self.key_phrases.metadata['url'] - 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 = {} - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - if multi_language_batch_input is not None: - body_content = self._serialize.body(multi_language_batch_input, 'MultiLanguageBatchInput') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('KeyPhraseBatchResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - key_phrases.metadata = {'url': '/keyPhrases'} - - def sentiment( - self, show_stats=None, documents=None, custom_headers=None, raw=False, **operation_config): - """The API returns a numeric score between 0 and 1. - - Scores close to 1 indicate positive sentiment, while scores close to 0 - indicate negative sentiment. A score of 0.5 indicates the lack of - sentiment (e.g. a factoid statement). See the Text - Analytics Documentation for details about the languages that are - supported by sentiment analysis. - - :param show_stats: (optional) if set to true, response will contain - input and document level statistics. - :type show_stats: bool - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - multi_language_batch_input = None - if documents is not None: - multi_language_batch_input = models.MultiLanguageBatchInput(documents=documents) - - # Construct URL - url = self.sentiment.metadata['url'] - 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 = {} - if show_stats is not None: - query_parameters['showStats'] = self._serialize.query("show_stats", show_stats, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - if multi_language_batch_input is not None: - body_content = self._serialize.body(multi_language_batch_input, 'MultiLanguageBatchInput') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 500]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SentimentBatchResult', response) - if response.status_code == 500: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - sentiment.metadata = {'url': '/sentiment'} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/setup.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/setup.py index d0fbeeeab93..8bf52f6a2ef 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/setup.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -67,6 +69,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False,