Skip to content

Commit 670d0aa

Browse files
author
SDK Automation
committed
Update from release/v3
1 parent 52bdd94 commit 670d0aa

Some content is hidden

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

50 files changed

+1436
-1849
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1-
## Microsoft Azure SDK for Python
1+
# Microsoft Azure SDK for Python
22

3-
**NOTE:** If you are looking for the new, preview version of Azure Text
4-
Analytics, please see
5-
[azure-ai-textanalytics](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/textanalytics/azure-ai-textanalytics).
3+
This is the Microsoft Azure Cognitive Services Text Analytics Client Library.
4+
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
5+
For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/)
66

7-
This is the Microsoft Azure Cognitive Services Text Analytics Client
8-
Library.
97

10-
This package has been tested with Python 2.7, 3.5, 3.6 and 3.7.
8+
# Usage
119

12-
For a more complete set of Azure libraries, see the
13-
[azure sdk python release](https://aka.ms/azsdk/python/all).
14-
15-
## Usage
16-
17-
For code examples, see [Cognitive Services Text
18-
Analytics](https://docs.microsoft.com/python/api/overview/azure/cognitive-services)
10+
For code examples, see [Cognitive Services Text Analytics](https://docs.microsoft.com/python/api/overview/azure/cognitive-services)
1911
on docs.microsoft.com.
2012

21-
## Provide Feedback
2213

23-
If you encounter any bugs or have suggestions, please file an issue in
24-
the [Issues](https://github.com/Azure/azure-sdk-for-python/issues)
14+
# Provide Feedback
15+
16+
If you encounter any bugs or have suggestions, please file an issue in the
17+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
2518
section of the project.
2619

27-
![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-language-textanalytics%2FREADME.png)
20+
21+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-language-textanalytics%2FREADME.png)

sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from .text_analytics_client import TextAnalyticsClient
13-
from .version import VERSION
12+
from ._configuration import TextAnalyticsClientConfiguration
13+
from ._text_analytics_client import TextAnalyticsClient
14+
__all__ = ['TextAnalyticsClient', 'TextAnalyticsClientConfiguration']
1415

15-
__all__ = ['TextAnalyticsClient']
16+
from .version import VERSION
1617

1718
__version__ = VERSION
1819

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest import Configuration
13+
14+
from .version import VERSION
15+
16+
17+
class TextAnalyticsClientConfiguration(Configuration):
18+
"""Configuration for TextAnalyticsClient
19+
Note that all parameters used to create this instance are saved as instance
20+
attributes.
21+
22+
:param endpoint: Supported Cognitive Services endpoints (protocol and
23+
hostname, for example: https://westus.api.cognitive.microsoft.com).
24+
:type endpoint: str
25+
:param credentials: Subscription credentials which uniquely identify
26+
client subscription.
27+
:type credentials: None
28+
"""
29+
30+
def __init__(
31+
self, endpoint, credentials):
32+
33+
if endpoint is None:
34+
raise ValueError("Parameter 'endpoint' must not be None.")
35+
if credentials is None:
36+
raise ValueError("Parameter 'credentials' must not be None.")
37+
base_url = '{Endpoint}/text/analytics/v2.1'
38+
39+
super(TextAnalyticsClientConfiguration, self).__init__(base_url)
40+
41+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
42+
self.keep_alive = True
43+
44+
self.add_user_agent('azure-cognitiveservices-language-textanalytics/{}'.format(VERSION))
45+
46+
self.endpoint = endpoint
47+
self.credentials = credentials
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.service_client import SDKClient
13+
from msrest import Serializer, Deserializer
14+
15+
from ._configuration import TextAnalyticsClientConfiguration
16+
from .operations import TextAnalyticsClientOperationsMixin
17+
from . import models
18+
19+
20+
class TextAnalyticsClient(TextAnalyticsClientOperationsMixin, SDKClient):
21+
"""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
22+
23+
:ivar config: Configuration for client.
24+
:vartype config: TextAnalyticsClientConfiguration
25+
26+
:param endpoint: Supported Cognitive Services endpoints (protocol and
27+
hostname, for example: https://westus.api.cognitive.microsoft.com).
28+
:type endpoint: str
29+
:param credentials: Subscription credentials which uniquely identify
30+
client subscription.
31+
:type credentials: None
32+
"""
33+
34+
def __init__(
35+
self, endpoint, credentials):
36+
37+
self.config = TextAnalyticsClientConfiguration(endpoint, credentials)
38+
super(TextAnalyticsClient, self).__init__(self.config.credentials, self.config)
39+
40+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
41+
self.api_version = 'v2.1'
42+
self._serialize = Serializer(client_models)
43+
self._deserialize = Deserializer(client_models)
44+

sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py

+52-52
Original file line numberDiff line numberDiff line change
@@ -10,67 +10,67 @@
1010
# --------------------------------------------------------------------------
1111

1212
try:
13-
from .multi_language_input_py3 import MultiLanguageInput
14-
from .multi_language_batch_input_py3 import MultiLanguageBatchInput
15-
from .match_record_py3 import MatchRecord
16-
from .entity_record_py3 import EntityRecord
17-
from .document_statistics_py3 import DocumentStatistics
18-
from .entities_batch_result_item_py3 import EntitiesBatchResultItem
19-
from .error_record_py3 import ErrorRecord
20-
from .request_statistics_py3 import RequestStatistics
21-
from .entities_batch_result_py3 import EntitiesBatchResult
22-
from .internal_error_py3 import InternalError
23-
from .error_response_py3 import ErrorResponse, ErrorResponseException
24-
from .key_phrase_batch_result_item_py3 import KeyPhraseBatchResultItem
25-
from .key_phrase_batch_result_py3 import KeyPhraseBatchResult
26-
from .language_input_py3 import LanguageInput
27-
from .language_batch_input_py3 import LanguageBatchInput
28-
from .detected_language_py3 import DetectedLanguage
29-
from .language_batch_result_item_py3 import LanguageBatchResultItem
30-
from .language_batch_result_py3 import LanguageBatchResult
31-
from .sentiment_batch_result_item_py3 import SentimentBatchResultItem
32-
from .sentiment_batch_result_py3 import SentimentBatchResult
13+
from ._models_py3 import DetectedLanguage
14+
from ._models_py3 import DocumentStatistics
15+
from ._models_py3 import EntitiesBatchResult
16+
from ._models_py3 import EntitiesBatchResultItem
17+
from ._models_py3 import EntityRecord
18+
from ._models_py3 import ErrorRecord
19+
from ._models_py3 import ErrorResponse, ErrorResponseException
20+
from ._models_py3 import InternalError
21+
from ._models_py3 import KeyPhraseBatchResult
22+
from ._models_py3 import KeyPhraseBatchResultItem
23+
from ._models_py3 import LanguageBatchInput
24+
from ._models_py3 import LanguageBatchResult
25+
from ._models_py3 import LanguageBatchResultItem
26+
from ._models_py3 import LanguageInput
27+
from ._models_py3 import MatchRecord
28+
from ._models_py3 import MultiLanguageBatchInput
29+
from ._models_py3 import MultiLanguageInput
30+
from ._models_py3 import RequestStatistics
31+
from ._models_py3 import SentimentBatchResult
32+
from ._models_py3 import SentimentBatchResultItem
3333
except (SyntaxError, ImportError):
34-
from .multi_language_input import MultiLanguageInput
35-
from .multi_language_batch_input import MultiLanguageBatchInput
36-
from .match_record import MatchRecord
37-
from .entity_record import EntityRecord
38-
from .document_statistics import DocumentStatistics
39-
from .entities_batch_result_item import EntitiesBatchResultItem
40-
from .error_record import ErrorRecord
41-
from .request_statistics import RequestStatistics
42-
from .entities_batch_result import EntitiesBatchResult
43-
from .internal_error import InternalError
44-
from .error_response import ErrorResponse, ErrorResponseException
45-
from .key_phrase_batch_result_item import KeyPhraseBatchResultItem
46-
from .key_phrase_batch_result import KeyPhraseBatchResult
47-
from .language_input import LanguageInput
48-
from .language_batch_input import LanguageBatchInput
49-
from .detected_language import DetectedLanguage
50-
from .language_batch_result_item import LanguageBatchResultItem
51-
from .language_batch_result import LanguageBatchResult
52-
from .sentiment_batch_result_item import SentimentBatchResultItem
53-
from .sentiment_batch_result import SentimentBatchResult
34+
from ._models import DetectedLanguage
35+
from ._models import DocumentStatistics
36+
from ._models import EntitiesBatchResult
37+
from ._models import EntitiesBatchResultItem
38+
from ._models import EntityRecord
39+
from ._models import ErrorRecord
40+
from ._models import ErrorResponse, ErrorResponseException
41+
from ._models import InternalError
42+
from ._models import KeyPhraseBatchResult
43+
from ._models import KeyPhraseBatchResultItem
44+
from ._models import LanguageBatchInput
45+
from ._models import LanguageBatchResult
46+
from ._models import LanguageBatchResultItem
47+
from ._models import LanguageInput
48+
from ._models import MatchRecord
49+
from ._models import MultiLanguageBatchInput
50+
from ._models import MultiLanguageInput
51+
from ._models import RequestStatistics
52+
from ._models import SentimentBatchResult
53+
from ._models import SentimentBatchResultItem
5454

5555
__all__ = [
56-
'MultiLanguageInput',
57-
'MultiLanguageBatchInput',
58-
'MatchRecord',
59-
'EntityRecord',
56+
'DetectedLanguage',
6057
'DocumentStatistics',
58+
'EntitiesBatchResult',
6159
'EntitiesBatchResultItem',
60+
'EntityRecord',
6261
'ErrorRecord',
63-
'RequestStatistics',
64-
'EntitiesBatchResult',
65-
'InternalError',
6662
'ErrorResponse', 'ErrorResponseException',
67-
'KeyPhraseBatchResultItem',
63+
'InternalError',
6864
'KeyPhraseBatchResult',
69-
'LanguageInput',
65+
'KeyPhraseBatchResultItem',
7066
'LanguageBatchInput',
71-
'DetectedLanguage',
72-
'LanguageBatchResultItem',
7367
'LanguageBatchResult',
74-
'SentimentBatchResultItem',
68+
'LanguageBatchResultItem',
69+
'LanguageInput',
70+
'MatchRecord',
71+
'MultiLanguageBatchInput',
72+
'MultiLanguageInput',
73+
'RequestStatistics',
7574
'SentimentBatchResult',
75+
'SentimentBatchResultItem',
7676
]

0 commit comments

Comments
 (0)