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