azure-ai-textanalytics 5.3.0b2__py3-none-any.whl → 6.0.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of azure-ai-textanalytics might be problematic. Click here for more details.

Files changed (128) hide show
  1. azure/ai/textanalytics/__init__.py +26 -193
  2. azure/ai/textanalytics/_client.py +111 -0
  3. azure/ai/textanalytics/_configuration.py +73 -0
  4. azure/ai/textanalytics/{_generated/v2022_05_01/operations → _operations}/__init__.py +13 -8
  5. azure/ai/textanalytics/_operations/_operations.py +716 -0
  6. azure/ai/textanalytics/{_generated/v2022_05_01/models → _operations}/_patch.py +8 -6
  7. azure/ai/textanalytics/_patch.py +350 -0
  8. azure/ai/textanalytics/{_generated/aio → _utils}/__init__.py +1 -5
  9. azure/ai/textanalytics/_utils/model_base.py +1237 -0
  10. azure/ai/textanalytics/{_generated/_serialization.py → _utils/serialization.py} +640 -616
  11. azure/ai/textanalytics/{_generated/v2022_05_01/aio/_vendor.py → _utils/utils.py} +10 -12
  12. azure/ai/textanalytics/_version.py +8 -7
  13. azure/ai/textanalytics/aio/__init__.py +25 -14
  14. azure/ai/textanalytics/aio/_client.py +115 -0
  15. azure/ai/textanalytics/aio/_configuration.py +75 -0
  16. azure/ai/textanalytics/{_generated/v2022_10_01_preview/aio/operations → aio/_operations}/__init__.py +13 -8
  17. azure/ai/textanalytics/aio/_operations/_operations.py +623 -0
  18. azure/ai/textanalytics/{_generated/v2022_05_01 → aio/_operations}/_patch.py +8 -6
  19. azure/ai/textanalytics/aio/_patch.py +344 -0
  20. azure/ai/textanalytics/models/__init__.py +402 -0
  21. azure/ai/textanalytics/models/_enums.py +1979 -0
  22. azure/ai/textanalytics/models/_models.py +6641 -0
  23. azure/ai/textanalytics/{_generated/v2022_05_01/aio → models}/_patch.py +8 -6
  24. azure/ai/textanalytics/py.typed +1 -0
  25. {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/METADATA +668 -403
  26. azure_ai_textanalytics-6.0.0b1.dist-info/RECORD +29 -0
  27. {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/WHEEL +1 -1
  28. azure/ai/textanalytics/_base_client.py +0 -113
  29. azure/ai/textanalytics/_check.py +0 -22
  30. azure/ai/textanalytics/_dict_mixin.py +0 -57
  31. azure/ai/textanalytics/_generated/__init__.py +0 -16
  32. azure/ai/textanalytics/_generated/_configuration.py +0 -70
  33. azure/ai/textanalytics/_generated/_operations_mixin.py +0 -795
  34. azure/ai/textanalytics/_generated/_text_analytics_client.py +0 -126
  35. azure/ai/textanalytics/_generated/_version.py +0 -8
  36. azure/ai/textanalytics/_generated/aio/_configuration.py +0 -66
  37. azure/ai/textanalytics/_generated/aio/_operations_mixin.py +0 -776
  38. azure/ai/textanalytics/_generated/aio/_text_analytics_client.py +0 -124
  39. azure/ai/textanalytics/_generated/models.py +0 -8
  40. azure/ai/textanalytics/_generated/v2022_05_01/__init__.py +0 -20
  41. azure/ai/textanalytics/_generated/v2022_05_01/_configuration.py +0 -72
  42. azure/ai/textanalytics/_generated/v2022_05_01/_text_analytics_client.py +0 -100
  43. azure/ai/textanalytics/_generated/v2022_05_01/_vendor.py +0 -45
  44. azure/ai/textanalytics/_generated/v2022_05_01/aio/__init__.py +0 -20
  45. azure/ai/textanalytics/_generated/v2022_05_01/aio/_configuration.py +0 -71
  46. azure/ai/textanalytics/_generated/v2022_05_01/aio/_text_analytics_client.py +0 -97
  47. azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/__init__.py +0 -18
  48. azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/_patch.py +0 -121
  49. azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/_text_analytics_client_operations.py +0 -603
  50. azure/ai/textanalytics/_generated/v2022_05_01/models/__init__.py +0 -281
  51. azure/ai/textanalytics/_generated/v2022_05_01/models/_models_py3.py +0 -5722
  52. azure/ai/textanalytics/_generated/v2022_05_01/models/_text_analytics_client_enums.py +0 -439
  53. azure/ai/textanalytics/_generated/v2022_05_01/operations/_patch.py +0 -120
  54. azure/ai/textanalytics/_generated/v2022_05_01/operations/_text_analytics_client_operations.py +0 -744
  55. azure/ai/textanalytics/_generated/v2022_10_01_preview/__init__.py +0 -20
  56. azure/ai/textanalytics/_generated/v2022_10_01_preview/_configuration.py +0 -72
  57. azure/ai/textanalytics/_generated/v2022_10_01_preview/_patch.py +0 -19
  58. azure/ai/textanalytics/_generated/v2022_10_01_preview/_text_analytics_client.py +0 -100
  59. azure/ai/textanalytics/_generated/v2022_10_01_preview/_vendor.py +0 -45
  60. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/__init__.py +0 -20
  61. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_configuration.py +0 -71
  62. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_patch.py +0 -19
  63. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_text_analytics_client.py +0 -97
  64. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_vendor.py +0 -27
  65. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/operations/_patch.py +0 -121
  66. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/operations/_text_analytics_client_operations.py +0 -603
  67. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/__init__.py +0 -405
  68. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_models_py3.py +0 -8420
  69. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_patch.py +0 -486
  70. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_text_analytics_client_enums.py +0 -729
  71. azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/__init__.py +0 -18
  72. azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/_patch.py +0 -120
  73. azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/_text_analytics_client_operations.py +0 -744
  74. azure/ai/textanalytics/_generated/v3_0/__init__.py +0 -20
  75. azure/ai/textanalytics/_generated/v3_0/_configuration.py +0 -66
  76. azure/ai/textanalytics/_generated/v3_0/_patch.py +0 -31
  77. azure/ai/textanalytics/_generated/v3_0/_text_analytics_client.py +0 -96
  78. azure/ai/textanalytics/_generated/v3_0/_vendor.py +0 -33
  79. azure/ai/textanalytics/_generated/v3_0/aio/__init__.py +0 -20
  80. azure/ai/textanalytics/_generated/v3_0/aio/_configuration.py +0 -65
  81. azure/ai/textanalytics/_generated/v3_0/aio/_patch.py +0 -31
  82. azure/ai/textanalytics/_generated/v3_0/aio/_text_analytics_client.py +0 -93
  83. azure/ai/textanalytics/_generated/v3_0/aio/_vendor.py +0 -27
  84. azure/ai/textanalytics/_generated/v3_0/aio/operations/__init__.py +0 -18
  85. azure/ai/textanalytics/_generated/v3_0/aio/operations/_patch.py +0 -19
  86. azure/ai/textanalytics/_generated/v3_0/aio/operations/_text_analytics_client_operations.py +0 -428
  87. azure/ai/textanalytics/_generated/v3_0/models/__init__.py +0 -81
  88. azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py +0 -1467
  89. azure/ai/textanalytics/_generated/v3_0/models/_patch.py +0 -19
  90. azure/ai/textanalytics/_generated/v3_0/models/_text_analytics_client_enums.py +0 -58
  91. azure/ai/textanalytics/_generated/v3_0/operations/__init__.py +0 -18
  92. azure/ai/textanalytics/_generated/v3_0/operations/_patch.py +0 -19
  93. azure/ai/textanalytics/_generated/v3_0/operations/_text_analytics_client_operations.py +0 -604
  94. azure/ai/textanalytics/_generated/v3_1/__init__.py +0 -20
  95. azure/ai/textanalytics/_generated/v3_1/_configuration.py +0 -66
  96. azure/ai/textanalytics/_generated/v3_1/_patch.py +0 -31
  97. azure/ai/textanalytics/_generated/v3_1/_text_analytics_client.py +0 -98
  98. azure/ai/textanalytics/_generated/v3_1/_vendor.py +0 -45
  99. azure/ai/textanalytics/_generated/v3_1/aio/__init__.py +0 -20
  100. azure/ai/textanalytics/_generated/v3_1/aio/_configuration.py +0 -65
  101. azure/ai/textanalytics/_generated/v3_1/aio/_patch.py +0 -31
  102. azure/ai/textanalytics/_generated/v3_1/aio/_text_analytics_client.py +0 -95
  103. azure/ai/textanalytics/_generated/v3_1/aio/_vendor.py +0 -27
  104. azure/ai/textanalytics/_generated/v3_1/aio/operations/__init__.py +0 -18
  105. azure/ai/textanalytics/_generated/v3_1/aio/operations/_patch.py +0 -19
  106. azure/ai/textanalytics/_generated/v3_1/aio/operations/_text_analytics_client_operations.py +0 -1291
  107. azure/ai/textanalytics/_generated/v3_1/models/__init__.py +0 -205
  108. azure/ai/textanalytics/_generated/v3_1/models/_models_py3.py +0 -3976
  109. azure/ai/textanalytics/_generated/v3_1/models/_patch.py +0 -19
  110. azure/ai/textanalytics/_generated/v3_1/models/_text_analytics_client_enums.py +0 -367
  111. azure/ai/textanalytics/_generated/v3_1/operations/__init__.py +0 -18
  112. azure/ai/textanalytics/_generated/v3_1/operations/_patch.py +0 -19
  113. azure/ai/textanalytics/_generated/v3_1/operations/_text_analytics_client_operations.py +0 -1709
  114. azure/ai/textanalytics/_lro.py +0 -553
  115. azure/ai/textanalytics/_models.py +0 -3158
  116. azure/ai/textanalytics/_policies.py +0 -66
  117. azure/ai/textanalytics/_request_handlers.py +0 -104
  118. azure/ai/textanalytics/_response_handlers.py +0 -583
  119. azure/ai/textanalytics/_text_analytics_client.py +0 -2081
  120. azure/ai/textanalytics/_user_agent.py +0 -8
  121. azure/ai/textanalytics/_validate.py +0 -113
  122. azure/ai/textanalytics/aio/_base_client_async.py +0 -98
  123. azure/ai/textanalytics/aio/_lro_async.py +0 -503
  124. azure/ai/textanalytics/aio/_response_handlers_async.py +0 -94
  125. azure/ai/textanalytics/aio/_text_analytics_client_async.py +0 -2077
  126. azure_ai_textanalytics-5.3.0b2.dist-info/RECORD +0 -115
  127. {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info/licenses}/LICENSE +0 -0
  128. {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/top_level.txt +0 -0
@@ -1,776 +0,0 @@
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
- from .._serialization import Serializer, Deserializer
12
- from typing import Any, IO, List, Optional, Union
13
-
14
- # FIXME: have to manually reconfigure import path for multiapi operation mixin
15
- from ...aio._lro_async import AsyncAnalyzeHealthcareEntitiesLROPoller, AsyncAnalyzeHealthcareEntitiesLROPollingMethod, AsyncAnalyzeActionsLROPoller, AsyncAnalyzeActionsLROPollingMethod
16
- from azure.core.polling import AsyncLROPoller
17
-
18
- from .. import models as _models
19
-
20
-
21
- class TextAnalyticsClientOperationsMixin(object):
22
-
23
- async def analyze_status(
24
- self,
25
- job_id: str,
26
- show_stats: Optional[bool] = None,
27
- top: int = 20,
28
- skip: int = 0,
29
- **kwargs: Any
30
- ) -> _models.AnalyzeJobState:
31
- """Get analysis status and results.
32
-
33
- Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are
34
- completed, the job will transition to the completed state and results will be available for
35
- each task.
36
-
37
- :param job_id: Job ID for Analyze. Required.
38
- :type job_id: str
39
- :param show_stats: (Optional) if set to true, response will contain request and document level
40
- statistics. Default value is None.
41
- :type show_stats: bool
42
- :param top: (Optional) Set the maximum number of results per task. When both $top and $skip are
43
- specified, $skip is applied first. Default value is 20.
44
- :type top: int
45
- :param skip: (Optional) Set the number of elements to offset in the response. When both $top
46
- and $skip are specified, $skip is applied first. Default value is 0.
47
- :type skip: int
48
- :keyword callable cls: A custom type or function that will be passed the direct response
49
- :return: AnalyzeJobState or the result of cls(response)
50
- :rtype: ~azure.ai.textanalytics.v3_1.models.AnalyzeJobState
51
- :raises ~azure.core.exceptions.HttpResponseError:
52
- """
53
- api_version = self._get_api_version('analyze_status')
54
- if api_version == 'v3.1':
55
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
56
- else:
57
- raise ValueError("API version {} does not have operation 'analyze_status'".format(api_version))
58
- mixin_instance = OperationClass()
59
- mixin_instance._client = self._client
60
- mixin_instance._config = self._config
61
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
62
- mixin_instance._serialize.client_side_validation = False
63
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
64
- return await mixin_instance.analyze_status(job_id, show_stats, top, skip, **kwargs)
65
-
66
- async def analyze_text(
67
- self,
68
- body: Union[_models.AnalyzeTextTask, IO],
69
- show_stats: Optional[bool] = None,
70
- **kwargs: Any
71
- ) -> _models.AnalyzeTextTaskResult:
72
- """Request text analysis over a collection of documents.
73
-
74
- Submit a collection of text documents for analysis. Specify a single unique task to be
75
- executed immediately.
76
-
77
- :param body: Collection of documents to analyze and a single task to execute. Is either a model
78
- type or a IO type. Required.
79
- :type body: ~azure.ai.textanalytics.v2022_05_01.models.AnalyzeTextTask or IO
80
- :param show_stats: (Optional) if set to true, response will contain request and document level
81
- statistics. Default value is None.
82
- :type show_stats: bool
83
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
84
- Default value is None.
85
- :paramtype content_type: str
86
- :keyword callable cls: A custom type or function that will be passed the direct response
87
- :return: AnalyzeTextTaskResult or the result of cls(response)
88
- :rtype: ~azure.ai.textanalytics.v2022_05_01.models.AnalyzeTextTaskResult
89
- :raises ~azure.core.exceptions.HttpResponseError:
90
- """
91
- api_version = self._get_api_version('analyze_text')
92
- if api_version == '2022-05-01':
93
- from ..v2022_05_01.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
94
- elif api_version == '2022-10-01-preview':
95
- from ..v2022_10_01_preview.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
96
- else:
97
- raise ValueError("API version {} does not have operation 'analyze_text'".format(api_version))
98
- mixin_instance = OperationClass()
99
- mixin_instance._client = self._client
100
- mixin_instance._config = self._config
101
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
102
- mixin_instance._serialize.client_side_validation = False
103
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
104
- return await mixin_instance.analyze_text(body, show_stats, **kwargs)
105
-
106
- async def analyze_text_job_status(
107
- self,
108
- job_id: str,
109
- show_stats: Optional[bool] = None,
110
- top: Optional[int] = None,
111
- skip: Optional[int] = None,
112
- **kwargs: Any
113
- ) -> _models.AnalyzeTextJobState:
114
- """Get analysis status and results.
115
-
116
- Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are
117
- succeeded, the job will transition to the succeeded state and results will be available for
118
- each task.
119
-
120
- :param job_id: Job ID. Required.
121
- :type job_id: str
122
- :param show_stats: (Optional) if set to true, response will contain request and document level
123
- statistics. Default value is None.
124
- :type show_stats: bool
125
- :param top: The maximum number of resources to return from the collection. Default value is
126
- None.
127
- :type top: int
128
- :param skip: An offset into the collection of the first resource to be returned. Default value
129
- is None.
130
- :type skip: int
131
- :keyword callable cls: A custom type or function that will be passed the direct response
132
- :return: AnalyzeTextJobState or the result of cls(response)
133
- :rtype: ~azure.ai.textanalytics.v2022_05_01.models.AnalyzeTextJobState
134
- :raises ~azure.core.exceptions.HttpResponseError:
135
- """
136
- api_version = self._get_api_version('analyze_text_job_status')
137
- if api_version == '2022-05-01':
138
- from ..v2022_05_01.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
139
- elif api_version == '2022-10-01-preview':
140
- from ..v2022_10_01_preview.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
141
- else:
142
- raise ValueError("API version {} does not have operation 'analyze_text_job_status'".format(api_version))
143
- mixin_instance = OperationClass()
144
- mixin_instance._client = self._client
145
- mixin_instance._config = self._config
146
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
147
- mixin_instance._serialize.client_side_validation = False
148
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
149
- return await mixin_instance.analyze_text_job_status(job_id, show_stats, top, skip, **kwargs)
150
-
151
- async def begin_analyze(
152
- self,
153
- body: Optional[Union[_models.AnalyzeBatchInput, IO]] = None,
154
- **kwargs: Any
155
- ) -> AsyncAnalyzeActionsLROPoller[_models.AnalyzeJobState]:
156
- """Submit analysis job.
157
-
158
- Submit a collection of text documents for analysis. Specify one or more unique tasks to be
159
- executed.
160
-
161
- :param body: Collection of documents to analyze and tasks to execute. Is either a model type or
162
- a IO type. Default value is None.
163
- :type body: ~azure.ai.textanalytics.v3_1.models.AnalyzeBatchInput or IO
164
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
165
- 'text/json'. Default value is None.
166
- :paramtype content_type: str
167
- :keyword callable cls: A custom type or function that will be passed the direct response
168
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
169
- :keyword polling: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod.
170
- Pass in False for this operation to not poll, or pass in your own initialized polling object
171
- for a personal polling strategy.
172
- :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
173
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
174
- Retry-After header is present.
175
- :return: An instance of AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the
176
- result of cls(response)
177
- :rtype:
178
- ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1.models.AnalyzeJobState]
179
- :raises ~azure.core.exceptions.HttpResponseError:
180
- """
181
- api_version = self._get_api_version('begin_analyze')
182
- if api_version == 'v3.1':
183
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
184
- else:
185
- raise ValueError("API version {} does not have operation 'begin_analyze'".format(api_version))
186
- mixin_instance = OperationClass()
187
- mixin_instance._client = self._client
188
- mixin_instance._config = self._config
189
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
190
- mixin_instance._serialize.client_side_validation = False
191
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
192
- return await mixin_instance.begin_analyze(body, **kwargs)
193
-
194
- async def begin_analyze_text_cancel_job(
195
- self,
196
- job_id: str,
197
- **kwargs: Any
198
- ) -> AsyncLROPoller[None]:
199
- """Cancel a long-running Text Analysis job.
200
-
201
- Cancel a long-running Text Analysis job.
202
-
203
- :param job_id: Job ID. Required.
204
- :type job_id: str
205
- :keyword callable cls: A custom type or function that will be passed the direct response
206
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
207
- :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False
208
- for this operation to not poll, or pass in your own initialized polling object for a personal
209
- polling strategy.
210
- :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
211
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
212
- Retry-After header is present.
213
- :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
214
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
215
- :raises ~azure.core.exceptions.HttpResponseError:
216
- """
217
- api_version = self._get_api_version('begin_analyze_text_cancel_job')
218
- if api_version == '2022-05-01':
219
- from ..v2022_05_01.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
220
- elif api_version == '2022-10-01-preview':
221
- from ..v2022_10_01_preview.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
222
- else:
223
- raise ValueError("API version {} does not have operation 'begin_analyze_text_cancel_job'".format(api_version))
224
- mixin_instance = OperationClass()
225
- mixin_instance._client = self._client
226
- mixin_instance._config = self._config
227
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
228
- mixin_instance._serialize.client_side_validation = False
229
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
230
- return await mixin_instance.begin_analyze_text_cancel_job(job_id, **kwargs)
231
-
232
- async def begin_analyze_text_submit_job(
233
- self,
234
- body: Union[_models.AnalyzeTextJobsInput, IO],
235
- **kwargs: Any
236
- ) -> AsyncAnalyzeActionsLROPoller[_models.AnalyzeTextJobState]:
237
- """Submit text analysis job.
238
-
239
- Submit a collection of text documents for analysis. Specify one or more unique tasks to be
240
- executed as a long-running operation.
241
-
242
- :param body: Collection of documents to analyze and one or more tasks to execute. Is either a
243
- model type or a IO type. Required.
244
- :type body: ~azure.ai.textanalytics.v2022_05_01.models.AnalyzeTextJobsInput or IO
245
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
246
- Default value is None.
247
- :paramtype content_type: str
248
- :keyword callable cls: A custom type or function that will be passed the direct response
249
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
250
- :keyword polling: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod.
251
- Pass in False for this operation to not poll, or pass in your own initialized polling object
252
- for a personal polling strategy.
253
- :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
254
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
255
- Retry-After header is present.
256
- :return: An instance of AsyncAnalyzeActionsLROPoller that returns either AnalyzeTextJobState or
257
- the result of cls(response)
258
- :rtype:
259
- ~.....aio._lro_async.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v2022_05_01.models.AnalyzeTextJobState]
260
- :raises ~azure.core.exceptions.HttpResponseError:
261
- """
262
- api_version = self._get_api_version('begin_analyze_text_submit_job')
263
- if api_version == '2022-05-01':
264
- from ..v2022_05_01.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
265
- elif api_version == '2022-10-01-preview':
266
- from ..v2022_10_01_preview.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
267
- else:
268
- raise ValueError("API version {} does not have operation 'begin_analyze_text_submit_job'".format(api_version))
269
- mixin_instance = OperationClass()
270
- mixin_instance._client = self._client
271
- mixin_instance._config = self._config
272
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
273
- mixin_instance._serialize.client_side_validation = False
274
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
275
- return await mixin_instance.begin_analyze_text_submit_job(body, **kwargs)
276
-
277
- async def begin_cancel_health_job(
278
- self,
279
- job_id: str,
280
- **kwargs: Any
281
- ) -> AsyncLROPoller[None]:
282
- """Cancel healthcare prediction job.
283
-
284
- Cancel healthcare prediction job.
285
-
286
- :param job_id: Job ID. Required.
287
- :type job_id: str
288
- :keyword callable cls: A custom type or function that will be passed the direct response
289
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
290
- :keyword polling: By default, your polling method will be AsyncLROBasePolling. Pass in False
291
- for this operation to not poll, or pass in your own initialized polling object for a personal
292
- polling strategy.
293
- :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
294
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
295
- Retry-After header is present.
296
- :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
297
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
298
- :raises ~azure.core.exceptions.HttpResponseError:
299
- """
300
- api_version = self._get_api_version('begin_cancel_health_job')
301
- if api_version == 'v3.1':
302
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
303
- else:
304
- raise ValueError("API version {} does not have operation 'begin_cancel_health_job'".format(api_version))
305
- mixin_instance = OperationClass()
306
- mixin_instance._client = self._client
307
- mixin_instance._config = self._config
308
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
309
- mixin_instance._serialize.client_side_validation = False
310
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
311
- return await mixin_instance.begin_cancel_health_job(job_id, **kwargs)
312
-
313
- async def begin_health(
314
- self,
315
- documents: List[_models.MultiLanguageInput],
316
- model_version: Optional[str] = None,
317
- string_index_type: Optional[Union[str, "_models.StringIndexType"]] = None,
318
- logging_opt_out: Optional[bool] = None,
319
- **kwargs: Any
320
- ) -> AsyncAnalyzeHealthcareEntitiesLROPoller[_models.HealthcareJobState]:
321
- """Submit healthcare analysis job.
322
-
323
- Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions,
324
- symptoms, etc) and their relations.
325
-
326
- :param documents: The set of documents to process as part of this batch. Required.
327
- :type documents: list[~azure.ai.textanalytics.v3_1.models.MultiLanguageInput]
328
- :param model_version: (Optional) This value indicates which model will be used for scoring. If
329
- a model-version is not specified, the API should default to the latest, non-preview version.
330
- Default value is None.
331
- :type model_version: str
332
- :param string_index_type: (Optional) Specifies the method used to interpret string offsets.
333
- Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information
334
- see https://aka.ms/text-analytics-offsets. Known values are: "TextElement_v8",
335
- "UnicodeCodePoint", and "Utf16CodeUnit". Default value is None.
336
- :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType
337
- :param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged
338
- for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to
339
- allow for troubleshooting issues in providing you with the Text Analytics natural language
340
- processing functions. Setting this parameter to true, disables input logging and may limit our
341
- ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy
342
- notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI
343
- principles at https://www.microsoft.com/en-us/ai/responsible-ai. Default value is None.
344
- :type logging_opt_out: bool
345
- :keyword callable cls: A custom type or function that will be passed the direct response
346
- :keyword str continuation_token: A continuation token to restart a poller from a saved state.
347
- :keyword polling: By default, your polling method will be
348
- AsyncAnalyzeHealthcareEntitiesLROPollingMethod. Pass in False for this operation to not poll,
349
- or pass in your own initialized polling object for a personal polling strategy.
350
- :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
351
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
352
- Retry-After header is present.
353
- :return: An instance of AsyncAnalyzeHealthcareEntitiesLROPoller that returns either
354
- HealthcareJobState or the result of cls(response)
355
- :rtype:
356
- ~.....aio._lro_async.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1.models.HealthcareJobState]
357
- :raises ~azure.core.exceptions.HttpResponseError:
358
- """
359
- api_version = self._get_api_version('begin_health')
360
- if api_version == 'v3.1':
361
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
362
- else:
363
- raise ValueError("API version {} does not have operation 'begin_health'".format(api_version))
364
- mixin_instance = OperationClass()
365
- mixin_instance._client = self._client
366
- mixin_instance._config = self._config
367
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
368
- mixin_instance._serialize.client_side_validation = False
369
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
370
- return await mixin_instance.begin_health(documents, model_version, string_index_type, logging_opt_out, **kwargs)
371
-
372
- async def entities_linking(
373
- self,
374
- documents: List[_models.MultiLanguageInput],
375
- model_version: Optional[str] = None,
376
- show_stats: Optional[bool] = None,
377
- logging_opt_out: Optional[bool] = None,
378
- string_index_type: Optional[Union[str, "_models.StringIndexType"]] = None,
379
- **kwargs: Any
380
- ) -> _models.EntityLinkingResult:
381
- """Linked entities from a well known knowledge base.
382
-
383
- The API returns a list of recognized entities with links to a well known knowledge base. See
384
- the :code:`<a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a>` for
385
- the list of enabled languages.
386
-
387
- :param documents: The set of documents to process as part of this batch. Required.
388
- :type documents: list[~azure.ai.textanalytics.v3_1.models.MultiLanguageInput]
389
- :param model_version: (Optional) This value indicates which model will be used for scoring. If
390
- a model-version is not specified, the API should default to the latest, non-preview version.
391
- Default value is None.
392
- :type model_version: str
393
- :param show_stats: (Optional) if set to true, response will contain request and document level
394
- statistics. Default value is None.
395
- :type show_stats: bool
396
- :param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged
397
- for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to
398
- allow for troubleshooting issues in providing you with the Text Analytics natural language
399
- processing functions. Setting this parameter to true, disables input logging and may limit our
400
- ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy
401
- notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI
402
- principles at https://www.microsoft.com/en-us/ai/responsible-ai. Default value is None.
403
- :type logging_opt_out: bool
404
- :param string_index_type: (Optional) Specifies the method used to interpret string offsets.
405
- Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information
406
- see https://aka.ms/text-analytics-offsets. Known values are: "TextElement_v8",
407
- "UnicodeCodePoint", and "Utf16CodeUnit". Default value is None.
408
- :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType
409
- :keyword callable cls: A custom type or function that will be passed the direct response
410
- :return: EntityLinkingResult or the result of cls(response)
411
- :rtype: ~azure.ai.textanalytics.v3_1.models.EntityLinkingResult
412
- :raises ~azure.core.exceptions.HttpResponseError:
413
- """
414
- api_version = self._get_api_version('entities_linking')
415
- if api_version == 'v3.0':
416
- from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
417
- elif api_version == 'v3.1':
418
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
419
- else:
420
- raise ValueError("API version {} does not have operation 'entities_linking'".format(api_version))
421
- mixin_instance = OperationClass()
422
- mixin_instance._client = self._client
423
- mixin_instance._config = self._config
424
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
425
- mixin_instance._serialize.client_side_validation = False
426
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
427
- # FIXME: this is handwritten
428
- if api_version == 'v3.0':
429
- return await mixin_instance.entities_linking(documents, model_version, show_stats, **kwargs)
430
- elif api_version == 'v3.1':
431
- return await mixin_instance.entities_linking(documents, model_version, show_stats, logging_opt_out, string_index_type, **kwargs)
432
-
433
- async def entities_recognition_general(
434
- self,
435
- documents: List[_models.MultiLanguageInput],
436
- model_version: Optional[str] = None,
437
- show_stats: Optional[bool] = None,
438
- logging_opt_out: Optional[bool] = None,
439
- string_index_type: Optional[Union[str, "_models.StringIndexType"]] = None,
440
- **kwargs: Any
441
- ) -> _models.EntitiesResult:
442
- """Named Entity Recognition.
443
-
444
- The API returns a list of general named entities in a given document. For the list of supported
445
- entity types, check :code:`<a href="https://aka.ms/taner">Supported Entity Types in Text
446
- Analytics API</a>`. See the :code:`<a href="https://aka.ms/talangs">Supported languages in Text
447
- Analytics API</a>` for the list of enabled languages.
448
-
449
- :param documents: The set of documents to process as part of this batch. Required.
450
- :type documents: list[~azure.ai.textanalytics.v3_1.models.MultiLanguageInput]
451
- :param model_version: (Optional) This value indicates which model will be used for scoring. If
452
- a model-version is not specified, the API should default to the latest, non-preview version.
453
- Default value is None.
454
- :type model_version: str
455
- :param show_stats: (Optional) if set to true, response will contain request and document level
456
- statistics. Default value is None.
457
- :type show_stats: bool
458
- :param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged
459
- for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to
460
- allow for troubleshooting issues in providing you with the Text Analytics natural language
461
- processing functions. Setting this parameter to true, disables input logging and may limit our
462
- ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy
463
- notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI
464
- principles at https://www.microsoft.com/en-us/ai/responsible-ai. Default value is None.
465
- :type logging_opt_out: bool
466
- :param string_index_type: (Optional) Specifies the method used to interpret string offsets.
467
- Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information
468
- see https://aka.ms/text-analytics-offsets. Known values are: "TextElement_v8",
469
- "UnicodeCodePoint", and "Utf16CodeUnit". Default value is None.
470
- :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType
471
- :keyword callable cls: A custom type or function that will be passed the direct response
472
- :return: EntitiesResult or the result of cls(response)
473
- :rtype: ~azure.ai.textanalytics.v3_1.models.EntitiesResult
474
- :raises ~azure.core.exceptions.HttpResponseError:
475
- """
476
- api_version = self._get_api_version('entities_recognition_general')
477
- if api_version == 'v3.0':
478
- from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
479
- elif api_version == 'v3.1':
480
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
481
- else:
482
- raise ValueError("API version {} does not have operation 'entities_recognition_general'".format(api_version))
483
- mixin_instance = OperationClass()
484
- mixin_instance._client = self._client
485
- mixin_instance._config = self._config
486
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
487
- mixin_instance._serialize.client_side_validation = False
488
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
489
- # FIXME: this is handwritten
490
- if api_version == 'v3.0':
491
- return await mixin_instance.entities_recognition_general(documents, model_version, show_stats, **kwargs)
492
- elif api_version == 'v3.1':
493
- return await mixin_instance.entities_recognition_general(documents, model_version, show_stats, logging_opt_out, string_index_type, **kwargs)
494
-
495
- async def entities_recognition_pii(
496
- self,
497
- documents: List[_models.MultiLanguageInput],
498
- model_version: Optional[str] = None,
499
- show_stats: Optional[bool] = None,
500
- logging_opt_out: Optional[bool] = None,
501
- domain: Optional[str] = None,
502
- string_index_type: Optional[Union[str, "_models.StringIndexType"]] = None,
503
- pii_categories: Optional[List[Union[str, "_models.PiiCategory"]]] = None,
504
- **kwargs: Any
505
- ) -> _models.PiiResult:
506
- """Entities containing personal information.
507
-
508
- The API returns a list of entities with personal information (\"SSN\", \"Bank Account\" etc) in
509
- the document. For the list of supported entity types, check :code:`<a
510
- href="https://aka.ms/tanerpii">Supported Entity Types in Text Analytics API</a>`. See the
511
- :code:`<a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a>` for the
512
- list of enabled languages.
513
-
514
- :param documents: The set of documents to process as part of this batch. Required.
515
- :type documents: list[~azure.ai.textanalytics.v3_1.models.MultiLanguageInput]
516
- :param model_version: (Optional) This value indicates which model will be used for scoring. If
517
- a model-version is not specified, the API should default to the latest, non-preview version.
518
- Default value is None.
519
- :type model_version: str
520
- :param show_stats: (Optional) if set to true, response will contain request and document level
521
- statistics. Default value is None.
522
- :type show_stats: bool
523
- :param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged
524
- for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to
525
- allow for troubleshooting issues in providing you with the Text Analytics natural language
526
- processing functions. Setting this parameter to true, disables input logging and may limit our
527
- ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy
528
- notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI
529
- principles at https://www.microsoft.com/en-us/ai/responsible-ai. Default value is None.
530
- :type logging_opt_out: bool
531
- :param domain: (Optional) if specified, will set the PII domain to include only a subset of the
532
- entity categories. Possible values include: 'PHI', 'none'. Default value is None.
533
- :type domain: str
534
- :param string_index_type: (Optional) Specifies the method used to interpret string offsets.
535
- Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information
536
- see https://aka.ms/text-analytics-offsets. Known values are: "TextElement_v8",
537
- "UnicodeCodePoint", and "Utf16CodeUnit". Default value is None.
538
- :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType
539
- :param pii_categories: (Optional) describes the PII categories to return. Default value is
540
- None.
541
- :type pii_categories: list[str or ~azure.ai.textanalytics.v3_1.models.PiiCategory]
542
- :keyword callable cls: A custom type or function that will be passed the direct response
543
- :return: PiiResult or the result of cls(response)
544
- :rtype: ~azure.ai.textanalytics.v3_1.models.PiiResult
545
- :raises ~azure.core.exceptions.HttpResponseError:
546
- """
547
- api_version = self._get_api_version('entities_recognition_pii')
548
- if api_version == 'v3.1':
549
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
550
- else:
551
- raise ValueError("API version {} does not have operation 'entities_recognition_pii'".format(api_version))
552
- mixin_instance = OperationClass()
553
- mixin_instance._client = self._client
554
- mixin_instance._config = self._config
555
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
556
- mixin_instance._serialize.client_side_validation = False
557
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
558
- return await mixin_instance.entities_recognition_pii(documents, model_version, show_stats, logging_opt_out, domain, string_index_type, pii_categories, **kwargs)
559
-
560
- async def health_status(
561
- self,
562
- job_id: str,
563
- top: int = 20,
564
- skip: int = 0,
565
- show_stats: Optional[bool] = None,
566
- **kwargs: Any
567
- ) -> _models.HealthcareJobState:
568
- """Get healthcare analysis job status and results.
569
-
570
- Get details of the healthcare prediction job specified by the jobId.
571
-
572
- :param job_id: Job ID. Required.
573
- :type job_id: str
574
- :param top: (Optional) Set the maximum number of results per task. When both $top and $skip are
575
- specified, $skip is applied first. Default value is 20.
576
- :type top: int
577
- :param skip: (Optional) Set the number of elements to offset in the response. When both $top
578
- and $skip are specified, $skip is applied first. Default value is 0.
579
- :type skip: int
580
- :param show_stats: (Optional) if set to true, response will contain request and document level
581
- statistics. Default value is None.
582
- :type show_stats: bool
583
- :keyword callable cls: A custom type or function that will be passed the direct response
584
- :return: HealthcareJobState or the result of cls(response)
585
- :rtype: ~azure.ai.textanalytics.v3_1.models.HealthcareJobState
586
- :raises ~azure.core.exceptions.HttpResponseError:
587
- """
588
- api_version = self._get_api_version('health_status')
589
- if api_version == 'v3.1':
590
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
591
- else:
592
- raise ValueError("API version {} does not have operation 'health_status'".format(api_version))
593
- mixin_instance = OperationClass()
594
- mixin_instance._client = self._client
595
- mixin_instance._config = self._config
596
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
597
- mixin_instance._serialize.client_side_validation = False
598
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
599
- return await mixin_instance.health_status(job_id, top, skip, show_stats, **kwargs)
600
-
601
- async def key_phrases(
602
- self,
603
- documents: List[_models.MultiLanguageInput],
604
- model_version: Optional[str] = None,
605
- show_stats: Optional[bool] = None,
606
- logging_opt_out: Optional[bool] = None,
607
- **kwargs: Any
608
- ) -> _models.KeyPhraseResult:
609
- """Key Phrases.
610
-
611
- The API returns a list of strings denoting the key phrases in the input text. See the :code:`<a
612
- href="https://aka.ms/talangs">Supported languages in Text Analytics API</a>` for the list of
613
- enabled languages.
614
-
615
- :param documents: The set of documents to process as part of this batch. Required.
616
- :type documents: list[~azure.ai.textanalytics.v3_1.models.MultiLanguageInput]
617
- :param model_version: (Optional) This value indicates which model will be used for scoring. If
618
- a model-version is not specified, the API should default to the latest, non-preview version.
619
- Default value is None.
620
- :type model_version: str
621
- :param show_stats: (Optional) if set to true, response will contain request and document level
622
- statistics. Default value is None.
623
- :type show_stats: bool
624
- :param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged
625
- for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to
626
- allow for troubleshooting issues in providing you with the Text Analytics natural language
627
- processing functions. Setting this parameter to true, disables input logging and may limit our
628
- ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy
629
- notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI
630
- principles at https://www.microsoft.com/en-us/ai/responsible-ai. Default value is None.
631
- :type logging_opt_out: bool
632
- :keyword callable cls: A custom type or function that will be passed the direct response
633
- :return: KeyPhraseResult or the result of cls(response)
634
- :rtype: ~azure.ai.textanalytics.v3_1.models.KeyPhraseResult
635
- :raises ~azure.core.exceptions.HttpResponseError:
636
- """
637
- api_version = self._get_api_version('key_phrases')
638
- if api_version == 'v3.0':
639
- from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
640
- elif api_version == 'v3.1':
641
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
642
- else:
643
- raise ValueError("API version {} does not have operation 'key_phrases'".format(api_version))
644
- mixin_instance = OperationClass()
645
- mixin_instance._client = self._client
646
- mixin_instance._config = self._config
647
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
648
- mixin_instance._serialize.client_side_validation = False
649
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
650
- # FIXME: this is handwritten
651
- if api_version == 'v3.0':
652
- return await mixin_instance.key_phrases(documents, model_version, show_stats, **kwargs)
653
- elif api_version == 'v3.1':
654
- return await mixin_instance.key_phrases(documents, model_version, show_stats, logging_opt_out, **kwargs)
655
-
656
- async def languages(
657
- self,
658
- documents: List[_models.LanguageInput],
659
- model_version: Optional[str] = None,
660
- show_stats: Optional[bool] = None,
661
- logging_opt_out: Optional[bool] = None,
662
- **kwargs: Any
663
- ) -> _models.LanguageResult:
664
- """Detect Language.
665
-
666
- The API returns the detected language and a numeric score between 0 and 1. Scores close to 1
667
- indicate 100% certainty that the identified language is true. See the :code:`<a
668
- href="https://aka.ms/talangs">Supported languages in Text Analytics API</a>` for the list of
669
- enabled languages.
670
-
671
- :param documents: Required.
672
- :type documents: list[~azure.ai.textanalytics.v3_1.models.LanguageInput]
673
- :param model_version: (Optional) This value indicates which model will be used for scoring. If
674
- a model-version is not specified, the API should default to the latest, non-preview version.
675
- Default value is None.
676
- :type model_version: str
677
- :param show_stats: (Optional) if set to true, response will contain request and document level
678
- statistics. Default value is None.
679
- :type show_stats: bool
680
- :param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged
681
- for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to
682
- allow for troubleshooting issues in providing you with the Text Analytics natural language
683
- processing functions. Setting this parameter to true, disables input logging and may limit our
684
- ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy
685
- notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI
686
- principles at https://www.microsoft.com/en-us/ai/responsible-ai. Default value is None.
687
- :type logging_opt_out: bool
688
- :keyword callable cls: A custom type or function that will be passed the direct response
689
- :return: LanguageResult or the result of cls(response)
690
- :rtype: ~azure.ai.textanalytics.v3_1.models.LanguageResult
691
- :raises ~azure.core.exceptions.HttpResponseError:
692
- """
693
- api_version = self._get_api_version('languages')
694
- if api_version == 'v3.0':
695
- from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
696
- elif api_version == 'v3.1':
697
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
698
- else:
699
- raise ValueError("API version {} does not have operation 'languages'".format(api_version))
700
- mixin_instance = OperationClass()
701
- mixin_instance._client = self._client
702
- mixin_instance._config = self._config
703
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
704
- mixin_instance._serialize.client_side_validation = False
705
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
706
- # FIXME: this is handwritten
707
- if api_version == 'v3.0':
708
- return await mixin_instance.languages(documents, model_version, show_stats, **kwargs)
709
- elif api_version == 'v3.1':
710
- return await mixin_instance.languages(documents, model_version, show_stats, logging_opt_out, **kwargs)
711
-
712
- async def sentiment(
713
- self,
714
- documents: List[_models.MultiLanguageInput],
715
- model_version: Optional[str] = None,
716
- show_stats: Optional[bool] = None,
717
- logging_opt_out: Optional[bool] = None,
718
- opinion_mining: Optional[bool] = None,
719
- string_index_type: Optional[Union[str, "_models.StringIndexType"]] = None,
720
- **kwargs: Any
721
- ) -> _models.SentimentResponse:
722
- """Sentiment.
723
-
724
- The API returns a detailed sentiment analysis for the input text. The analysis is done in
725
- multiple levels of granularity, start from the a document level, down to sentence and key terms
726
- (targets and assessments).
727
-
728
- :param documents: The set of documents to process as part of this batch. Required.
729
- :type documents: list[~azure.ai.textanalytics.v3_1.models.MultiLanguageInput]
730
- :param model_version: (Optional) This value indicates which model will be used for scoring. If
731
- a model-version is not specified, the API should default to the latest, non-preview version.
732
- Default value is None.
733
- :type model_version: str
734
- :param show_stats: (Optional) if set to true, response will contain request and document level
735
- statistics. Default value is None.
736
- :type show_stats: bool
737
- :param logging_opt_out: (Optional) If set to true, you opt-out of having your text input logged
738
- for troubleshooting. By default, Text Analytics logs your input text for 48 hours, solely to
739
- allow for troubleshooting issues in providing you with the Text Analytics natural language
740
- processing functions. Setting this parameter to true, disables input logging and may limit our
741
- ability to remediate issues that occur. Please see Cognitive Services Compliance and Privacy
742
- notes at https://aka.ms/cs-compliance for additional details, and Microsoft Responsible AI
743
- principles at https://www.microsoft.com/en-us/ai/responsible-ai. Default value is None.
744
- :type logging_opt_out: bool
745
- :param opinion_mining: (Optional) if set to true, response will contain not only sentiment
746
- prediction but also opinion mining (aspect-based sentiment analysis) results. Default value is
747
- None.
748
- :type opinion_mining: bool
749
- :param string_index_type: (Optional) Specifies the method used to interpret string offsets.
750
- Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information
751
- see https://aka.ms/text-analytics-offsets. Known values are: "TextElement_v8",
752
- "UnicodeCodePoint", and "Utf16CodeUnit". Default value is None.
753
- :type string_index_type: str or ~azure.ai.textanalytics.v3_1.models.StringIndexType
754
- :keyword callable cls: A custom type or function that will be passed the direct response
755
- :return: SentimentResponse or the result of cls(response)
756
- :rtype: ~azure.ai.textanalytics.v3_1.models.SentimentResponse
757
- :raises ~azure.core.exceptions.HttpResponseError:
758
- """
759
- api_version = self._get_api_version('sentiment')
760
- if api_version == 'v3.0':
761
- from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
762
- elif api_version == 'v3.1':
763
- from ..v3_1.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
764
- else:
765
- raise ValueError("API version {} does not have operation 'sentiment'".format(api_version))
766
- mixin_instance = OperationClass()
767
- mixin_instance._client = self._client
768
- mixin_instance._config = self._config
769
- mixin_instance._serialize = Serializer(self._models_dict(api_version))
770
- mixin_instance._serialize.client_side_validation = False
771
- mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
772
- # FIXME: this is handwritten
773
- if api_version == 'v3.0':
774
- return await mixin_instance.sentiment(documents, model_version, show_stats, **kwargs)
775
- elif api_version == 'v3.1':
776
- return await mixin_instance.sentiment(documents, model_version, show_stats, logging_opt_out, opinion_mining, string_index_type, **kwargs)