@azure/ai-text-analytics 5.2.0-beta.2 → 6.0.0-alpha.20220516.1

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +375 -133
  3. package/dist/index.js +2797 -4176
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/src/azureKeyCredentialPolicy.js +2 -2
  6. package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
  7. package/dist-esm/src/constants.js +16 -0
  8. package/dist-esm/src/constants.js.map +1 -0
  9. package/dist-esm/src/generated/generatedClient.js +80 -334
  10. package/dist-esm/src/generated/generatedClient.js.map +1 -1
  11. package/dist-esm/src/generated/index.js +1 -1
  12. package/dist-esm/src/generated/index.js.map +1 -1
  13. package/dist-esm/src/generated/models/index.js +106 -35
  14. package/dist-esm/src/generated/models/index.js.map +1 -1
  15. package/dist-esm/src/generated/models/mappers.js +1625 -2101
  16. package/dist-esm/src/generated/models/mappers.js.map +1 -1
  17. package/dist-esm/src/generated/models/parameters.js +18 -105
  18. package/dist-esm/src/generated/models/parameters.js.map +1 -1
  19. package/dist-esm/src/generated/operations/analyzeText.js +105 -0
  20. package/dist-esm/src/generated/operations/analyzeText.js.map +1 -0
  21. package/dist-esm/src/generated/operations/index.js +9 -0
  22. package/dist-esm/src/generated/operations/index.js.map +1 -0
  23. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js +9 -0
  24. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js.map +1 -0
  25. package/dist-esm/src/generated/operationsInterfaces/index.js +9 -0
  26. package/dist-esm/src/generated/operationsInterfaces/index.js.map +1 -0
  27. package/dist-esm/src/index.js +14 -5
  28. package/dist-esm/src/index.js.map +1 -1
  29. package/dist-esm/src/lro.js +195 -0
  30. package/dist-esm/src/lro.js.map +1 -0
  31. package/dist-esm/src/models.js +42 -0
  32. package/dist-esm/src/models.js.map +1 -0
  33. package/dist-esm/src/textAnalysisClient.js +197 -0
  34. package/dist-esm/src/textAnalysisClient.js.map +1 -0
  35. package/dist-esm/src/transforms.js +279 -0
  36. package/dist-esm/src/transforms.js.map +1 -0
  37. package/dist-esm/src/util.js +35 -141
  38. package/dist-esm/src/util.js.map +1 -1
  39. package/package.json +24 -32
  40. package/types/ai-text-analytics.d.ts +1402 -1421
  41. package/LICENSE +0 -21
  42. package/dist-esm/src/analyzeActionsResult.js +0 -205
  43. package/dist-esm/src/analyzeActionsResult.js.map +0 -1
  44. package/dist-esm/src/analyzeHealthcareEntitiesResult.js +0 -53
  45. package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +0 -1
  46. package/dist-esm/src/analyzeLro.js +0 -132
  47. package/dist-esm/src/analyzeLro.js.map +0 -1
  48. package/dist-esm/src/analyzeSentimentResult.js +0 -74
  49. package/dist-esm/src/analyzeSentimentResult.js.map +0 -1
  50. package/dist-esm/src/analyzeSentimentResultArray.js +0 -11
  51. package/dist-esm/src/analyzeSentimentResultArray.js.map +0 -1
  52. package/dist-esm/src/detectLanguageResult.js +0 -17
  53. package/dist-esm/src/detectLanguageResult.js.map +0 -1
  54. package/dist-esm/src/detectLanguageResultArray.js +0 -11
  55. package/dist-esm/src/detectLanguageResultArray.js.map +0 -1
  56. package/dist-esm/src/extractKeyPhrasesResult.js +0 -17
  57. package/dist-esm/src/extractKeyPhrasesResult.js.map +0 -1
  58. package/dist-esm/src/extractKeyPhrasesResultArray.js +0 -11
  59. package/dist-esm/src/extractKeyPhrasesResultArray.js.map +0 -1
  60. package/dist-esm/src/extractSummaryResult.js +0 -17
  61. package/dist-esm/src/extractSummaryResult.js.map +0 -1
  62. package/dist-esm/src/extractSummaryResultArray.js +0 -11
  63. package/dist-esm/src/extractSummaryResultArray.js.map +0 -1
  64. package/dist-esm/src/generated/generatedClientContext.js +0 -42
  65. package/dist-esm/src/generated/generatedClientContext.js.map +0 -1
  66. package/dist-esm/src/healthLro.js +0 -139
  67. package/dist-esm/src/healthLro.js.map +0 -1
  68. package/dist-esm/src/multiCategoryClassifyResult.js +0 -17
  69. package/dist-esm/src/multiCategoryClassifyResult.js.map +0 -1
  70. package/dist-esm/src/multiCategoryClassifyResultArray.js +0 -11
  71. package/dist-esm/src/multiCategoryClassifyResultArray.js.map +0 -1
  72. package/dist-esm/src/pollerModels.js +0 -4
  73. package/dist-esm/src/pollerModels.js.map +0 -1
  74. package/dist-esm/src/recognizeCategorizedEntitiesResult.js +0 -17
  75. package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +0 -1
  76. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +0 -11
  77. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +0 -1
  78. package/dist-esm/src/recognizeCustomEntitiesResult.js +0 -17
  79. package/dist-esm/src/recognizeCustomEntitiesResult.js.map +0 -1
  80. package/dist-esm/src/recognizeCustomEntitiesResultArray.js +0 -11
  81. package/dist-esm/src/recognizeCustomEntitiesResultArray.js.map +0 -1
  82. package/dist-esm/src/recognizeLinkedEntitiesResult.js +0 -17
  83. package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +0 -1
  84. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +0 -11
  85. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +0 -1
  86. package/dist-esm/src/recognizePiiEntitiesResult.js +0 -18
  87. package/dist-esm/src/recognizePiiEntitiesResult.js.map +0 -1
  88. package/dist-esm/src/recognizePiiEntitiesResultArray.js +0 -11
  89. package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +0 -1
  90. package/dist-esm/src/singleCategoryClassifyResult.js +0 -17
  91. package/dist-esm/src/singleCategoryClassifyResult.js.map +0 -1
  92. package/dist-esm/src/singleCategoryClassifyResultArray.js +0 -11
  93. package/dist-esm/src/singleCategoryClassifyResultArray.js.map +0 -1
  94. package/dist-esm/src/textAnalyticsAction.js +0 -4
  95. package/dist-esm/src/textAnalyticsAction.js.map +0 -1
  96. package/dist-esm/src/textAnalyticsClient.js +0 -511
  97. package/dist-esm/src/textAnalyticsClient.js.map +0 -1
  98. package/dist-esm/src/textAnalyticsOperationOptions.js +0 -4
  99. package/dist-esm/src/textAnalyticsOperationOptions.js.map +0 -1
  100. package/dist-esm/src/textAnalyticsResult.js +0 -94
  101. package/dist-esm/src/textAnalyticsResult.js.map +0 -1
  102. package/dist-esm/src/tracing.js +0 -12
  103. package/dist-esm/src/tracing.js.map +0 -1
@@ -1,3 +1,13 @@
1
+ /**
2
+ * [Azure Cognitive Language Services](https://docs.microsoft.com/azure/cognitive-services/language-service/overview)
3
+ * is a suite of natural language processing (NLP) skills built with
4
+ * best-in-class Microsoft machine learning algorithms used to analyze
5
+ * unstructured text for actions such as sentiment analysis, key phrase
6
+ * extraction, and language detection.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+
1
11
  import { AzureKeyCredential } from '@azure/core-auth';
2
12
  import { CommonClientOptions } from '@azure/core-client';
3
13
  import { KeyCredential } from '@azure/core-auth';
@@ -7,401 +17,429 @@ import { PollerLike } from '@azure/core-lro';
7
17
  import { PollOperationState } from '@azure/core-lro';
8
18
  import { TokenCredential } from '@azure/core-auth';
9
19
 
10
- /**
11
- * An interface representing the state of an analysis poller operation.
12
- */
13
- export declare interface AnalysisPollOperationState<TResult> extends PollOperationState<TResult>, OperationMetadata {
20
+ /** Configuration common to all actions. */
21
+ export declare interface ActionCommon {
22
+ /**
23
+ * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Cognitive Language Service logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true, disables in logging and may limit our ability to remediate issues that occur.
24
+ *
25
+ * Default is false.
26
+ */
27
+ disableServiceLogs?: boolean;
14
28
  }
15
29
 
30
+ /** Parameters object for a text analysis task using custom models. */
31
+ export declare type ActionCustom = ActionCommon & {
32
+ projectName: string;
33
+ deploymentName: string;
34
+ };
35
+
16
36
  /**
17
- * The metadata for beginAnalyzeActions operations.
37
+ * Action metadata.
18
38
  */
19
- export declare interface AnalyzeActionsOperationMetadata extends OperationMetadata {
20
- /**
21
- * Number of successfully completed actions.
22
- */
23
- actionsSucceededCount: number;
39
+ export declare interface ActionMetadata {
24
40
  /**
25
- * Number of failed actions.
26
- */
27
- actionsFailedCount: number;
28
- /**
29
- * Number of actions still in progress.
41
+ * The model version used to perform the action.
30
42
  */
31
- actionsInProgressCount: number;
43
+ readonly modelVersion: string;
44
+ }
45
+
46
+ /** Configuration common to all actions that use prebuilt models. */
47
+ export declare type ActionPrebuilt = ActionCommon & {
48
+ /** The version of the model to be used by the action. */
49
+ modelVersion?: string;
50
+ };
51
+
52
+ /**
53
+ * Type of actions supported by the {@link TextAnalysisClient.analyze} method.
54
+ */
55
+ export declare type AnalyzeActionName = keyof typeof AnalyzeActionNames;
56
+
57
+ /**
58
+ * Type of actions supported by the {@link TextAnalysisClient.analyze} method.
59
+ */
60
+ export declare const AnalyzeActionNames: {
61
+ readonly EntityLinking: "EntityLinking";
62
+ readonly EntityRecognition: "EntityRecognition";
63
+ readonly KeyPhraseExtraction: "KeyPhraseExtraction";
64
+ readonly PiiEntityRecognition: "PiiEntityRecognition";
65
+ readonly LanguageDetection: "LanguageDetection";
66
+ readonly SentimentAnalysis: "SentimentAnalysis";
67
+ };
68
+
69
+ /**
70
+ * The type of parameters for every action in ${@link AnalyzeActionNames}.
71
+ */
72
+ export declare type AnalyzeActionParameters<ActionName extends AnalyzeActionName> = {
73
+ EntityLinking: EntityLinkingAction;
74
+ EntityRecognition: EntityRecognitionAction;
75
+ PiiEntityRecognition: PiiEntityRecognitionAction;
76
+ KeyPhraseExtraction: KeyPhraseExtractionAction;
77
+ SentimentAnalysis: SentimentAnalysisAction;
78
+ LanguageDetection: LanguageDetectionAction;
79
+ }[ActionName];
80
+
81
+ /**
82
+ * Batch of actions.
83
+ */
84
+ export declare type AnalyzeBatchAction = EntityLinkingBatchAction | EntityRecognitionBatchAction | KeyPhraseExtractionBatchAction | PiiEntityRecognitionBatchAction | HealthcareBatchAction | ExtractiveSummarizationBatchAction | SentimentAnalysisBatchAction | CustomEntityRecognitionBatchAction | CustomSingleLabelClassificationBatchAction | CustomMultiLabelClassificationBatchAction;
85
+
86
+ /**
87
+ * Options common to all batch actions.
88
+ */
89
+ export declare interface AnalyzeBatchActionCommon {
32
90
  /**
33
- * The operation's display name.
91
+ * The name of the action.
34
92
  */
35
- displayName?: string;
93
+ actionName?: string;
36
94
  }
37
95
 
38
96
  /**
39
- * The state of the begin analyze polling operation.
97
+ * Type of actions supported by the {@link TextAnalysisClient.beginAnalyzeBatch} method.
40
98
  */
41
- export declare interface AnalyzeActionsOperationState extends AnalysisPollOperationState<PagedAnalyzeActionsResult>, AnalyzeActionsOperationMetadata {
42
- }
99
+ export declare type AnalyzeBatchActionName = keyof typeof AnalyzeBatchActionNames;
43
100
 
44
101
  /**
45
- * Result type of the Begin Analyze Actions Long-Running-Operation (LRO).
102
+ * Type of actions supported by the {@link TextAnalysisClient.beginAnalyzeBatch} method.
46
103
  */
47
- export declare type AnalyzeActionsPollerLike = PollerLike<AnalyzeActionsOperationState, PagedAnalyzeActionsResult>;
104
+ export declare const AnalyzeBatchActionNames: {
105
+ readonly SentimentAnalysis: "SentimentAnalysis";
106
+ readonly EntityRecognition: "EntityRecognition";
107
+ readonly PiiEntityRecognition: "PiiEntityRecognition";
108
+ readonly KeyPhraseExtraction: "KeyPhraseExtraction";
109
+ readonly EntityLinking: "EntityLinking";
110
+ readonly Healthcare: "Healthcare";
111
+ readonly ExtractiveSummarization: "ExtractiveSummarization";
112
+ readonly CustomEntityRecognition: "CustomEntityRecognition";
113
+ readonly CustomSingleLabelClassification: "CustomSingleLabelClassification";
114
+ readonly CustomMultiLabelClassification: "CustomMultiLabelClassification";
115
+ };
48
116
 
49
117
  /**
50
- * The results of an analyze Actions operation.
118
+ * The metadata for long-running operations started by {@link TextAnalysisClient.beginAnalyzeBatch}.
51
119
  */
52
- export declare interface AnalyzeActionsResult {
120
+ export declare interface AnalyzeBatchOperationMetadata {
53
121
  /**
54
- * Array of the results for each categorized entities recognition action.
122
+ * The date and time the operation was created.
55
123
  */
56
- recognizeEntitiesResults: RecognizeCategorizedEntitiesActionResult[];
124
+ readonly createdOn: Date;
57
125
  /**
58
- * Array of the results for each Pii entities recognition action.
126
+ * The date and time when the operation results will expire on the server.
59
127
  */
60
- recognizePiiEntitiesResults: RecognizePiiEntitiesActionResult[];
128
+ readonly expiresOn?: Date;
61
129
  /**
62
- * Array of the results for each key phrases extraction action.
130
+ * The operation id.
63
131
  */
64
- extractKeyPhrasesResults: ExtractKeyPhrasesActionResult[];
132
+ readonly operationId: string;
65
133
  /**
66
- * Array of the results for each linked entities recognition action.
134
+ * The time the operation status was last updated.
67
135
  */
68
- recognizeLinkedEntitiesResults: RecognizeLinkedEntitiesActionResult[];
136
+ readonly lastModifiedOn: Date;
69
137
  /**
70
- * Array of the results for each analyze sentiment action.
138
+ * The current status of the operation.
71
139
  */
72
- analyzeSentimentResults: AnalyzeSentimentActionResult[];
140
+ readonly status: OperationStatus;
73
141
  /**
74
- * Array of the results for each extract summary action.
142
+ * Number of successfully completed actions.
75
143
  */
76
- extractSummaryResults: ExtractSummaryActionResult[];
144
+ readonly actionSucceededCount: number;
77
145
  /**
78
- * Array of the results for each recognize custom entities action.
146
+ * Number of failed actions.
79
147
  */
80
- recognizeCustomEntitiesResults: RecognizeCustomEntitiesActionResult[];
148
+ readonly actionFailedCount: number;
81
149
  /**
82
- * Array of the results for each custom classify document single category action.
150
+ * Number of actions still in progress.
83
151
  */
84
- singleCategoryClassifyResults: SingleCategoryClassifyActionResult[];
152
+ readonly actionInProgressCount: number;
85
153
  /**
86
- * Array of the results for each custom classify document multi category action.
154
+ * The operation's display name.
87
155
  */
88
- multiCategoryClassifyResults: MultiCategoryClassifyActionResult[];
156
+ readonly displayName?: string;
89
157
  }
90
158
 
91
159
  /**
92
- * An error result from the healthcare operation on a single document.
160
+ * The state of the begin analyze polling operation.
93
161
  */
94
- export declare type AnalyzeHealthcareEntitiesErrorResult = TextAnalyticsErrorResult;
162
+ export declare interface AnalyzeBatchOperationState extends PollOperationState<PagedAnalyzeBatchResult>, AnalyzeBatchOperationMetadata {
163
+ }
95
164
 
96
165
  /**
97
- * Result type of the Health Long-Running-Operation (LRO)
166
+ * A poller that polls long-running operations started by {@link TextAnalysisClient.beginAnalyzeBatch}.
98
167
  */
99
- export declare type AnalyzeHealthcareEntitiesPollerLike = PollerLike<AnalyzeHealthcareOperationState, PagedAnalyzeHealthcareEntitiesResult>;
168
+ export declare type AnalyzeBatchPoller = PollerLike<AnalyzeBatchOperationState, PagedAnalyzeBatchResult>;
100
169
 
101
170
  /**
102
- * The result of the healthcare operation on a single document.
171
+ * Results of a batch of actions.
103
172
  */
104
- export declare type AnalyzeHealthcareEntitiesResult = AnalyzeHealthcareEntitiesSuccessResult | AnalyzeHealthcareEntitiesErrorResult;
173
+ export declare type AnalyzeBatchResult = EntityLinkingBatchResult | EntityRecognitionBatchResult | KeyPhraseExtractionBatchResult | PiiEntityRecognitionBatchResult | SentimentAnalysisBatchResult | HealthcareBatchResult | ExtractiveSummarizationBatchResult | CustomEntityRecognitionBatchResult | CustomSingleLabelClassificationBatchResult | CustomMultiLabelClassificationBatchResult;
105
174
 
106
175
  /**
107
- * Array of {@link AnalyzeHealthcareEntitiesResult}
176
+ * The type of results of every action in ${@link AnalyzeActionNames}.
108
177
  */
109
- export declare interface AnalyzeHealthcareEntitiesResultArray extends Array<AnalyzeHealthcareEntitiesResult> {
178
+ export declare type AnalyzeResult<ActionName extends AnalyzeActionName> = {
179
+ EntityLinking: EntityLinkingResult[];
180
+ EntityRecognition: EntityRecognitionResult[];
181
+ PiiEntityRecognition: PiiEntityRecognitionResult[];
182
+ KeyPhraseExtraction: KeyPhraseExtractionResult[];
183
+ SentimentAnalysis: SentimentAnalysisResult[];
184
+ LanguageDetection: LanguageDetectionResult[];
185
+ }[ActionName];
186
+
187
+ /** An object that contains the predicted sentiment, confidence scores and other information about an assessment of a target. For example, in the sentence "The food is good", the assessment of the target 'food' is 'good'. */
188
+ export declare interface AssessmentSentiment {
189
+ /** Assessment sentiment in the sentence. */
190
+ sentiment: TokenSentimentLabel;
191
+ /** Assessment sentiment confidence scores in the sentence. */
192
+ confidenceScores: TargetConfidenceScores;
193
+ /** The assessment offset from the start of the sentence. */
194
+ offset: number;
195
+ /** The length of the assessment. */
196
+ length: number;
197
+ /** The assessment text detected. */
198
+ text: string;
199
+ /** The indicator representing if the assessment is negated. */
200
+ isNegated: boolean;
110
201
  }
111
202
 
203
+ /** Defines values for Association. */
204
+ export declare type Association = "subject" | "other";
205
+
206
+ export { AzureKeyCredential }
207
+
112
208
  /**
113
- * The results of a successful healthcare operation for a single document.
209
+ * The error of an analyze batch action.
114
210
  */
115
- export declare interface AnalyzeHealthcareEntitiesSuccessResult extends TextAnalyticsSuccessResult {
211
+ export declare interface BatchActionErrorResult<Kind extends AnalyzeBatchActionName> extends BatchActionState<Kind> {
116
212
  /**
117
- * Healthcare entities.
213
+ * When this action was completed by the service.
118
214
  */
119
- entities: HealthcareEntity[];
215
+ readonly failedOn: Date;
120
216
  /**
121
- * Relations between healthcare entities.
217
+ * The Error for this action result.
122
218
  */
123
- entityRelations: HealthcareEntityRelation[];
219
+ readonly error: TextAnalysisError;
124
220
  }
125
221
 
126
222
  /**
127
- * The state of the begin analyze healthcare polling operation.
223
+ * The result of a batched action.
128
224
  */
129
- export declare interface AnalyzeHealthcareOperationState extends AnalysisPollOperationState<PagedAnalyzeHealthcareEntitiesResult> {
130
- }
225
+ export declare type BatchActionResult<T, Kind extends AnalyzeBatchActionName> = BatchActionSuccessResult<T, Kind> | BatchActionErrorResult<Kind>;
131
226
 
132
- /**
133
- * Options for an analyze sentiment action.
134
- */
135
- export declare interface AnalyzeSentimentAction extends TextAnalyticsAction {
227
+ /** The State of a batched action */
228
+ export declare interface BatchActionState<Kind extends AnalyzeBatchActionName> {
136
229
  /**
137
- * Specifies the measurement unit used to calculate the offset and length properties.
138
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
139
- * The default is the JavaScript's default which is "Utf16CodeUnit".
230
+ * The kind of the action results.
140
231
  */
141
- stringIndexType?: StringIndexType;
232
+ readonly kind: Kind;
142
233
  /**
143
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
144
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
145
- * disables input logging and may limit our ability to remediate issues that occur.
234
+ * The name of the action.
146
235
  */
147
- disableServiceLogs?: boolean;
236
+ readonly actionName?: string;
148
237
  /**
149
- * Whether to mine the opinions of a sentence and conduct more granular
150
- * analysis around the aspects of a product or service (also known as
151
- * aspect-based sentiment analysis). If set to true, the returned
152
- * `SentenceSentiment` objects will have property `opinions` containing
153
- * the result of this analysis.
154
- * More information about the feature can be found here: {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis?tabs=version-3-1#opinion-mining}
238
+ * Action statistics.
155
239
  */
156
- includeOpinionMining?: boolean;
240
+ readonly statistics?: TextDocumentBatchStatistics;
157
241
  }
158
242
 
159
243
  /**
160
- * The error of an analyze sentiment action.
161
- */
162
- export declare type AnalyzeSentimentActionErrorResult = TextAnalyticsActionErrorResult;
163
-
164
- /**
165
- * The result of an analyze sentiment action.
166
- */
167
- export declare type AnalyzeSentimentActionResult = AnalyzeSentimentActionSuccessResult | AnalyzeSentimentActionErrorResult;
168
-
169
- /**
170
- * The results of a succeeded analyze sentiment action.
244
+ * The state of a succeeded batched action.
171
245
  */
172
- export declare interface AnalyzeSentimentActionSuccessResult extends TextAnalyticsActionSuccessState {
246
+ export declare interface BatchActionSuccessResult<T, Kind extends AnalyzeBatchActionName> extends BatchActionState<Kind> {
247
+ /**
248
+ * The list of document results.
249
+ */
250
+ readonly results: T[];
251
+ /**
252
+ * When this action was completed by the service.
253
+ */
254
+ readonly completedOn: Date;
173
255
  /**
174
- * Array of the results for each analyze sentiment action.
256
+ * Discriminant to determine if that this is an error result.
175
257
  */
176
- results: AnalyzeSentimentResultArray;
258
+ readonly error?: undefined;
177
259
  }
178
260
 
179
261
  /**
180
- * An error result from the analyze sentiment operation on a single document.
181
- */
182
- export declare type AnalyzeSentimentErrorResult = TextAnalyticsErrorResult;
183
-
184
- /**
185
- * Options for the analyze sentiment operation.
262
+ * Options for the begin analyze actions operation.
186
263
  */
187
- export declare interface AnalyzeSentimentOptions extends TextAnalyticsOperationOptions {
264
+ export declare interface BeginAnalyzeBatchOptions extends TextAnalysisOperationOptions {
188
265
  /**
189
- * Whether to mine the opinions of a sentence and conduct more granular
190
- * analysis around the aspects of a product or service (also known as
191
- * aspect-based sentiment analysis). If set to true, the returned
192
- * `SentenceSentiment` objects will have property `opinions` containing
193
- * the result of this analysis.
194
- * More information about the feature can be found here: {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis?tabs=version-3-1#opinion-mining}
266
+ * Time delay between poll requests, in milliseconds.
195
267
  */
196
- includeOpinionMining?: boolean;
268
+ updateIntervalInMs?: number;
197
269
  /**
198
- * Specifies the measurement unit used to calculate the offset and length properties.
199
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
200
- * The default is the JavaScript's default which is "Utf16CodeUnit".
270
+ * The operation's display name.
201
271
  */
202
- stringIndexType?: StringIndexType;
272
+ displayName?: string;
203
273
  }
204
274
 
205
- /**
206
- * The result of the analyze sentiment operation on a single document.
207
- */
208
- export declare type AnalyzeSentimentResult = AnalyzeSentimentSuccessResult | AnalyzeSentimentErrorResult;
275
+ /** Defines values for Certainty. */
276
+ export declare type Certainty = "positive" | "positivePossible" | "neutralPossible" | "negativePossible" | "negative";
277
+
278
+ /** A classification result from a custom classify document single category action */
279
+ export declare interface ClassificationCategory {
280
+ /** Classification type. */
281
+ category: string;
282
+ /** Confidence score between 0 and 1 of the recognized class. */
283
+ confidenceScore: number;
284
+ }
285
+
286
+ /** Defines values for Conditionality. */
287
+ export declare type Conditionality = "hypothetical" | "conditional";
209
288
 
210
289
  /**
211
- * Array of `AnalyzeSentimentResult` objects corresponding to a batch of input documents, and
212
- * annotated with information about the batch operation.
290
+ * Custom action metadata.
213
291
  */
214
- export declare interface AnalyzeSentimentResultArray extends Array<AnalyzeSentimentResult> {
292
+ export declare interface CustomActionMetadata {
215
293
  /**
216
- * Statistics about the input document batch and how it was processed
217
- * by the service. This property will have a value when includeStatistics is set to true
218
- * in the client call.
294
+ * The name of the project used to perform the action.
219
295
  */
220
- statistics?: TextDocumentBatchStatistics;
296
+ readonly projectName: string;
221
297
  /**
222
- * The version of the text analytics model used by this operation on this
223
- * batch of input documents.
298
+ * The name of the deployment used to perform the action.
224
299
  */
225
- modelVersion: string;
300
+ readonly deploymentName: string;
226
301
  }
227
302
 
228
- /**
229
- * The result of the analyze sentiment operation on a single document,
230
- * containing the predicted sentiment for each sentence as well as for the full document.
231
- */
232
- export declare interface AnalyzeSentimentSuccessResult extends TextAnalyticsSuccessResult {
233
- /**
234
- * Predicted sentiment for document. Possible values
235
- * include: 'positive', 'neutral', 'negative', 'mixed'
236
- */
237
- sentiment: DocumentSentimentLabel;
303
+ /** Supported parameters for a Custom Entities task. */
304
+ export declare type CustomEntityRecognitionAction = ActionCustom & {
238
305
  /**
239
- * Document level sentiment confidence scores between 0 and 1 for each sentiment class.
306
+ * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
307
+ *
308
+ * The default is the JavaScript's default which is "Utf16CodeUnit".
240
309
  */
241
- confidenceScores: SentimentConfidenceScores;
310
+ stringIndexType?: StringIndexType;
311
+ };
312
+
313
+ /** Options for a custom entity recognition batch action. */
314
+ export declare interface CustomEntityRecognitionBatchAction extends AnalyzeBatchActionCommon, CustomEntityRecognitionAction {
242
315
  /**
243
- * The predicted sentiment for each sentence in the corresponding document.
316
+ * The kind of the action.
244
317
  */
245
- sentences: SentenceSentiment[];
318
+ kind: "CustomEntityRecognition";
246
319
  }
247
320
 
248
321
  /**
249
- * AssessmentSentiment contains the predicted sentiment, confidence scores and
250
- * other information about an assessment of a target. For example, in the sentence
251
- * "The food is good", the assessment of the target 'food' is 'good'.
322
+ * The result of a custom entity recognition batch action.
252
323
  */
253
- export declare interface AssessmentSentiment extends SentenceAssessment {
254
- }
324
+ export declare type CustomEntityRecognitionBatchResult = CustomActionMetadata & BatchActionResult<CustomEntityRecognitionResult, "CustomEntityRecognition">;
255
325
 
256
- export { AzureKeyCredential }
326
+ /**
327
+ * An error result from the recognize custom entities operation on a single document.
328
+ */
329
+ export declare type CustomEntityRecognitionErrorResult = TextAnalysisErrorResult;
257
330
 
258
331
  /**
259
- * Options for the begin analyze actions operation.
332
+ * The result of the custom recognize entities operation on a single document.
260
333
  */
261
- export declare interface BeginAnalyzeActionsOptions extends OperationOptions {
262
- /**
263
- * Delay to wait until next poll, in milliseconds.
264
- */
265
- updateIntervalInMs?: number;
266
- /**
267
- * A serialized poller which can be used to resume an existing paused Long-Running-Operation.
268
- */
269
- resumeFrom?: string;
270
- /**
271
- * If set to true, response will contain input and document level statistics.
272
- */
273
- includeStatistics?: boolean;
274
- /**
275
- * The operation's display name.
276
- */
277
- displayName?: string;
278
- }
334
+ export declare type CustomEntityRecognitionResult = CustomEntityRecognitionSuccessResult | CustomEntityRecognitionErrorResult;
279
335
 
280
336
  /**
281
- * Options for the begin analyze healthcare entities operation.
337
+ * The result of the recognize custom entities operation on a single document,
338
+ * containing a collection of the entities identified in that document.
282
339
  */
283
- export declare interface BeginAnalyzeHealthcareEntitiesOptions extends TextAnalyticsOperationOptions {
284
- /**
285
- * Delay to wait until next poll, in milliseconds.
286
- */
287
- stringIndexType?: StringIndexType;
340
+ export declare interface CustomEntityRecognitionSuccessResult extends TextAnalysisSuccessResult {
288
341
  /**
289
- * Delay to wait until next poll, in milliseconds.
342
+ * The collection of entities identified in the input document.
290
343
  */
291
- updateIntervalInMs?: number;
344
+ readonly entities: Entity[];
345
+ }
346
+
347
+ /** Options for a multi-label classification custom action */
348
+ export declare type CustomMultiLabelClassificationAction = ActionCustom;
349
+
350
+ /** Options for a custom multi-label classification batch action. */
351
+ export declare interface CustomMultiLabelClassificationBatchAction extends AnalyzeBatchActionCommon, CustomMultiLabelClassificationAction {
292
352
  /**
293
- * A serialized poller which can be used to resume an existing paused Long-Running-Operation.
353
+ * The kind of the action.
294
354
  */
295
- resumeFrom?: string;
355
+ kind: "CustomMultiLabelClassification";
296
356
  }
297
357
 
298
358
  /**
299
- * An entity from text analysis with information about its categorical
300
- * classification.
359
+ * The result of a custom multi-label classification batch action.
301
360
  */
302
- export declare interface CategorizedEntity extends Entity {
303
- }
361
+ export declare type CustomMultiLabelClassificationBatchResult = CustomActionMetadata & BatchActionResult<CustomMultiLabelClassificationResult, "CustomMultiLabelClassification">;
304
362
 
305
363
  /**
306
- * A classification result from a custom classify document single category action
364
+ * An error result from the custom classify document multi category operation on a multi document.
307
365
  */
308
- export declare interface ClassificationCategory extends ClassificationResult {
309
- }
366
+ export declare type CustomMultiLabelClassificationErrorResult = TextAnalysisErrorResult;
310
367
 
311
- export declare interface ClassificationResult {
312
- /** Classification type. */
313
- category: string;
314
- /** Confidence score between 0 and 1 of the recognized classification. */
315
- confidenceScore: number;
316
- }
368
+ /**
369
+ * The result of the custom classify document multi categories operation on a multi document.
370
+ */
371
+ export declare type CustomMultiLabelClassificationResult = CustomMultiLabelClassificationSuccessResult | CustomMultiLabelClassificationErrorResult;
317
372
 
318
373
  /**
319
- * The type of a custom text analytics action.
374
+ * The result of the custom classify document multi categories operation on a multi document,
375
+ * containing the result of the classification.
320
376
  */
321
- export declare interface CustomTextAnalyticsAction {
322
- /**
323
- * The project name for the text analytics model used by this operation on this
324
- * batch of input documents.
325
- */
326
- projectName: string;
377
+ export declare interface CustomMultiLabelClassificationSuccessResult extends TextAnalysisSuccessResult {
327
378
  /**
328
- * The deployment name for the text analytics model used by this operation on this
329
- * batch of input documents.
330
- */
331
- deploymentName: string;
332
- /**
333
- * The preferred name for this action.
379
+ * The collection of classifications in the input document.
334
380
  */
335
- actionName?: string;
381
+ readonly classifications: ClassificationCategory[];
336
382
  }
337
383
 
338
- /** Information about the language of a document as identified by the Text Analytics service. */
339
- export declare interface DetectedLanguage {
340
- /** Long name of a detected language (e.g. English, French). */
341
- name: string;
342
- /** A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr). */
343
- iso6391Name: string;
344
- /** A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. */
345
- confidenceScore: number;
384
+ /** Options for a single-label classification custom action */
385
+ export declare type CustomSingleLabelClassificationAction = ActionCustom;
386
+
387
+ /** Options for a custom single-label classification batch action. */
388
+ export declare interface CustomSingleLabelClassificationBatchAction extends AnalyzeBatchActionCommon, CustomSingleLabelClassificationAction {
389
+ /**
390
+ * The kind of the action.
391
+ */
392
+ kind: "CustomSingleLabelClassification";
346
393
  }
347
394
 
348
395
  /**
349
- * An error result from the detect languge operation on a single document.
396
+ * The result of a custom single-label classification batch action.
350
397
  */
351
- export declare type DetectLanguageErrorResult = TextAnalyticsErrorResult;
352
-
353
- /** An input to the language detection operation. This object specifies a unique document id, as well as the full text of a document and a hint indicating the document's country of origin to assist the text analytics predictive model in detecting the document's language. */
354
- export declare interface DetectLanguageInput {
355
- /** Unique, non-empty document identifier. */
356
- id: string;
357
- text: string;
358
- countryHint?: string;
359
- }
398
+ export declare type CustomSingleLabelClassificationBatchResult = CustomActionMetadata & BatchActionResult<CustomSingleLabelClassificationResult, "CustomSingleLabelClassification">;
360
399
 
361
400
  /**
362
- * Options for the detect languages operation.
401
+ * An error result from the custom classify document single category operation on a single document.
363
402
  */
364
- export declare interface DetectLanguageOptions extends TextAnalyticsOperationOptions {
365
- }
403
+ export declare type CustomSingleLabelClassificationErrorResult = TextAnalysisErrorResult;
366
404
 
367
405
  /**
368
- * The result of the detect language operation on a single document.
406
+ * The result of the custom classify document single category operation on a single document.
369
407
  */
370
- export declare type DetectLanguageResult = DetectLanguageSuccessResult | DetectLanguageErrorResult;
408
+ export declare type CustomSingleLabelClassificationResult = CustomSingleLabelClassificationSuccessResult | CustomSingleLabelClassificationErrorResult;
371
409
 
372
410
  /**
373
- * Array of `DetectLanguageResult` objects corresponding to a batch of input documents, and
374
- * annotated with information about the batch operation.
411
+ * The result of the custom classify document single category operation on a single document,
412
+ * containing the result of the classification.
375
413
  */
376
- export declare interface DetectLanguageResultArray extends Array<DetectLanguageResult> {
377
- /**
378
- * Statistics about the input document batch and how it was processed
379
- * by the service. This property will have a value when includeStatistics is set to true
380
- * in the client call.
381
- */
382
- statistics?: TextDocumentBatchStatistics;
414
+ export declare interface CustomSingleLabelClassificationSuccessResult extends TextAnalysisSuccessResult {
383
415
  /**
384
- * The version of the text analytics model used by this operation on this
385
- * batch of input documents.
416
+ * The collection of classifications in the input document.
386
417
  */
387
- modelVersion: string;
418
+ readonly classifications: ClassificationCategory[];
388
419
  }
389
420
 
390
- /**
391
- * The result of the detect language operation on a single document,
392
- * containing a prediction of what language the document is written in.
393
- */
394
- export declare interface DetectLanguageSuccessResult extends TextAnalyticsSuccessResult {
395
- /**
396
- * The top detected language by confidence score.
397
- */
398
- readonly primaryLanguage: DetectedLanguage;
421
+ /** Information about the language of a document as identified by the Language service. */
422
+ export declare interface DetectedLanguage {
423
+ /** Long name of a detected language (e.g. English, French). */
424
+ name: string;
425
+ /** A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr). */
426
+ iso6391Name: string;
427
+ /** A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. */
428
+ confidenceScore: number;
399
429
  }
400
430
 
401
431
  /** Defines values for DocumentSentimentLabel. */
402
432
  export declare type DocumentSentimentLabel = "positive" | "neutral" | "negative" | "mixed";
403
433
 
404
- /** A word or phrase identified as an entity that is categorized within a taxonomy of types. The set of categories recognized by the Text Analytics service is described at https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types . */
434
+ /** Represents a warning encountered while processing a document. */
435
+ export declare interface DocumentWarning {
436
+ /** Error code. */
437
+ code: WarningCode;
438
+ /** Warning message. */
439
+ message: string;
440
+ }
441
+
442
+ /** A word or phrase identified as an entity that is categorized within a taxonomy of types. The set of categories recognized by the Language service is described at https://docs.microsoft.com/azure/cognitive-services/language-service/named-entity-recognition/concepts/named-entity-categories . */
405
443
  export declare interface Entity {
406
444
  /** Entity text as appears in the request. */
407
445
  text: string;
@@ -417,222 +455,181 @@ export declare interface Entity {
417
455
  confidenceScore: number;
418
456
  }
419
457
 
420
- export declare interface EntityAssertion {
421
- /** Describes any conditionality on the entity. */
422
- conditionality?: EntityConditionality;
423
- /** Describes the entities certainty and polarity. */
424
- certainty?: EntityCertainty;
425
- /** Describes if the entity is the subject of the text or if it describes someone else. */
426
- association?: EntityAssociation;
458
+ /** A type representing a reference for the healthcare entity into a specific entity catalog. */
459
+ export declare interface EntityDataSource {
460
+ /** Entity Catalog. Examples include: UMLS, CHV, MSH, etc. */
461
+ name: string;
462
+ /** Entity id in the given source catalog. */
463
+ entityId: string;
427
464
  }
428
465
 
429
- /** Defines values for Association. */
430
- export declare type EntityAssociation = "subject" | "other";
431
-
432
- /** Defines values for Certainty. */
433
- export declare type EntityCertainty = "positive" | "positivePossible" | "neutralPossible" | "negativePossible" | "negative";
434
-
435
- /** Defines values for Conditionality. */
436
- export declare type EntityConditionality = "hypothetical" | "conditional";
437
-
438
- /**
439
- * A type representing a reference for the healthcare entity into a specific
440
- * entity catalog.
441
- */
442
- export declare interface EntityDataSource {
466
+ /** Options for an entity linking action. */
467
+ export declare type EntityLinkingAction = ActionPrebuilt & {
443
468
  /**
444
- * Entity Catalog. Examples include: UMLS, CHV, MSH, etc.
469
+ * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
470
+ *
471
+ * The default is the JavaScript's default which is "Utf16CodeUnit".
445
472
  */
446
- name: string;
473
+ stringIndexType?: StringIndexType;
474
+ };
475
+
476
+ /** Options for an entity linking batch action. */
477
+ export declare interface EntityLinkingBatchAction extends AnalyzeBatchActionCommon, EntityLinkingAction {
447
478
  /**
448
- * Entity id in the given source catalog.
479
+ * The kind of the action.
449
480
  */
450
- entityId: string;
481
+ kind: "EntityLinking";
451
482
  }
452
483
 
453
484
  /**
454
- * An Error Code returned from the Text Analytics service. Possible
455
- * values include:
456
- *
457
- * For more information about the error, see the `message` property of the associated error.
485
+ * The result of an entity linking batch action.
458
486
  */
459
- export declare type ErrorCode = ErrorCodeValue | InnerErrorCodeValue;
487
+ export declare type EntityLinkingBatchResult = ActionMetadata & BatchActionResult<EntityLinkingResult, "EntityLinking">;
460
488
 
461
489
  /**
462
- * Defines values for ErrorCodeValue. \
463
- * {@link KnownErrorCodeValue} can be used interchangeably with ErrorCodeValue,
464
- * this enum contains the known values that the service supports.
465
- * ### Known values supported by the service
466
- * **InvalidRequest** \
467
- * **InvalidArgument** \
468
- * **InternalServerError** \
469
- * **ServiceUnavailable** \
470
- * **NotFound**
490
+ * An error result from an entity linking action on a single document.
491
+ */
492
+ export declare type EntityLinkingErrorResult = TextAnalysisErrorResult;
493
+
494
+ /**
495
+ * The result of an entity linking action on a single document.
471
496
  */
472
- export declare type ErrorCodeValue = string;
497
+ export declare type EntityLinkingResult = EntityLinkingSuccessResult | EntityLinkingErrorResult;
473
498
 
474
499
  /**
475
- * Options for a key phrases recognition action.
500
+ * The result of a entity linking action on a single document, containing a
501
+ * collection of the {@link LinkedEntity} objects identified in that document.
476
502
  */
477
- export declare interface ExtractKeyPhrasesAction extends TextAnalyticsAction {
503
+ export declare interface EntityLinkingSuccessResult extends TextAnalysisSuccessResult {
478
504
  /**
479
- * If set to false, you opt-in to have your text input logged for troubleshooting. By default, Text Analytics
480
- * will not log your input text for pii entities recognition. Setting this parameter to false,
481
- * enables input logging.
505
+ * The collection of entities identified in the input document.
482
506
  */
483
- disableServiceLogs?: boolean;
507
+ readonly entities: LinkedEntity[];
484
508
  }
485
509
 
486
- /**
487
- * The error of a extract key phrases action.
488
- */
489
- export declare type ExtractKeyPhrasesActionErrorResult = TextAnalyticsActionErrorResult;
490
-
491
- /**
492
- * The result of a extract key phrases action.
493
- */
494
- export declare type ExtractKeyPhrasesActionResult = ExtractKeyPhrasesActionSuccessResult | ExtractKeyPhrasesActionErrorResult;
510
+ /** Options for an entity recognition action. */
511
+ export declare type EntityRecognitionAction = ActionPrebuilt & {
512
+ /**
513
+ * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
514
+ *
515
+ * The default is the JavaScript's default which is "Utf16CodeUnit".
516
+ */
517
+ stringIndexType?: StringIndexType;
518
+ };
495
519
 
496
- /**
497
- * The results of a succeeded extract key phrases action.
498
- */
499
- export declare interface ExtractKeyPhrasesActionSuccessResult extends TextAnalyticsActionSuccessState {
520
+ /** Options for an entity recognition batch action. */
521
+ export declare interface EntityRecognitionBatchAction extends AnalyzeBatchActionCommon, EntityRecognitionAction {
500
522
  /**
501
- * Array of the results for each extract key phrases action.
523
+ * The kind of the action.
502
524
  */
503
- results: ExtractKeyPhrasesResultArray;
525
+ kind: "EntityRecognition";
504
526
  }
505
527
 
506
528
  /**
507
- * An error result from the extract key phrases operation on a single document.
529
+ * The result of an entity recognition batch action.
508
530
  */
509
- export declare type ExtractKeyPhrasesErrorResult = TextAnalyticsErrorResult;
510
-
511
- /**
512
- * Options for the extract key phrases operation.
513
- */
514
- export declare interface ExtractKeyPhrasesOptions extends TextAnalyticsOperationOptions {
515
- }
531
+ export declare type EntityRecognitionBatchResult = ActionMetadata & BatchActionResult<EntityRecognitionResult, "EntityRecognition">;
516
532
 
517
533
  /**
518
- * The result of the extract key phrases operation on a single document.
534
+ * An error result from an entity recognition action on a single document.
519
535
  */
520
- export declare type ExtractKeyPhrasesResult = ExtractKeyPhrasesSuccessResult | ExtractKeyPhrasesErrorResult;
536
+ export declare type EntityRecognitionErrorResult = TextAnalysisErrorResult;
521
537
 
522
538
  /**
523
- * Array of `ExtractKeyPhrasesResult` objects corresponding to a batch of input documents, and
524
- * annotated with information about the batch operation.
539
+ * The result of an entity recognition action on a single document.
525
540
  */
526
- export declare interface ExtractKeyPhrasesResultArray extends Array<ExtractKeyPhrasesResult> {
527
- /**
528
- * Statistics about the input document batch and how it was processed
529
- * by the service. This property will have a value when includeStatistics is set to true
530
- * in the client call.
531
- */
532
- statistics?: TextDocumentBatchStatistics;
533
- /**
534
- * The version of the text analytics model used by this operation on this
535
- * batch of input documents.
536
- */
537
- modelVersion: string;
538
- }
541
+ export declare type EntityRecognitionResult = EntityRecognitionSuccessResult | EntityRecognitionErrorResult;
539
542
 
540
543
  /**
541
- * The result of the extract key phrases operation on a single document,
542
- * containing a collection of the key phrases identified in that document.
544
+ * The result of an entity recognition action on a single document, containing
545
+ * a collection of {@link Entity} objects identified in that document.
543
546
  */
544
- export declare interface ExtractKeyPhrasesSuccessResult extends TextAnalyticsSuccessResult {
547
+ export declare interface EntityRecognitionSuccessResult extends TextAnalysisSuccessResult {
545
548
  /**
546
- * A list of representative words or phrases. The number of key phrases returned is proportional
547
- * to the number of words in the input document.
549
+ * The collection of entities identified in the input document.
548
550
  */
549
- keyPhrases: string[];
551
+ readonly entities: Entity[];
550
552
  }
551
553
 
552
- /**
553
- * Options for an extract summary action.
554
- */
555
- export declare interface ExtractSummaryAction extends TextAnalyticsAction {
554
+ /** Supported parameters for an Extractive Summarization task. */
555
+ export declare type ExtractiveSummarizationAction = ActionPrebuilt & {
556
+ maxSentenceCount?: number;
557
+ /** The sorting criteria to use for the results of Extractive Summarization. */
558
+ orderBy?: ExtractiveSummarizationOrderingCriteria;
556
559
  /**
557
- * Specifies the measurement unit used to calculate the offset and length properties.
558
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
560
+ * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
561
+ *
559
562
  * The default is the JavaScript's default which is "Utf16CodeUnit".
560
563
  */
561
564
  stringIndexType?: StringIndexType;
565
+ };
566
+
567
+ /** Options for an extractive summarization batch action. */
568
+ export declare interface ExtractiveSummarizationBatchAction extends AnalyzeBatchActionCommon, ExtractiveSummarizationAction {
562
569
  /**
563
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
564
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
565
- * disables input logging and may limit our ability to remediate issues that occur.
566
- */
567
- disableServiceLogs?: boolean;
568
- /**
569
- * Specifies the number of summary sentences to return. The default number of sentences is 3.
570
- */
571
- maxSentenceCount?: number;
572
- /**
573
- * Specifies how to sort the returned sentences. Please refer to {@link KnownSummarySentencesOrderBy} for possible values.
570
+ * The kind of the action.
574
571
  */
575
- orderBy?: string;
572
+ kind: "ExtractiveSummarization";
576
573
  }
577
574
 
578
575
  /**
579
- * The error of an extract summary action.
576
+ * The result of an extractive summarization batch action.
580
577
  */
581
- export declare type ExtractSummaryActionErrorResult = TextAnalyticsActionErrorResult;
578
+ export declare type ExtractiveSummarizationBatchResult = ActionMetadata & BatchActionResult<SummarizationExtractionResult, "ExtractiveSummarization">;
582
579
 
583
580
  /**
584
- * The result of an extract summary action.
581
+ * Defines values for ExtractiveSummarizationOrderingCriteria. \
582
+ * {@link KnownExtractiveSummarizationOrderingCriteria} can be used interchangeably with ExtractiveSummarizationOrderingCriteria,
583
+ * this enum contains the known values that the service supports.
584
+ * ### Known values supported by the service
585
+ * **Offset**: Indicates that results should be sorted in order of appearance in the text. \
586
+ * **Rank**: Indicates that results should be sorted in order of importance (i.e. rank score) according to the model.
585
587
  */
586
- export declare type ExtractSummaryActionResult = ExtractSummaryActionSuccessResult | ExtractSummaryActionErrorResult;
588
+ export declare type ExtractiveSummarizationOrderingCriteria = string;
587
589
 
588
590
  /**
589
- * The results of a succeeded extract summary action.
591
+ * Defines values for FhirVersion. \
592
+ * {@link KnownFhirVersion} can be used interchangeably with FhirVersion,
593
+ * this enum contains the known values that the service supports.
594
+ * ### Known values supported by the service
595
+ * **4.0.1**
590
596
  */
591
- export declare interface ExtractSummaryActionSuccessResult extends TextAnalyticsActionSuccessState {
597
+ export declare type FhirVersion = string;
598
+
599
+ /** Supported parameters for a Healthcare task. */
600
+ export declare type HealthcareAction = ActionPrebuilt & {
601
+ /** The FHIR Spec version that the result will use to format the fhirBundle. For additional information see https://www.hl7.org/fhir/overview.html. */
602
+ fhirVersion?: FhirVersion;
592
603
  /**
593
- * Array of the results for each extract summary action.
604
+ * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
605
+ *
606
+ * The default is the JavaScript's default which is "Utf16CodeUnit".
594
607
  */
595
- results: ExtractSummaryResultArray;
596
- }
597
-
598
- /**
599
- * An error result from the extract summary operation on a single document.
600
- */
601
- export declare type ExtractSummaryErrorResult = TextAnalyticsErrorResult;
608
+ stringIndexType?: StringIndexType;
609
+ };
602
610
 
603
- /**
604
- * The result of the extract summary operation on a single document.
605
- */
606
- export declare type ExtractSummaryResult = ExtractSummarySuccessResult | ExtractSummaryErrorResult;
611
+ /** An object that describes metadata about the healthcare entity such as whether it is hypothetical or conditional. */
612
+ export declare interface HealthcareAssertion {
613
+ /** Describes any conditionality on the entity. */
614
+ conditionality?: Conditionality;
615
+ /** Describes the entities certainty and polarity. */
616
+ certainty?: Certainty;
617
+ /** Describes if the entity is the subject of the text or if it describes someone else. */
618
+ association?: Association;
619
+ }
607
620
 
608
- /**
609
- * Array of `ExtractSummaryResult` objects corresponding to a batch of input documents, and
610
- * annotated with information about the batch operation.
611
- */
612
- export declare interface ExtractSummaryResultArray extends Array<ExtractSummaryResult> {
621
+ /** Options for a healthcare batch action. */
622
+ export declare interface HealthcareBatchAction extends AnalyzeBatchActionCommon, HealthcareAction {
613
623
  /**
614
- * Statistics about the input document batch and how it was processed
615
- * by the service. This property will have a value when includeStatistics is set to true
616
- * in the client call.
624
+ * The kind of the action.
617
625
  */
618
- statistics?: TextDocumentBatchStatistics;
619
- /**
620
- * The version of the text analytics model used by this operation on this
621
- * batch of input documents.
622
- */
623
- modelVersion: string;
626
+ kind: "Healthcare";
624
627
  }
625
628
 
626
629
  /**
627
- * The result of the extract summary operation on a single document,
628
- * containing a collection of the summary identified in that document.
630
+ * The result of a healthcare batch action.
629
631
  */
630
- export declare interface ExtractSummarySuccessResult extends TextAnalyticsSuccessResult {
631
- /**
632
- * A list of sentences composing a summary of the input document.
633
- */
634
- sentences: SummarySentence[];
635
- }
632
+ export declare type HealthcareBatchResult = ActionMetadata & BatchActionResult<HealthcareResult, "Healthcare">;
636
633
 
637
634
  /**
638
635
  * A healthcare entity represented as a node in a directed graph where the edges are
@@ -642,15 +639,15 @@ export declare interface HealthcareEntity extends Entity {
642
639
  /**
643
640
  * Normalized name for the entity. For example, the normalized text for "histologically" is "histologic".
644
641
  */
645
- normalizedText?: string;
642
+ readonly normalizedText?: string;
646
643
  /**
647
644
  * Whether the entity is negated.
648
645
  */
649
- assertion?: EntityAssertion;
646
+ readonly assertion?: HealthcareAssertion;
650
647
  /**
651
648
  * Entity references in known data sources.
652
649
  */
653
- dataSources: EntityDataSource[];
650
+ readonly dataSources: EntityDataSource[];
654
651
  /**
655
652
  * Defines values for HealthcareEntityCategory.
656
653
  * {@link KnownHealthcareEntityCategory} can be used interchangeably with HealthcareEntityCategory,
@@ -683,7 +680,7 @@ export declare interface HealthcareEntity extends Entity {
683
680
  * **FAMILY_RELATION**
684
681
  * **TREATMENT_NAME**
685
682
  */
686
- category: HealthcareEntityCategory;
683
+ readonly category: HealthcareEntityCategory;
687
684
  }
688
685
 
689
686
  /**
@@ -727,11 +724,11 @@ export declare interface HealthcareEntityRelation {
727
724
  /**
728
725
  * The type of the healthcare relation.
729
726
  */
730
- relationType: HealthcareEntityRelationType;
727
+ readonly relationType: RelationType;
731
728
  /**
732
729
  * The list of healthcare entities and their roles in the healthcare relation.
733
730
  */
734
- roles: HealthcareEntityRelationRole[];
731
+ readonly roles: HealthcareEntityRelationRole[];
735
732
  }
736
733
 
737
734
  /**
@@ -741,11 +738,11 @@ export declare interface HealthcareEntityRelationRole {
741
738
  /**
742
739
  * A healthcare entity
743
740
  */
744
- entity: HealthcareEntity;
741
+ readonly entity: HealthcareEntity;
745
742
  /**
746
743
  * The role of the healthcare entity in a particular relation.
747
744
  */
748
- name: HealthcareEntityRelationRoleType;
745
+ readonly name: HealthcareEntityRelationRoleType;
749
746
  }
750
747
 
751
748
  /**
@@ -754,87 +751,117 @@ export declare interface HealthcareEntityRelationRole {
754
751
  export declare type HealthcareEntityRelationRoleType = string;
755
752
 
756
753
  /**
757
- * Defines values for RelationType. \
758
- * {@link KnownRelationType} can be used interchangeably with RelationType,
759
- * this enum contains the known values that the service supports.
760
- * ### Known values supported by the service
761
- * **Abbreviation** \
762
- * **DirectionOfBodyStructure** \
763
- * **DirectionOfCondition** \
764
- * **DirectionOfExamination** \
765
- * **DirectionOfTreatment** \
766
- * **DosageOfMedication** \
767
- * **FormOfMedication** \
768
- * **FrequencyOfMedication** \
769
- * **FrequencyOfTreatment** \
770
- * **QualifierOfCondition** \
771
- * **RelationOfExamination** \
772
- * **RouteOfMedication** \
773
- * **TimeOfCondition** \
774
- * **TimeOfEvent** \
775
- * **TimeOfExamination** \
776
- * **TimeOfMedication** \
777
- * **TimeOfTreatment** \
778
- * **UnitOfCondition** \
779
- * **UnitOfExamination** \
780
- * **ValueOfCondition** \
781
- * **ValueOfExamination**
754
+ * An error result from the healthcare operation on a single document.
782
755
  */
783
- export declare type HealthcareEntityRelationType = string;
756
+ export declare type HealthcareErrorResult = TextAnalysisErrorResult;
784
757
 
785
758
  /**
786
- * Defines values for InnerErrorCodeValue. \
787
- * {@link KnownInnerErrorCodeValue} can be used interchangeably with InnerErrorCodeValue,
788
- * this enum contains the known values that the service supports.
789
- * ### Known values supported by the service
790
- * **InvalidParameterValue** \
791
- * **InvalidRequestBodyFormat** \
792
- * **EmptyRequest** \
793
- * **MissingInputRecords** \
794
- * **InvalidDocument** \
795
- * **ModelVersionIncorrect** \
796
- * **InvalidDocumentBatch** \
797
- * **UnsupportedLanguageCode** \
798
- * **InvalidCountryHint**
799
- */
800
- export declare type InnerErrorCodeValue = string;
801
-
802
- /** Known values of {@link HealthcareEntityCategory} that the service accepts. */
803
- export declare enum KnownHealthcareEntityCategory {
804
- BodyStructure = "BODY_STRUCTURE",
805
- AGE = "AGE",
806
- Gender = "GENDER",
807
- ExaminationName = "EXAMINATION_NAME",
808
- Date = "DATE",
809
- Direction = "DIRECTION",
810
- Frequency = "FREQUENCY",
811
- MeasurementValue = "MEASUREMENT_VALUE",
812
- MeasurementUnit = "MEASUREMENT_UNIT",
813
- RelationalOperator = "RELATIONAL_OPERATOR",
814
- Time = "TIME",
815
- GeneORProtein = "GENE_OR_PROTEIN",
816
- Variant = "VARIANT",
817
- AdministrativeEvent = "ADMINISTRATIVE_EVENT",
818
- CareEnvironment = "CARE_ENVIRONMENT",
819
- HealthcareProfession = "HEALTHCARE_PROFESSION",
820
- Diagnosis = "DIAGNOSIS",
821
- SymptomORSign = "SYMPTOM_OR_SIGN",
822
- ConditionQualifier = "CONDITION_QUALIFIER",
823
- MedicationClass = "MEDICATION_CLASS",
824
- MedicationName = "MEDICATION_NAME",
825
- Dosage = "DOSAGE",
826
- MedicationForm = "MEDICATION_FORM",
827
- MedicationRoute = "MEDICATION_ROUTE",
828
- FamilyRelation = "FAMILY_RELATION",
829
- TreatmentName = "TREATMENT_NAME"
830
- }
831
-
832
- /** Known values of {@link InnerErrorCodeValue} that the service accepts. */
833
- export declare enum KnownInnerErrorCodeValue {
759
+ * The result of the healthcare operation on a single document.
760
+ */
761
+ export declare type HealthcareResult = HealthcareSuccessResult | HealthcareErrorResult;
762
+
763
+ /**
764
+ * The results of a successful healthcare operation for a single document.
765
+ */
766
+ export declare interface HealthcareSuccessResult extends TextAnalysisSuccessResult {
767
+ /**
768
+ * Healthcare entities.
769
+ */
770
+ readonly entities: HealthcareEntity[];
771
+ /**
772
+ * Relations between healthcare entities.
773
+ */
774
+ readonly entityRelations: HealthcareEntityRelation[];
775
+ /**
776
+ * JSON bundle containing a FHIR compatible object for consumption in other
777
+ * Healthcare tools. For additional information see {@link https://www.hl7.org/fhir/overview.html}.
778
+ */
779
+ readonly fhirBundle?: Record<string, any>;
780
+ }
781
+
782
+ /** Options for a key phrase recognition action. */
783
+ export declare type KeyPhraseExtractionAction = ActionPrebuilt;
784
+
785
+ /** Options for an key phrase extraction batch action. */
786
+ export declare interface KeyPhraseExtractionBatchAction extends AnalyzeBatchActionCommon, KeyPhraseExtractionAction {
787
+ /**
788
+ * The kind of the action.
789
+ */
790
+ kind: "KeyPhraseExtraction";
791
+ }
792
+
793
+ /**
794
+ * The result of a key phrase extraction batch action.
795
+ */
796
+ export declare type KeyPhraseExtractionBatchResult = ActionMetadata & BatchActionResult<KeyPhraseExtractionResult, "KeyPhraseExtraction">;
797
+
798
+ /**
799
+ * An error result from a key phrase extraction action on a single document.
800
+ */
801
+ export declare type KeyPhraseExtractionErrorResult = TextAnalysisErrorResult;
802
+
803
+ /**
804
+ * The result of a sentiment analysis action on a single document.
805
+ */
806
+ export declare type KeyPhraseExtractionResult = KeyPhraseExtractionSuccessResult | KeyPhraseExtractionErrorResult;
807
+
808
+ /**
809
+ * The result of a key phrase extraction action on a single document,
810
+ * containing a collection of the key phrases identified in that document.
811
+ */
812
+ export declare interface KeyPhraseExtractionSuccessResult extends TextAnalysisSuccessResult {
813
+ /**
814
+ * A list of representative words or phrases. The number of key phrases
815
+ * returned is proportional to the number of words in the input document.
816
+ */
817
+ readonly keyPhrases: string[];
818
+ }
819
+
820
+ /** Known values of {@link ErrorCode} that the service accepts. */
821
+ export declare enum KnownErrorCode {
822
+ InvalidRequest = "InvalidRequest",
823
+ InvalidArgument = "InvalidArgument",
824
+ Unauthorized = "Unauthorized",
825
+ Forbidden = "Forbidden",
826
+ NotFound = "NotFound",
827
+ ProjectNotFound = "ProjectNotFound",
828
+ OperationNotFound = "OperationNotFound",
829
+ AzureCognitiveSearchNotFound = "AzureCognitiveSearchNotFound",
830
+ AzureCognitiveSearchIndexNotFound = "AzureCognitiveSearchIndexNotFound",
831
+ TooManyRequests = "TooManyRequests",
832
+ AzureCognitiveSearchThrottling = "AzureCognitiveSearchThrottling",
833
+ AzureCognitiveSearchIndexLimitReached = "AzureCognitiveSearchIndexLimitReached",
834
+ InternalServerError = "InternalServerError",
835
+ ServiceUnavailable = "ServiceUnavailable"
836
+ }
837
+
838
+ /** Known values of {@link ExtractiveSummarizationOrderingCriteria} that the service accepts. */
839
+ export declare enum KnownExtractiveSummarizationOrderingCriteria {
840
+ /** Indicates that results should be sorted in order of appearance in the text. */
841
+ Offset = "Offset",
842
+ /** Indicates that results should be sorted in order of importance (i.e. rank score) according to the model. */
843
+ Rank = "Rank"
844
+ }
845
+
846
+ /**
847
+ * Known values of the {@link HealthcareAction.fhirVersion} parameter.
848
+ */
849
+ export declare enum KnownFhirVersion {
850
+ /** 4.0.1 */
851
+ "4.0.1" = "4.0.1"
852
+ }
853
+
854
+ /** Known values of {@link InnerErrorCode} that the service accepts. */
855
+ export declare enum KnownInnerErrorCode {
856
+ InvalidRequest = "InvalidRequest",
834
857
  InvalidParameterValue = "InvalidParameterValue",
858
+ KnowledgeBaseNotFound = "KnowledgeBaseNotFound",
859
+ AzureCognitiveSearchNotFound = "AzureCognitiveSearchNotFound",
860
+ AzureCognitiveSearchThrottling = "AzureCognitiveSearchThrottling",
861
+ ExtractionFailure = "ExtractionFailure",
835
862
  InvalidRequestBodyFormat = "InvalidRequestBodyFormat",
836
863
  EmptyRequest = "EmptyRequest",
837
- MissingInputRecords = "MissingInputRecords",
864
+ MissingInputDocuments = "MissingInputDocuments",
838
865
  InvalidDocument = "InvalidDocument",
839
866
  ModelVersionIncorrect = "ModelVersionIncorrect",
840
867
  InvalidDocumentBatch = "InvalidDocumentBatch",
@@ -842,15 +869,264 @@ export declare enum KnownInnerErrorCodeValue {
842
869
  InvalidCountryHint = "InvalidCountryHint"
843
870
  }
844
871
 
872
+ /** Known values of {@link PiiCategory} that the service accepts. */
873
+ export declare enum KnownPiiCategory {
874
+ ABARoutingNumber = "ABARoutingNumber",
875
+ ARNationalIdentityNumber = "ARNationalIdentityNumber",
876
+ AUBankAccountNumber = "AUBankAccountNumber",
877
+ AUDriversLicenseNumber = "AUDriversLicenseNumber",
878
+ AUMedicalAccountNumber = "AUMedicalAccountNumber",
879
+ AUPassportNumber = "AUPassportNumber",
880
+ AUTaxFileNumber = "AUTaxFileNumber",
881
+ AUBusinessNumber = "AUBusinessNumber",
882
+ AUCompanyNumber = "AUCompanyNumber",
883
+ ATIdentityCard = "ATIdentityCard",
884
+ ATTaxIdentificationNumber = "ATTaxIdentificationNumber",
885
+ ATValueAddedTaxNumber = "ATValueAddedTaxNumber",
886
+ AzureDocumentDBAuthKey = "AzureDocumentDBAuthKey",
887
+ AzureIaasDatabaseConnectionAndSQLString = "AzureIAASDatabaseConnectionAndSQLString",
888
+ AzureIoTConnectionString = "AzureIoTConnectionString",
889
+ AzurePublishSettingPassword = "AzurePublishSettingPassword",
890
+ AzureRedisCacheString = "AzureRedisCacheString",
891
+ AzureSAS = "AzureSAS",
892
+ AzureServiceBusString = "AzureServiceBusString",
893
+ AzureStorageAccountKey = "AzureStorageAccountKey",
894
+ AzureStorageAccountGeneric = "AzureStorageAccountGeneric",
895
+ BENationalNumber = "BENationalNumber",
896
+ BENationalNumberV2 = "BENationalNumberV2",
897
+ BEValueAddedTaxNumber = "BEValueAddedTaxNumber",
898
+ BrcpfNumber = "BRCPFNumber",
899
+ BRLegalEntityNumber = "BRLegalEntityNumber",
900
+ BRNationalIdrg = "BRNationalIDRG",
901
+ BGUniformCivilNumber = "BGUniformCivilNumber",
902
+ CABankAccountNumber = "CABankAccountNumber",
903
+ CADriversLicenseNumber = "CADriversLicenseNumber",
904
+ CAHealthServiceNumber = "CAHealthServiceNumber",
905
+ CAPassportNumber = "CAPassportNumber",
906
+ CAPersonalHealthIdentification = "CAPersonalHealthIdentification",
907
+ CASocialInsuranceNumber = "CASocialInsuranceNumber",
908
+ CLIdentityCardNumber = "CLIdentityCardNumber",
909
+ CNResidentIdentityCardNumber = "CNResidentIdentityCardNumber",
910
+ CreditCardNumber = "CreditCardNumber",
911
+ HRIdentityCardNumber = "HRIdentityCardNumber",
912
+ HRNationalIDNumber = "HRNationalIDNumber",
913
+ HRPersonalIdentificationNumber = "HRPersonalIdentificationNumber",
914
+ HRPersonalIdentificationOIBNumberV2 = "HRPersonalIdentificationOIBNumberV2",
915
+ CYIdentityCard = "CYIdentityCard",
916
+ CYTaxIdentificationNumber = "CYTaxIdentificationNumber",
917
+ CZPersonalIdentityNumber = "CZPersonalIdentityNumber",
918
+ CZPersonalIdentityV2 = "CZPersonalIdentityV2",
919
+ DKPersonalIdentificationNumber = "DKPersonalIdentificationNumber",
920
+ DKPersonalIdentificationV2 = "DKPersonalIdentificationV2",
921
+ DrugEnforcementAgencyNumber = "DrugEnforcementAgencyNumber",
922
+ EEPersonalIdentificationCode = "EEPersonalIdentificationCode",
923
+ EUDebitCardNumber = "EUDebitCardNumber",
924
+ EUDriversLicenseNumber = "EUDriversLicenseNumber",
925
+ EugpsCoordinates = "EUGPSCoordinates",
926
+ EUNationalIdentificationNumber = "EUNationalIdentificationNumber",
927
+ EUPassportNumber = "EUPassportNumber",
928
+ EUSocialSecurityNumber = "EUSocialSecurityNumber",
929
+ EUTaxIdentificationNumber = "EUTaxIdentificationNumber",
930
+ FIEuropeanHealthNumber = "FIEuropeanHealthNumber",
931
+ FINationalID = "FINationalID",
932
+ FINationalIDV2 = "FINationalIDV2",
933
+ FIPassportNumber = "FIPassportNumber",
934
+ FRDriversLicenseNumber = "FRDriversLicenseNumber",
935
+ FRHealthInsuranceNumber = "FRHealthInsuranceNumber",
936
+ FRNationalID = "FRNationalID",
937
+ FRPassportNumber = "FRPassportNumber",
938
+ FRSocialSecurityNumber = "FRSocialSecurityNumber",
939
+ FRTaxIdentificationNumber = "FRTaxIdentificationNumber",
940
+ FRValueAddedTaxNumber = "FRValueAddedTaxNumber",
941
+ DEDriversLicenseNumber = "DEDriversLicenseNumber",
942
+ DEPassportNumber = "DEPassportNumber",
943
+ DEIdentityCardNumber = "DEIdentityCardNumber",
944
+ DETaxIdentificationNumber = "DETaxIdentificationNumber",
945
+ DEValueAddedNumber = "DEValueAddedNumber",
946
+ GRNationalIDCard = "GRNationalIDCard",
947
+ GRNationalIDV2 = "GRNationalIDV2",
948
+ GRTaxIdentificationNumber = "GRTaxIdentificationNumber",
949
+ HKIdentityCardNumber = "HKIdentityCardNumber",
950
+ HUValueAddedNumber = "HUValueAddedNumber",
951
+ HUPersonalIdentificationNumber = "HUPersonalIdentificationNumber",
952
+ HUTaxIdentificationNumber = "HUTaxIdentificationNumber",
953
+ INPermanentAccount = "INPermanentAccount",
954
+ INUniqueIdentificationNumber = "INUniqueIdentificationNumber",
955
+ IDIdentityCardNumber = "IDIdentityCardNumber",
956
+ InternationalBankingAccountNumber = "InternationalBankingAccountNumber",
957
+ IEPersonalPublicServiceNumber = "IEPersonalPublicServiceNumber",
958
+ IEPersonalPublicServiceNumberV2 = "IEPersonalPublicServiceNumberV2",
959
+ ILBankAccountNumber = "ILBankAccountNumber",
960
+ ILNationalID = "ILNationalID",
961
+ ITDriversLicenseNumber = "ITDriversLicenseNumber",
962
+ ITFiscalCode = "ITFiscalCode",
963
+ ITValueAddedTaxNumber = "ITValueAddedTaxNumber",
964
+ JPBankAccountNumber = "JPBankAccountNumber",
965
+ JPDriversLicenseNumber = "JPDriversLicenseNumber",
966
+ JPPassportNumber = "JPPassportNumber",
967
+ JPResidentRegistrationNumber = "JPResidentRegistrationNumber",
968
+ JPSocialInsuranceNumber = "JPSocialInsuranceNumber",
969
+ JPMyNumberCorporate = "JPMyNumberCorporate",
970
+ JPMyNumberPersonal = "JPMyNumberPersonal",
971
+ JPResidenceCardNumber = "JPResidenceCardNumber",
972
+ LVPersonalCode = "LVPersonalCode",
973
+ LTPersonalCode = "LTPersonalCode",
974
+ LUNationalIdentificationNumberNatural = "LUNationalIdentificationNumberNatural",
975
+ LUNationalIdentificationNumberNonNatural = "LUNationalIdentificationNumberNonNatural",
976
+ MYIdentityCardNumber = "MYIdentityCardNumber",
977
+ MTIdentityCardNumber = "MTIdentityCardNumber",
978
+ MTTaxIDNumber = "MTTaxIDNumber",
979
+ NLCitizensServiceNumber = "NLCitizensServiceNumber",
980
+ NLCitizensServiceNumberV2 = "NLCitizensServiceNumberV2",
981
+ NLTaxIdentificationNumber = "NLTaxIdentificationNumber",
982
+ NLValueAddedTaxNumber = "NLValueAddedTaxNumber",
983
+ NZBankAccountNumber = "NZBankAccountNumber",
984
+ NZDriversLicenseNumber = "NZDriversLicenseNumber",
985
+ NZInlandRevenueNumber = "NZInlandRevenueNumber",
986
+ NZMinistryOfHealthNumber = "NZMinistryOfHealthNumber",
987
+ NZSocialWelfareNumber = "NZSocialWelfareNumber",
988
+ NOIdentityNumber = "NOIdentityNumber",
989
+ PHUnifiedMultiPurposeIDNumber = "PHUnifiedMultiPurposeIDNumber",
990
+ PLIdentityCard = "PLIdentityCard",
991
+ PLNationalID = "PLNationalID",
992
+ PLNationalIDV2 = "PLNationalIDV2",
993
+ PLPassportNumber = "PLPassportNumber",
994
+ PLTaxIdentificationNumber = "PLTaxIdentificationNumber",
995
+ PlregonNumber = "PLREGONNumber",
996
+ PTCitizenCardNumber = "PTCitizenCardNumber",
997
+ PTCitizenCardNumberV2 = "PTCitizenCardNumberV2",
998
+ PTTaxIdentificationNumber = "PTTaxIdentificationNumber",
999
+ ROPersonalNumericalCode = "ROPersonalNumericalCode",
1000
+ RUPassportNumberDomestic = "RUPassportNumberDomestic",
1001
+ RUPassportNumberInternational = "RUPassportNumberInternational",
1002
+ SANationalID = "SANationalID",
1003
+ SGNationalRegistrationIdentityCardNumber = "SGNationalRegistrationIdentityCardNumber",
1004
+ SKPersonalNumber = "SKPersonalNumber",
1005
+ SITaxIdentificationNumber = "SITaxIdentificationNumber",
1006
+ SIUniqueMasterCitizenNumber = "SIUniqueMasterCitizenNumber",
1007
+ ZAIdentificationNumber = "ZAIdentificationNumber",
1008
+ KRResidentRegistrationNumber = "KRResidentRegistrationNumber",
1009
+ Esdni = "ESDNI",
1010
+ ESSocialSecurityNumber = "ESSocialSecurityNumber",
1011
+ ESTaxIdentificationNumber = "ESTaxIdentificationNumber",
1012
+ SQLServerConnectionString = "SQLServerConnectionString",
1013
+ SENationalID = "SENationalID",
1014
+ SENationalIDV2 = "SENationalIDV2",
1015
+ SEPassportNumber = "SEPassportNumber",
1016
+ SETaxIdentificationNumber = "SETaxIdentificationNumber",
1017
+ SwiftCode = "SWIFTCode",
1018
+ CHSocialSecurityNumber = "CHSocialSecurityNumber",
1019
+ TWNationalID = "TWNationalID",
1020
+ TWPassportNumber = "TWPassportNumber",
1021
+ TWResidentCertificate = "TWResidentCertificate",
1022
+ THPopulationIdentificationCode = "THPopulationIdentificationCode",
1023
+ TRNationalIdentificationNumber = "TRNationalIdentificationNumber",
1024
+ UKDriversLicenseNumber = "UKDriversLicenseNumber",
1025
+ UKElectoralRollNumber = "UKElectoralRollNumber",
1026
+ UKNationalHealthNumber = "UKNationalHealthNumber",
1027
+ UKNationalInsuranceNumber = "UKNationalInsuranceNumber",
1028
+ UKUniqueTaxpayerNumber = "UKUniqueTaxpayerNumber",
1029
+ UsukPassportNumber = "USUKPassportNumber",
1030
+ USBankAccountNumber = "USBankAccountNumber",
1031
+ USDriversLicenseNumber = "USDriversLicenseNumber",
1032
+ USIndividualTaxpayerIdentification = "USIndividualTaxpayerIdentification",
1033
+ USSocialSecurityNumber = "USSocialSecurityNumber",
1034
+ UAPassportNumberDomestic = "UAPassportNumberDomestic",
1035
+ UAPassportNumberInternational = "UAPassportNumberInternational",
1036
+ Organization = "Organization",
1037
+ Email = "Email",
1038
+ URL = "URL",
1039
+ Age = "Age",
1040
+ PhoneNumber = "PhoneNumber",
1041
+ IPAddress = "IPAddress",
1042
+ Date = "Date",
1043
+ Person = "Person",
1044
+ Address = "Address",
1045
+ All = "All",
1046
+ Default = "Default"
1047
+ }
1048
+
1049
+ /** Known values of {@link PiiDomain} that the service accepts. */
1050
+ export declare enum KnownPiiDomain {
1051
+ /** Indicates that entities in the Personal Health Information domain should be redacted. */
1052
+ Phi = "phi",
1053
+ /** Indicates that no domain is specified. */
1054
+ None = "none"
1055
+ }
1056
+
1057
+ /** Known values of {@link StringIndexType} that the service accepts. */
1058
+ export declare enum KnownStringIndexType {
1059
+ /** Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo. */
1060
+ TextElementsV8 = "TextElements_v8",
1061
+ /** Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python. */
1062
+ UnicodeCodePoint = "UnicodeCodePoint",
1063
+ /** Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript. */
1064
+ Utf16CodeUnit = "Utf16CodeUnit"
1065
+ }
1066
+
1067
+ /**
1068
+ * Enum of possible error codes of a {@link TextAnalysisError}.
1069
+ */
1070
+ export declare const KnownTextAnalysisErrorCode: {
1071
+ InvalidRequest: KnownInnerErrorCode.InvalidRequest;
1072
+ InvalidParameterValue: KnownInnerErrorCode.InvalidParameterValue;
1073
+ KnowledgeBaseNotFound: KnownInnerErrorCode.KnowledgeBaseNotFound;
1074
+ AzureCognitiveSearchNotFound: KnownInnerErrorCode.AzureCognitiveSearchNotFound;
1075
+ AzureCognitiveSearchThrottling: KnownInnerErrorCode.AzureCognitiveSearchThrottling;
1076
+ ExtractionFailure: KnownInnerErrorCode.ExtractionFailure;
1077
+ InvalidRequestBodyFormat: KnownInnerErrorCode.InvalidRequestBodyFormat;
1078
+ EmptyRequest: KnownInnerErrorCode.EmptyRequest;
1079
+ MissingInputDocuments: KnownInnerErrorCode.MissingInputDocuments;
1080
+ InvalidDocument: KnownInnerErrorCode.InvalidDocument;
1081
+ ModelVersionIncorrect: KnownInnerErrorCode.ModelVersionIncorrect;
1082
+ InvalidDocumentBatch: KnownInnerErrorCode.InvalidDocumentBatch;
1083
+ UnsupportedLanguageCode: KnownInnerErrorCode.UnsupportedLanguageCode;
1084
+ InvalidCountryHint: KnownInnerErrorCode.InvalidCountryHint;
1085
+ InvalidArgument: KnownErrorCode.InvalidArgument;
1086
+ Unauthorized: KnownErrorCode.Unauthorized;
1087
+ Forbidden: KnownErrorCode.Forbidden;
1088
+ NotFound: KnownErrorCode.NotFound;
1089
+ ProjectNotFound: KnownErrorCode.ProjectNotFound;
1090
+ OperationNotFound: KnownErrorCode.OperationNotFound;
1091
+ AzureCognitiveSearchIndexNotFound: KnownErrorCode.AzureCognitiveSearchIndexNotFound;
1092
+ TooManyRequests: KnownErrorCode.TooManyRequests;
1093
+ AzureCognitiveSearchIndexLimitReached: KnownErrorCode.AzureCognitiveSearchIndexLimitReached;
1094
+ InternalServerError: KnownErrorCode.InternalServerError;
1095
+ ServiceUnavailable: KnownErrorCode.ServiceUnavailable;
1096
+ };
1097
+
1098
+ /** Options for a language detection action. */
1099
+ export declare type LanguageDetectionAction = ActionPrebuilt;
1100
+
1101
+ /**
1102
+ * An error result from a language detection action on a single document.
1103
+ */
1104
+ export declare type LanguageDetectionErrorResult = TextAnalysisErrorResult;
1105
+
1106
+ /** An input to the language detection operation. This object specifies a unique document id, as well as the full text of a document and a hint indicating the document's country of origin to assist the Language predictive model in detecting the document's language. */
1107
+ export declare interface LanguageDetectionInput {
1108
+ /** Unique, non-empty document identifier. */
1109
+ id: string;
1110
+ /** Full text of the input document. */
1111
+ text: string;
1112
+ /** A hint indicating the document's country of origin to assist the Language predictive model in detecting the document's language. */
1113
+ countryHint?: string;
1114
+ }
1115
+
845
1116
  /**
846
- * A type representing how to sort sentences for the summarization extraction action.
1117
+ * The result of a language detection action on a single document.
847
1118
  */
848
- export declare type KnownSummarySentencesOrderBy = "Offset" | "Rank";
1119
+ export declare type LanguageDetectionResult = LanguageDetectionSuccessResult | LanguageDetectionErrorResult;
849
1120
 
850
- /** Known values of {@link WarningCode} that the service accepts. */
851
- export declare enum KnownWarningCode {
852
- LongWordsInDocument = "LongWordsInDocument",
853
- DocumentTruncated = "DocumentTruncated"
1121
+ /**
1122
+ * The result of a language detection action on a single document,
1123
+ * containing a prediction of what language the document is written in.
1124
+ */
1125
+ export declare interface LanguageDetectionSuccessResult extends TextAnalysisSuccessResult {
1126
+ /**
1127
+ * The top detected language by confidence score.
1128
+ */
1129
+ readonly primaryLanguage: DetectedLanguage;
854
1130
  }
855
1131
 
856
1132
  /** A word or phrase identified as a well-known entity within a database, including its formal (disambiguated) name and a link to the entity information within the source database. */
@@ -871,7 +1147,7 @@ export declare interface LinkedEntity {
871
1147
  bingEntitySearchApiId?: string;
872
1148
  }
873
1149
 
874
- /** Details about the specific substring in a document that refers to a linked entity identified by the Text Analytics model. */
1150
+ /** Details about the specific substring in a document that refers to a linked entity identified by the Language model. */
875
1151
  export declare interface Match {
876
1152
  /** If a well known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned. */
877
1153
  confidenceScore: number;
@@ -883,108 +1159,8 @@ export declare interface Match {
883
1159
  length: number;
884
1160
  }
885
1161
 
886
- /**
887
- * Options for a custom classify document multi categories action. For more information, please refer
888
- * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}
889
- */
890
- export declare interface MultiCategoryClassifyAction extends CustomTextAnalyticsAction {
891
- /**
892
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
893
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
894
- * disables input logging and may limit our ability to remediate issues that occur.
895
- */
896
- disableServiceLogs?: boolean;
897
- }
898
-
899
- /**
900
- * The error of a custom classify document multi category action.
901
- */
902
- export declare type MultiCategoryClassifyActionErrorResult = TextAnalyticsActionErrorResult;
903
-
904
- /**
905
- * The result of a custom classify document multi category action.
906
- */
907
- export declare type MultiCategoryClassifyActionResult = MultiCategoryClassifyActionSuccessResult | MultiCategoryClassifyActionErrorResult;
908
-
909
- /**
910
- * The results of a succeeded custom classify document multi category action.
911
- */
912
- export declare interface MultiCategoryClassifyActionSuccessResult extends TextAnalyticsActionSuccessState {
913
- /**
914
- * Array of the results for each custom classify document multi category action.
915
- */
916
- results: MultiCategoryClassifyResultArray;
917
- }
918
-
919
- /**
920
- * An error result from the custom classify document multi category operation on a multi document.
921
- */
922
- export declare type MultiCategoryClassifyErrorResult = TextAnalyticsErrorResult;
923
-
924
- /**
925
- * The result of the custom classify document multi categories operation on a multi document.
926
- */
927
- export declare type MultiCategoryClassifyResult = MultiCategoryClassifySuccessResult | MultiCategoryClassifyErrorResult;
928
-
929
- /**
930
- * Array of `MultiCategoryClassifyResult` objects corresponding to a batch of input documents, and
931
- * annotated with information about the batch operation.
932
- */
933
- export declare interface MultiCategoryClassifyResultArray extends Array<MultiCategoryClassifyResult> {
934
- /**
935
- * Statistics about the input document batch and how it was processed
936
- * by the service. This property will have a value when includeStatistics is set to true
937
- * in the client call.
938
- */
939
- statistics?: TextDocumentBatchStatistics;
940
- /**
941
- * The version of the text analytics custom project used by this operation on this
942
- * batch of input documents.
943
- */
944
- projectName: string;
945
- /**
946
- * The version of the text analytics custom deployment used by this operation on this
947
- * batch of input documents.
948
- */
949
- deploymentName: string;
950
- }
951
-
952
- /**
953
- * The result of the custom classify document multi categories operation on a multi document,
954
- * containing the result of the classification.
955
- */
956
- export declare interface MultiCategoryClassifySuccessResult extends TextAnalyticsSuccessResult {
957
- /**
958
- * The collection of classifications in the input document.
959
- */
960
- classifications: ClassificationCategory[];
961
- }
962
-
963
- /**
964
- * Metadata information for an analysis poller operation.
965
- */
966
- export declare interface OperationMetadata {
967
- /**
968
- * The date and time the operation was created.
969
- */
970
- createdOn: Date;
971
- /**
972
- * The date and time when the operation results will expire on the server.
973
- */
974
- expiresOn?: Date;
975
- /**
976
- * The operation id.
977
- */
978
- operationId: string;
979
- /**
980
- * The time the operation status was last updated.
981
- */
982
- lastModifiedOn: Date;
983
- /**
984
- * The current status of the operation.
985
- */
986
- status: TextAnalyticsOperationStatus;
987
- }
1162
+ /** Defines values for OperationStatus. */
1163
+ export declare type OperationStatus = "notStarted" | "running" | "succeeded" | "partiallySucceeded" | "failed" | "cancelled" | "cancelling";
988
1164
 
989
1165
  /**
990
1166
  * A mined opinion object represents an opinion we've extracted from a sentence.
@@ -995,58 +1171,17 @@ export declare interface Opinion {
995
1171
  /**
996
1172
  * The target of a product/service that this assessment is about.
997
1173
  */
998
- target: TargetSentiment;
1174
+ readonly target: TargetSentiment;
999
1175
  /**
1000
1176
  * The actual assessments of the target.
1001
1177
  */
1002
- assessments: AssessmentSentiment[];
1003
- }
1004
-
1005
- /**
1006
- * The results of an analyze actions operation represented as a paged iterator that
1007
- * iterates over the results of the requested actions.
1008
- */
1009
- export declare interface PagedAnalyzeActionsResult extends PagedAsyncIterableAnalyzeActionsResult {
1010
- }
1011
-
1012
- /**
1013
- * The results of a healthcare operation represented as a paged iterator that can
1014
- * either iterate over the results on a document-by-document basis or, by
1015
- * byPage(), can iterate over pages of documents.
1016
- */
1017
- export declare interface PagedAnalyzeHealthcareEntitiesResult extends PagedAsyncIterableAnalyzeHealthcareEntitiesResult {
1018
- /**
1019
- * Statistics about the input document batch and how it was processed
1020
- * by the service. This property will have a value when includeStatistics is set to true
1021
- * in the client call.
1022
- */
1023
- statistics?: TextDocumentBatchStatistics;
1024
- /**
1025
- * The version of the text analytics model used by this operation on this
1026
- * batch of input documents.
1027
- */
1028
- modelVersion: string;
1178
+ readonly assessments: AssessmentSentiment[];
1029
1179
  }
1030
1180
 
1031
1181
  /**
1032
- * The results of an analyze Actions operation represented as a paged iterator that
1033
- * iterates over the results of the requested actions.
1034
- */
1035
- export declare type PagedAsyncIterableAnalyzeActionsResult = PagedAsyncIterableIterator<AnalyzeActionsResult, AnalyzeActionsResult>;
1036
-
1037
- /**
1038
- * The results of a healthcare operation represented as a paged iterator that can
1039
- * either iterate over the results on a document-by-document basis or, by
1040
- * byPage(), can iterate over pages of documents.
1041
- */
1042
- export declare type PagedAsyncIterableAnalyzeHealthcareEntitiesResult = PagedAsyncIterableIterator<AnalyzeHealthcareEntitiesResult, AnalyzeHealthcareEntitiesResultArray>;
1043
-
1044
- /**
1045
- * An entity from PII recognition with information about the kind of PII
1046
- * encountered.
1182
+ * Paged results of the {@link TextAnalysisClient.beginAnalyzeBatch} operation.
1047
1183
  */
1048
- export declare interface PiiEntity extends Entity {
1049
- }
1184
+ export declare type PagedAnalyzeBatchResult = PagedAsyncIterableIterator<AnalyzeBatchResult>;
1050
1185
 
1051
1186
  /**
1052
1187
  * Defines values for PiiCategory. \
@@ -1227,443 +1362,211 @@ export declare interface PiiEntity extends Entity {
1227
1362
  * **All** \
1228
1363
  * **Default**
1229
1364
  */
1230
- export declare type PiiEntityCategory = string;
1365
+ export declare type PiiCategory = string;
1231
1366
 
1232
1367
  /**
1233
- * The types of PII domains the user can choose from.
1368
+ * Defines values for PiiDomain. \
1369
+ * {@link KnownPiiDomain} can be used interchangeably with PiiDomain,
1370
+ * this enum contains the known values that the service supports.
1371
+ * ### Known values supported by the service
1372
+ * **phi**: Indicates that entities in the Personal Health Information domain should be redacted. \
1373
+ * **none**: Indicates that no domain is specified.
1234
1374
  */
1235
- export declare enum PiiEntityDomain {
1375
+ export declare type PiiDomain = string;
1376
+
1377
+ /** Options for a Pii entity recognition action. */
1378
+ export declare type PiiEntityRecognitionAction = ActionPrebuilt & {
1236
1379
  /**
1237
- * @see {@link https://aka.ms/tanerpii} for more information.
1380
+ * Filters entities to ones only included in the specified domain (e.g., if set to `Phi`, only entities in the Protected Healthcare Information domain will be returned). For a list of possible domains, see {@link PiiDomain}.
1381
+ *
1382
+ * See {@link https://aka.ms/tanerpii the service documentation} for more information.
1238
1383
  */
1239
- PROTECTED_HEALTH_INFORMATION = "PHI"
1240
- }
1241
-
1242
- /**
1243
- * Options for an entities recognition action.
1244
- */
1245
- export declare interface RecognizeCategorizedEntitiesAction extends TextAnalyticsAction {
1384
+ domainFilter?: PiiDomain;
1385
+ /** Filters entities to ones only included in the specified array of categories. For a list of possible categories, see {@link KnownPiiCategory} */
1386
+ categoriesFilter?: PiiCategory[];
1246
1387
  /**
1247
- * Specifies the measurement unit used to calculate the offset and length properties.
1248
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1388
+ * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
1389
+ *
1249
1390
  * The default is the JavaScript's default which is "Utf16CodeUnit".
1250
1391
  */
1251
1392
  stringIndexType?: StringIndexType;
1393
+ };
1394
+
1395
+ /** Options for a pii entity recognition batch action. */
1396
+ export declare interface PiiEntityRecognitionBatchAction extends AnalyzeBatchActionCommon, PiiEntityRecognitionAction {
1252
1397
  /**
1253
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
1254
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
1255
- * disables input logging and may limit our ability to remediate issues that occur.
1398
+ * The kind of the action.
1256
1399
  */
1257
- disableServiceLogs?: boolean;
1400
+ kind: "PiiEntityRecognition";
1258
1401
  }
1259
1402
 
1260
1403
  /**
1261
- * The error of a recognize categorized entities action.
1262
- */
1263
- export declare type RecognizeCategorizedEntitiesActionErrorResult = TextAnalyticsActionErrorResult;
1264
-
1265
- /**
1266
- * The result of a recognize categorized entities action.
1404
+ * The result of a pii entity recognition batch action.
1267
1405
  */
1268
- export declare type RecognizeCategorizedEntitiesActionResult = RecognizeCategorizedEntitiesActionSuccessResult | RecognizeCategorizedEntitiesActionErrorResult;
1406
+ export declare type PiiEntityRecognitionBatchResult = ActionMetadata & BatchActionResult<PiiEntityRecognitionResult, "PiiEntityRecognition">;
1269
1407
 
1270
1408
  /**
1271
- * The results of a succeeded recognize categorized entities action.
1409
+ * An error result from a pii entity recognition action on a single document.
1272
1410
  */
1273
- export declare interface RecognizeCategorizedEntitiesActionSuccessResult extends TextAnalyticsActionSuccessState {
1274
- /**
1275
- * Array of the results for each categorized entities recognition action.
1276
- */
1277
- results: RecognizeCategorizedEntitiesResultArray;
1278
- }
1411
+ export declare type PiiEntityRecognitionErrorResult = TextAnalysisErrorResult;
1279
1412
 
1280
1413
  /**
1281
- * An error result from the recognize entities operation on a single document.
1414
+ * The result of an entity recognition action on a single document.
1282
1415
  */
1283
- export declare type RecognizeCategorizedEntitiesErrorResult = TextAnalyticsErrorResult;
1416
+ export declare type PiiEntityRecognitionResult = PiiEntityRecognitionSuccessResult | PiiEntityRecognitionErrorResult;
1284
1417
 
1285
1418
  /**
1286
- * Options for the recognize entities operation.
1419
+ * The result of a pii entity recognition action on a single document,
1420
+ * containing the collection of {@link Entity} objects identified in that
1421
+ * document.
1287
1422
  */
1288
- export declare interface RecognizeCategorizedEntitiesOptions extends TextAnalyticsOperationOptions {
1423
+ export declare interface PiiEntityRecognitionSuccessResult extends TextAnalysisSuccessResult {
1289
1424
  /**
1290
- * Specifies the measurement unit used to calculate the offset and length properties.
1291
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1292
- * The default is the JavaScript's default which is "Utf16CodeUnit".
1425
+ * The collection of entities identified in the input document.
1293
1426
  */
1294
- stringIndexType?: StringIndexType;
1295
- }
1296
-
1297
- /**
1298
- * The result of the recognize entities operation on a single document.
1299
- */
1300
- export declare type RecognizeCategorizedEntitiesResult = RecognizeCategorizedEntitiesSuccessResult | RecognizeCategorizedEntitiesErrorResult;
1301
-
1302
- /**
1303
- * Array of `RecognizeCategorizedEntitiesResult` objects corresponding to a batch of input documents, and
1304
- * annotated with information about the batch operation.
1305
- */
1306
- export declare interface RecognizeCategorizedEntitiesResultArray extends Array<RecognizeCategorizedEntitiesResult> {
1307
- /**
1308
- * Statistics about the input document batch and how it was processed
1309
- * by the service. This property will have a value when includeStatistics is set to true
1310
- * in the client call.
1311
- */
1312
- statistics?: TextDocumentBatchStatistics;
1427
+ readonly entities: Entity[];
1313
1428
  /**
1314
- * The version of the text analytics model used by this operation on this
1315
- * batch of input documents.
1316
- */
1317
- modelVersion: string;
1318
- }
1319
-
1320
- /**
1321
- * The result of the recognize entities operation on a single document, containing the collection of
1322
- * `Entity` objects identified in that document.
1323
- */
1324
- export declare interface RecognizeCategorizedEntitiesSuccessResult extends TextAnalyticsSuccessResult {
1325
- /**
1326
- * The collection of entities identified in the input document.
1327
- */
1328
- readonly entities: CategorizedEntity[];
1329
- }
1330
-
1331
- /**
1332
- * Options for a custom recognize entities action. For more information, please refer
1333
- * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customentityrecognition}
1334
- */
1335
- export declare interface RecognizeCustomEntitiesAction extends CustomTextAnalyticsAction {
1336
- /**
1337
- * Specifies the measurement unit used to calculate the offset and length properties.
1338
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1339
- * The default is the JavaScript's default which is "Utf16CodeUnit".
1340
- */
1341
- stringIndexType?: StringIndexType;
1342
- /**
1343
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
1344
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
1345
- * disables input logging and may limit our ability to remediate issues that occur.
1346
- */
1347
- disableServiceLogs?: boolean;
1348
- }
1349
-
1350
- /**
1351
- * The result of a custom recognize entities action.
1352
- */
1353
- export declare type RecognizeCustomEntitiesActionResult = RecongizeCustomEntitiesActionSuccessResult | RecongizeCustomEntitiesActionErrorResult;
1354
-
1355
- /**
1356
- * An error result from the recognize custom entities operation on a single document.
1357
- */
1358
- export declare type RecognizeCustomEntitiesErrorResult = TextAnalyticsErrorResult;
1359
-
1360
- /**
1361
- * The result of the custom recognize entities operation on a single document.
1362
- */
1363
- export declare type RecognizeCustomEntitiesResult = RecognizeCustomEntitiesSuccessResult | RecognizeCustomEntitiesErrorResult;
1364
-
1365
- /**
1366
- * Array of `CustomRecognizeEntitiesResult` objects corresponding to a batch of input documents, and
1367
- * annotated with information about the batch operation.
1368
- */
1369
- export declare interface RecognizeCustomEntitiesResultArray extends Array<RecognizeCustomEntitiesResult> {
1370
- /**
1371
- * Statistics about the input document batch and how it was processed
1372
- * by the service. This property will have a value when includeStatistics is set to true
1373
- * in the client call.
1374
- */
1375
- statistics?: TextDocumentBatchStatistics;
1376
- /**
1377
- * The version of the text analytics custom project used by this operation on this
1378
- * batch of input documents.
1379
- */
1380
- projectName: string;
1381
- /**
1382
- * The version of the text analytics custom deployment used by this operation on this
1383
- * batch of input documents.
1384
- */
1385
- deploymentName: string;
1386
- }
1387
-
1388
- /**
1389
- * The result of the recognize custom entities operation on a single document,
1390
- * containing a collection of the entities identified in that document.
1391
- */
1392
- export declare interface RecognizeCustomEntitiesSuccessResult extends TextAnalyticsSuccessResult {
1393
- /**
1394
- * The collection of entities identified in the input document.
1395
- */
1396
- entities: CategorizedEntity[];
1397
- }
1398
-
1399
- /**
1400
- * Options for an entities linking action.
1401
- */
1402
- export declare interface RecognizeLinkedEntitiesAction extends TextAnalyticsAction {
1403
- /**
1404
- * Specifies the measurement unit used to calculate the offset and length properties.
1405
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1406
- * The default is the JavaScript's default which is "Utf16CodeUnit".
1407
- */
1408
- stringIndexType?: StringIndexType;
1409
- /**
1410
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
1411
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
1412
- * disables input logging and may limit our ability to remediate issues that occur.
1413
- */
1414
- disableServiceLogs?: boolean;
1415
- }
1416
-
1417
- /**
1418
- * The error of a recognize linked entities action.
1419
- */
1420
- export declare type RecognizeLinkedEntitiesActionErrorResult = TextAnalyticsActionErrorResult;
1421
-
1422
- /**
1423
- * The result of a recognize linked entities action.
1424
- */
1425
- export declare type RecognizeLinkedEntitiesActionResult = RecognizeLinkedEntitiesActionSuccessResult | RecognizeLinkedEntitiesActionErrorResult;
1426
-
1427
- /**
1428
- * The results of a succeeded recognize linked entities action.
1429
- */
1430
- export declare interface RecognizeLinkedEntitiesActionSuccessResult extends TextAnalyticsActionSuccessState {
1431
- /**
1432
- * Array of the results for each linked entities recognition action.
1433
- */
1434
- results: RecognizeLinkedEntitiesResultArray;
1435
- }
1436
-
1437
- /**
1438
- * An error result from the recognize linked entities operation on a single document.
1439
- */
1440
- export declare type RecognizeLinkedEntitiesErrorResult = TextAnalyticsErrorResult;
1441
-
1442
- /**
1443
- * Options for the recognize linked entities operation.
1444
- */
1445
- export declare interface RecognizeLinkedEntitiesOptions extends TextAnalyticsOperationOptions {
1446
- /**
1447
- * Specifies the measurement unit used to calculate the offset and length properties.
1448
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1449
- * The default is the JavaScript's default which is "Utf16CodeUnit".
1429
+ * The text redacted.
1450
1430
  */
1451
- stringIndexType?: StringIndexType;
1431
+ readonly redactedText: string;
1452
1432
  }
1453
1433
 
1454
1434
  /**
1455
- * The result of the recognize linked entities operation on a single document.
1435
+ * Defines values for RelationType. \
1436
+ * {@link KnownRelationType} can be used interchangeably with RelationType,
1437
+ * this enum contains the known values that the service supports.
1438
+ * ### Known values supported by the service
1439
+ * **Abbreviation** \
1440
+ * **DirectionOfBodyStructure** \
1441
+ * **DirectionOfCondition** \
1442
+ * **DirectionOfExamination** \
1443
+ * **DirectionOfTreatment** \
1444
+ * **DosageOfMedication** \
1445
+ * **FormOfMedication** \
1446
+ * **FrequencyOfMedication** \
1447
+ * **FrequencyOfTreatment** \
1448
+ * **QualifierOfCondition** \
1449
+ * **RelationOfExamination** \
1450
+ * **RouteOfMedication** \
1451
+ * **TimeOfCondition** \
1452
+ * **TimeOfEvent** \
1453
+ * **TimeOfExamination** \
1454
+ * **TimeOfMedication** \
1455
+ * **TimeOfTreatment** \
1456
+ * **UnitOfCondition** \
1457
+ * **UnitOfExamination** \
1458
+ * **ValueOfCondition** \
1459
+ * **ValueOfExamination**
1456
1460
  */
1457
- export declare type RecognizeLinkedEntitiesResult = RecognizeLinkedEntitiesSuccessResult | RecognizeLinkedEntitiesErrorResult;
1461
+ export declare type RelationType = string;
1458
1462
 
1459
1463
  /**
1460
- * Array of `RecognizeLinkedEntitiesResult` objects corresponding to a batch of input documents, and
1461
- * annotated with information about the batch operation.
1464
+ * Options for the begin analyze actions operation.
1462
1465
  */
1463
- export declare interface RecognizeLinkedEntitiesResultArray extends Array<RecognizeLinkedEntitiesResult> {
1464
- /**
1465
- * Statistics about the input document batch and how it was processed
1466
- * by the service. This property will have a value when includeStatistics is set to true
1467
- * in the client call.
1468
- */
1469
- statistics?: TextDocumentBatchStatistics;
1466
+ export declare interface RestoreAnalyzeBatchPollerOptions extends TextAnalysisOperationOptions {
1470
1467
  /**
1471
- * The version of the text analytics model used by this operation on this
1472
- * batch of input documents.
1468
+ * Time delay between poll requests, in milliseconds.
1473
1469
  */
1474
- modelVersion: string;
1470
+ updateIntervalInMs?: number;
1475
1471
  }
1476
1472
 
1477
1473
  /**
1478
- * The result of the recognize linked entities operation on a single document,
1479
- * containing a collection of the `LinkedEntity` objects identified in that document.
1474
+ * The predicted sentiment for a given span of text. For more information
1475
+ * regarding text sentiment, see {@link https://docs.microsoft.com//azure/cognitive-services/language-service/sentiment-opinion-mining/overview}.
1480
1476
  */
1481
- export declare interface RecognizeLinkedEntitiesSuccessResult extends TextAnalyticsSuccessResult {
1477
+ export declare interface SentenceSentiment {
1482
1478
  /**
1483
- * The collection of entities identified in the input document.
1479
+ * The sentence text.
1484
1480
  */
1485
- readonly entities: LinkedEntity[];
1486
- }
1487
-
1488
- /**
1489
- * Options for a Pii entities recognition action.
1490
- */
1491
- export declare interface RecognizePiiEntitiesAction extends TextAnalyticsAction {
1481
+ readonly text: string;
1492
1482
  /**
1493
- * Filters entities to ones only included in the specified domain (e.g., if
1494
- * set to 'PHI', entities in the Protected Healthcare Information domain will
1495
- * only be returned). @see {@link https://aka.ms/tanerpii} for more information.
1483
+ * The predicted Sentiment for the sentence. For a list of possible values,
1484
+ * see {@link SentenceSentimentLabel}
1496
1485
  */
1497
- domainFilter?: PiiEntityDomain;
1486
+ readonly sentiment: SentenceSentimentLabel;
1498
1487
  /**
1499
- * Filters entities to ones only included in the specified array of categories
1488
+ * The sentiment confidence score between 0 and 1 for the sentence for all
1489
+ * classes.
1500
1490
  */
1501
- categoriesFilter?: PiiEntityCategory[];
1491
+ readonly confidenceScores: SentimentConfidenceScores;
1502
1492
  /**
1503
- * Specifies the measurement unit used to calculate the offset and length properties.
1504
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1505
- * The default is the JavaScript's default which is "Utf16CodeUnit".
1493
+ * The sentence text offset from the start of the document.
1506
1494
  */
1507
- stringIndexType?: StringIndexType;
1495
+ readonly offset: number;
1508
1496
  /**
1509
- * If set to false, you opt-in to have your text input logged for troubleshooting. By default, Text Analytics
1510
- * will not log your input text for pii entities recognition. Setting this parameter to false,
1511
- * enables input logging.
1497
+ * The length of the sentence text.
1512
1498
  */
1513
- disableServiceLogs?: boolean;
1514
- }
1515
-
1516
- /**
1517
- * The error of a recognize pii entities action.
1518
- */
1519
- export declare type RecognizePiiEntitiesActionErrorResult = TextAnalyticsActionErrorResult;
1520
-
1521
- /**
1522
- * The result of a recognize pii entities action.
1523
- */
1524
- export declare type RecognizePiiEntitiesActionResult = RecognizePiiEntitiesActionSuccessResult | RecognizePiiEntitiesActionErrorResult;
1525
-
1526
- /**
1527
- * The results of a succeeded recognize pii entities action.
1528
- */
1529
- export declare interface RecognizePiiEntitiesActionSuccessResult extends TextAnalyticsActionSuccessState {
1499
+ readonly length: number;
1530
1500
  /**
1531
- * Array of the results for each pii entities recognition action.
1501
+ * The list of opinions mined from this sentence. For example in "The food is
1502
+ * good, but the service is bad", the following two opinions will be returned:
1503
+ * "food is good" and "service is bad".
1504
+ *
1505
+ * It is non-empty only returned if {@link includeOpinionMining} was set to
1506
+ * `true`.
1532
1507
  */
1533
- results: RecognizePiiEntitiesResultArray;
1508
+ readonly opinions: Opinion[];
1534
1509
  }
1535
1510
 
1536
- /**
1537
- * An error result from the recognize entities operation on a single document.
1538
- */
1539
- export declare type RecognizePiiEntitiesErrorResult = TextAnalyticsErrorResult;
1511
+ /** Defines values for SentenceSentimentLabel. */
1512
+ export declare type SentenceSentimentLabel = "positive" | "neutral" | "negative";
1540
1513
 
1541
- /**
1542
- * Options for the recognize PII entities operation.
1543
- */
1544
- export declare interface RecognizePiiEntitiesOptions extends TextAnalyticsOperationOptions {
1545
- /**
1546
- * Filters entities to ones only included in the specified domain (e.g., if
1547
- * set to 'PHI', entities in the Protected Healthcare Information domain will
1548
- * only be returned). @see {@link https://aka.ms/tanerpii} for more information.
1549
- */
1550
- domainFilter?: PiiEntityDomain;
1514
+ /** Options for a sentiment analysis action. */
1515
+ export declare type SentimentAnalysisAction = ActionPrebuilt & {
1516
+ /** Enables performing opinion mining on the input documents, a more granular analysis around the aspects of a product or service (also known as aspect-based sentiment analysis). If set to true, {@link SentenceSentiment.opinions} will contain the results of this analysis. See {@link https://docs.microsoft.com/azure/cognitive-services/language-service/sentiment-opinion-mining/overview#opinion-mining the service documentation} for more information. */
1517
+ includeOpinionMining?: boolean;
1551
1518
  /**
1552
- * Specifies the measurement unit used to calculate the offset and length properties.
1553
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1519
+ * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
1520
+ *
1554
1521
  * The default is the JavaScript's default which is "Utf16CodeUnit".
1555
1522
  */
1556
1523
  stringIndexType?: StringIndexType;
1557
- /**
1558
- * Filters entities to ones only included in the specified array of categories
1559
- */
1560
- categoriesFilter?: PiiEntityCategory[];
1561
- }
1562
-
1563
- /**
1564
- * The result of the recognize entities operation on a single document.
1565
- */
1566
- export declare type RecognizePiiEntitiesResult = RecognizePiiEntitiesSuccessResult | RecognizePiiEntitiesErrorResult;
1524
+ };
1567
1525
 
1568
- /**
1569
- * Collection of `RecognizePiiEntitiesResult` objects corresponding to a batch of input documents, and
1570
- * annotated with information about the batch operation.
1571
- */
1572
- export declare interface RecognizePiiEntitiesResultArray extends Array<RecognizePiiEntitiesResult> {
1573
- /**
1574
- * Statistics about the input document batch and how it was processed
1575
- * by the service. This property will have a value when includeStatistics is set to true
1576
- * in the client call.
1577
- */
1578
- statistics?: TextDocumentBatchStatistics;
1526
+ /** Options for a sentiment analysis batch action. */
1527
+ export declare interface SentimentAnalysisBatchAction extends AnalyzeBatchActionCommon, SentimentAnalysisAction {
1579
1528
  /**
1580
- * The version of the text analytics model used by this operation on this
1581
- * batch of input documents.
1529
+ * The kind of the action.
1582
1530
  */
1583
- modelVersion: string;
1531
+ kind: "SentimentAnalysis";
1584
1532
  }
1585
1533
 
1586
1534
  /**
1587
- * The result of the recognize entities operation on a single document, containing the collection of
1588
- * `Entity` objects identified in that document.
1535
+ * The result of a sentiment analysis batch action.
1589
1536
  */
1590
- export declare interface RecognizePiiEntitiesSuccessResult extends TextAnalyticsSuccessResult {
1591
- /**
1592
- * The collection of entities identified in the input document.
1593
- */
1594
- readonly entities: PiiEntity[];
1595
- /**
1596
- * The text redacted.
1597
- */
1598
- redactedText: string;
1599
- }
1537
+ export declare type SentimentAnalysisBatchResult = ActionMetadata & BatchActionResult<SentimentAnalysisResult, "SentimentAnalysis">;
1600
1538
 
1601
1539
  /**
1602
- * The error of a custom recognize entities action.
1540
+ * An error result from a sentiment analysis action on a single document.
1603
1541
  */
1604
- export declare type RecongizeCustomEntitiesActionErrorResult = TextAnalyticsActionErrorResult;
1542
+ export declare type SentimentAnalysisErrorResult = TextAnalysisErrorResult;
1605
1543
 
1606
1544
  /**
1607
- * The results of a succeeded custom recognize entities action.
1545
+ * The result of a sentiment analysis action on a single document.
1608
1546
  */
1609
- export declare interface RecongizeCustomEntitiesActionSuccessResult extends TextAnalyticsActionSuccessState {
1610
- /**
1611
- * Array of the results for each custom recognize entities action.
1612
- */
1613
- results: RecognizeCustomEntitiesResultArray;
1614
- }
1615
-
1616
- export declare interface SentenceAssessment {
1617
- /** Assessment sentiment in the sentence. */
1618
- sentiment: TokenSentimentValue;
1619
- /** Assessment sentiment confidence scores in the sentence. */
1620
- confidenceScores: TargetConfidenceScoreLabel;
1621
- /** The assessment offset from the start of the sentence. */
1622
- offset: number;
1623
- /** The length of the assessment. */
1624
- length: number;
1625
- /** The assessment text detected. */
1626
- text: string;
1627
- /** The indicator representing if the assessment is negated. */
1628
- isNegated: boolean;
1629
- }
1547
+ export declare type SentimentAnalysisResult = SentimentAnalysisSuccessResult | SentimentAnalysisErrorResult;
1630
1548
 
1631
1549
  /**
1632
- * The predicted sentiment for a given span of text. For more information regarding text sentiment, see https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/how-tos/text-analytics-how-to-sentiment-analysis.
1550
+ * The result of a sentiment analysis action on a single document,
1551
+ * containing the predicted sentiment for each sentence as well as for the full
1552
+ * document.
1633
1553
  */
1634
- export declare interface SentenceSentiment {
1635
- /**
1636
- * The sentence text.
1637
- */
1638
- text: string;
1639
- /**
1640
- * The predicted Sentiment for the sentence.
1641
- */
1642
- sentiment: SentenceSentimentLabel;
1643
- /**
1644
- * The sentiment confidence score between 0 and 1 for the sentence for all classes.
1645
- */
1646
- confidenceScores: SentimentConfidenceScores;
1554
+ export declare interface SentimentAnalysisSuccessResult extends TextAnalysisSuccessResult {
1647
1555
  /**
1648
- * The sentence text offset from the start of the document.
1556
+ * Predicted sentiment for document. For a list of possible values, see {@link DocumentSentimentLabel}
1649
1557
  */
1650
- offset: number;
1558
+ readonly sentiment: DocumentSentimentLabel;
1651
1559
  /**
1652
- * The length of the sentence text.
1560
+ * Document level sentiment confidence scores between 0 and 1 for each
1561
+ * sentiment class.
1653
1562
  */
1654
- length: number;
1563
+ readonly confidenceScores: SentimentConfidenceScores;
1655
1564
  /**
1656
- * The list of opinions mined from this sentence. For example in "The food is
1657
- * good, but the service is bad", we would mine these two opinions "food is
1658
- * good", "service is bad". Only returned if `includeOpinionMining` is set to
1659
- * True in the call to `analyzeSentiment`.
1565
+ * The predicted sentiment for each sentence in the corresponding document.
1660
1566
  */
1661
- opinions: Opinion[];
1567
+ readonly sentences: SentenceSentiment[];
1662
1568
  }
1663
1569
 
1664
- /** Defines values for SentenceSentimentLabel. */
1665
- export declare type SentenceSentimentLabel = "positive" | "neutral" | "negative";
1666
-
1667
1570
  /** Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative. */
1668
1571
  export declare interface SentimentConfidenceScores {
1669
1572
  positive: number;
@@ -1672,110 +1575,58 @@ export declare interface SentimentConfidenceScores {
1672
1575
  }
1673
1576
 
1674
1577
  /**
1675
- * Options for an custom classify document single category action. For more information, please refer
1676
- * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}
1677
- */
1678
- export declare interface SingleCategoryClassifyAction extends CustomTextAnalyticsAction {
1679
- /**
1680
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
1681
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
1682
- * disables input logging and may limit our ability to remediate issues that occur.
1683
- */
1684
- disableServiceLogs?: boolean;
1685
- }
1686
-
1687
- /**
1688
- * The error of a custom classify document single category action.
1689
- */
1690
- export declare type SingleCategoryClassifyActionErrorResult = TextAnalyticsActionErrorResult;
1691
-
1692
- /**
1693
- * The result of a custom classify document single category action.
1694
- */
1695
- export declare type SingleCategoryClassifyActionResult = SingleCategoryClassifyActionSuccessResult | SingleCategoryClassifyActionErrorResult;
1696
-
1697
- /**
1698
- * The results of a succeeded custom classify document single category action.
1699
- */
1700
- export declare interface SingleCategoryClassifyActionSuccessResult extends TextAnalyticsActionSuccessState {
1701
- /**
1702
- * Array of the results for each custom classify document single category action.
1703
- */
1704
- results: SingleCategoryClassifyResultArray;
1705
- }
1706
-
1707
- /**
1708
- * An error result from the custom classify document single category operation on a single document.
1578
+ * Defines values for StringIndexType. \
1579
+ * {@link KnownStringIndexType} can be used interchangeably with StringIndexType,
1580
+ * this enum contains the known values that the service supports.
1581
+ * ### Known values supported by the service
1582
+ * **TextElements_v8**: Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo. \
1583
+ * **UnicodeCodePoint**: Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python. \
1584
+ * **Utf16CodeUnit**: Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript.
1709
1585
  */
1710
- export declare type SingleCategoryClassifyErrorResult = TextAnalyticsErrorResult;
1586
+ export declare type StringIndexType = string;
1711
1587
 
1712
1588
  /**
1713
- * The result of the custom classify document single category operation on a single document.
1589
+ * An error result from the extract summary operation on a single document.
1714
1590
  */
1715
- export declare type SingleCategoryClassifyResult = SingleCategoryClassifySuccessResult | SingleCategoryClassifyErrorResult;
1591
+ export declare type SummarizationExtractionErrorResult = TextAnalysisErrorResult;
1716
1592
 
1717
1593
  /**
1718
- * Array of `SingleCategoryClassifyResult` objects corresponding to a batch of input documents, and
1719
- * annotated with information about the batch operation.
1594
+ * The result of the extract summary operation on a single document.
1720
1595
  */
1721
- export declare interface SingleCategoryClassifyResultArray extends Array<SingleCategoryClassifyResult> {
1722
- /**
1723
- * Statistics about the input document batch and how it was processed
1724
- * by the service. This property will have a value when includeStatistics is set to true
1725
- * in the client call.
1726
- */
1727
- statistics?: TextDocumentBatchStatistics;
1728
- /**
1729
- * The version of the text analytics custom project used by this operation on this
1730
- * batch of input documents.
1731
- */
1732
- projectName: string;
1733
- /**
1734
- * The version of the text analytics custom deployment used by this operation on this
1735
- * batch of input documents.
1736
- */
1737
- deploymentName: string;
1738
- }
1596
+ export declare type SummarizationExtractionResult = SummarizationExtractionSuccessResult | SummarizationExtractionErrorResult;
1739
1597
 
1740
1598
  /**
1741
- * The result of the custom classify document single category operation on a single document,
1742
- * containing the result of the classification.
1599
+ * The result of the summarization extraction action on a single document,
1600
+ * containing a collection of the summary identified in that document.
1743
1601
  */
1744
- export declare interface SingleCategoryClassifySuccessResult extends TextAnalyticsSuccessResult {
1602
+ export declare interface SummarizationExtractionSuccessResult extends TextAnalysisSuccessResult {
1745
1603
  /**
1746
- * The classification result of the input document.
1604
+ * A list of sentences composing a summary of the input document.
1747
1605
  */
1748
- classification: ClassificationCategory;
1606
+ readonly sentences: SummarySentence[];
1749
1607
  }
1750
1608
 
1751
- /**
1752
- * Measurement units that can used to calculate the offset and length properties.
1753
- */
1754
- export declare type StringIndexType = "TextElement_v8" | "UnicodeCodePoint" | "Utf16CodeUnit";
1755
-
1756
- /**
1757
- * An extracted sentence as part of the summary of a document.
1758
- */
1609
+ /** A sentence that is part of the extracted summary. */
1759
1610
  export declare interface SummarySentence {
1760
1611
  /** The extracted sentence text. */
1761
1612
  text: string;
1762
1613
  /** A double value representing the relevance of the sentence within the summary. Higher values indicate higher importance. */
1763
1614
  rankScore: number;
1764
- /** The sentence offset from the start of the document, based on the value of the stringIndexType parameter. */
1615
+ /** The sentence offset from the start of the document, based on the value of the parameter StringIndexType. */
1765
1616
  offset: number;
1766
1617
  /** The length of the sentence. */
1767
1618
  length: number;
1768
1619
  }
1769
1620
 
1770
1621
  /** Represents the confidence scores across all sentiment classes: positive, neutral, negative. */
1771
- export declare interface TargetConfidenceScoreLabel {
1622
+ export declare interface TargetConfidenceScores {
1772
1623
  positive: number;
1773
1624
  negative: number;
1774
1625
  }
1775
1626
 
1776
1627
  /**
1777
1628
  * TargetSentiment contains the predicted sentiment, confidence scores and other
1778
- * information about an target of a product. A target of a product/service is a
1629
+ * information about a target of a product. A target of a product/service is a
1779
1630
  * key component of that product/service. For example in "The food at Hotel Foo
1780
1631
  * is good", "food" is a target of "Hotel Foo".
1781
1632
  */
@@ -1784,360 +1635,510 @@ export declare interface TargetSentiment {
1784
1635
  * The sentiment confidence score between 0 and 1 for the target for
1785
1636
  * 'positive' and 'negative' labels.
1786
1637
  */
1787
- confidenceScores: TargetConfidenceScoreLabel;
1638
+ readonly confidenceScores: TargetConfidenceScores;
1788
1639
  /**
1789
- * The predicted Sentiment for the Target. Possible values include 'positive',
1790
- * 'mixed', and 'negative'.
1640
+ * The predicted Sentiment for the Target. For a list of possible values,
1641
+ * see {@link TokenSentimentLabel}
1791
1642
  */
1792
- sentiment: TokenSentimentValue;
1643
+ readonly sentiment: TokenSentimentLabel;
1793
1644
  /**
1794
1645
  * The target text.
1795
1646
  */
1796
- text: string;
1647
+ readonly text: string;
1797
1648
  /**
1798
1649
  * The Target text offset from the start of the sentence.
1799
1650
  */
1800
- offset: number;
1651
+ readonly offset: number;
1801
1652
  /**
1802
1653
  * The length of the Target text.
1803
1654
  */
1804
- length: number;
1805
- }
1806
-
1807
- /**
1808
- * The type of a standard text analytics action.
1809
- */
1810
- export declare interface TextAnalyticsAction {
1811
- /**
1812
- * The version of the text analytics model used by this operation on this
1813
- * batch of input documents.
1814
- */
1815
- modelVersion?: string;
1816
- /**
1817
- * The preferred name for this action.
1818
- */
1819
- actionName?: string;
1820
- }
1821
-
1822
- /**
1823
- * The error of an analyze batch action.
1824
- */
1825
- export declare interface TextAnalyticsActionErrorResult extends TextAnalyticsActionState {
1826
- /**
1827
- * When this action was completed by the service.
1828
- */
1829
- readonly failedOn: Date;
1830
- /**
1831
- * The Error for this action result.
1832
- */
1833
- readonly error: TextAnalyticsError;
1655
+ readonly length: number;
1834
1656
  }
1835
1657
 
1836
1658
  /**
1837
- * Description of collection of actions for the analyze API to perform on input documents.
1659
+ * A client for interacting with the text analysis features in Azure Cognitive
1660
+ * Language Service.
1661
+ *
1662
+ * The client needs the endpoint of a Language resource and an authentication
1663
+ * method such as an API key or AAD. The API key and endpoint can be found in
1664
+ * the Language resource page in the Azure portal. They will be located in the
1665
+ * resource's Keys and Endpoint page, under Resource Management.
1666
+ *
1667
+ * ### Examples for authentication:
1668
+ *
1669
+ * #### API Key
1670
+ *
1671
+ * ```js
1672
+ * import { TextAnalysisClient, AzureKeyCredential } from "@azure/ai-text-analytics";
1673
+ *
1674
+ * const endpoint = "https://<resource name>.cognitiveservices.azure.com";
1675
+ * const credential = new AzureKeyCredential("<api key>");
1676
+ *
1677
+ * const client = new TextAnalysisClient(endpoint, credential);
1678
+ * ```
1679
+ *
1680
+ * #### Azure Active Directory
1681
+ *
1682
+ * See the [`@azure/identity`](https://npmjs.com/package/\@azure/identity)
1683
+ * package for more information about authenticating with Azure Active Directory.
1684
+ *
1685
+ * ```js
1686
+ * import { TextAnalysisClient } from "@azure/ai-text-analytics";
1687
+ * import { DefaultAzureCredential } from "@azure/identity";
1688
+ *
1689
+ * const endpoint = "https://<resource name>.cognitiveservices.azure.com";
1690
+ * const credential = new DefaultAzureCredential();
1691
+ *
1692
+ * const client = new TextAnalysisClient(endpoint, credential);
1693
+ * ```
1838
1694
  */
1839
- export declare interface TextAnalyticsActions {
1840
- /**
1841
- * A collection of descriptions of entities recognition actions.
1842
- */
1843
- recognizeEntitiesActions?: RecognizeCategorizedEntitiesAction[];
1844
- /**
1845
- * A collection of descriptions of Pii entities recognition actions.
1846
- */
1847
- recognizePiiEntitiesActions?: RecognizePiiEntitiesAction[];
1848
- /**
1849
- * A collection of descriptions of key phrases recognition actions.
1850
- */
1851
- extractKeyPhrasesActions?: ExtractKeyPhrasesAction[];
1852
- /**
1853
- * A collection of descriptions of entities linking actions.
1854
- */
1855
- recognizeLinkedEntitiesActions?: RecognizeLinkedEntitiesAction[];
1856
- /**
1857
- * A collection of descriptions of sentiment analysis actions.
1858
- */
1859
- analyzeSentimentActions?: AnalyzeSentimentAction[];
1695
+ export declare class TextAnalysisClient {
1696
+ private readonly _client;
1697
+ private readonly _tracing;
1698
+ private readonly defaultCountryHint;
1699
+ private readonly defaultLanguage;
1860
1700
  /**
1861
- * A collection of descriptions of summarization extraction actions.
1862
- */
1863
- extractSummaryActions?: ExtractSummaryAction[];
1864
- /**
1865
- * A collection of descriptions of custom entity recognition actions. For more information, please refer
1866
- * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customentityrecognition}
1867
- */
1868
- recognizeCustomEntitiesActions?: RecognizeCustomEntitiesAction[];
1869
- /**
1870
- * A collection of descriptions of custom single classification actions. For more information, please refer
1871
- * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}
1872
- */
1873
- singleCategoryClassifyActions?: SingleCategoryClassifyAction[];
1874
- /**
1875
- * A collection of descriptions of custom multi classification actions. For more information, please refer
1876
- * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}
1701
+ * Creates an instance of TextAnalysisClient with the endpoint of a Language
1702
+ * resource and an authentication method such as an API key or AAD.
1703
+ *
1704
+ * The API key and endpoint can be found in the Language resource page in the
1705
+ * Azure portal. They will be located in the resource's Keys and Endpoint page,
1706
+ * under Resource Management.
1707
+ *
1708
+ * ### Example
1709
+ *
1710
+ * ```js
1711
+ * import { TextAnalysisClient, AzureKeyCredential } from "@azure/ai-text-analytics";
1712
+ *
1713
+ * const endpoint = "https://<resource name>.cognitiveservices.azure.com";
1714
+ * const credential = new AzureKeyCredential("<api key>");
1715
+ *
1716
+ * const client = new TextAnalysisClient(endpoint, credential);
1717
+ * ```
1718
+ *
1719
+ * @param endpointUrl - The URL to the endpoint of a Cognitive Language Service resource
1720
+ * @param credential - Key credential to be used to authenticate requests to the service.
1721
+ * @param options - Used to configure the TextAnalytics client.
1877
1722
  */
1878
- multiCategoryClassifyActions?: MultiCategoryClassifyAction[];
1879
- }
1880
-
1881
- /**
1882
- * The state of an action
1883
- */
1884
- export declare interface TextAnalyticsActionState {
1723
+ constructor(endpointUrl: string, credential: KeyCredential, options?: TextAnalysisClientOptions);
1885
1724
  /**
1886
- * The name of the action.
1725
+ * Creates an instance of TextAnalysisClient with the endpoint of a Language
1726
+ * resource and an authentication method such as an API key or AAD.
1727
+ *
1728
+ * The API key and endpoint can be found in the Language resource page in the
1729
+ * Azure portal. They will be located in the resource's Keys and Endpoint page,
1730
+ * under Resource Management.
1731
+ *
1732
+ * ### Example
1733
+ *
1734
+ * See the [`@azure/identity`](https://npmjs.com/package/\@azure/identity)
1735
+ * package for more information about authenticating with Azure Active Directory.
1736
+ *
1737
+ * ```js
1738
+ * import { TextAnalysisClient } from "@azure/ai-text-analytics";
1739
+ * import { DefaultAzureCredential } from "@azure/identity";
1740
+ *
1741
+ * const endpoint = "https://<resource name>.cognitiveservices.azure.com";
1742
+ * const credential = new DefaultAzureCredential();
1743
+ *
1744
+ * const client = new TextAnalysisClient(endpoint, credential);
1745
+ * ```
1746
+ *
1747
+ * @param endpointUrl - The URL to the endpoint of a Cognitive Language Service resource
1748
+ * @param credential - Token credential to be used to authenticate requests to the service.
1749
+ * @param options - Used to configure the TextAnalytics client.
1887
1750
  */
1888
- actionName?: string;
1889
- }
1890
-
1891
- /**
1892
- * The state of a succeeded action.
1893
- */
1894
- export declare interface TextAnalyticsActionSuccessState extends TextAnalyticsActionState {
1751
+ constructor(endpointUrl: string, credential: TokenCredential, options?: TextAnalysisClientOptions);
1895
1752
  /**
1896
- * When this action was completed by the service.
1753
+ * Runs a predictive model to determine the language that the passed-in
1754
+ * input strings are written in, and returns, for each one, the detected
1755
+ * language as well as a score indicating the model's confidence that the
1756
+ * inferred language is correct. Scores close to 1 indicate high certainty in
1757
+ * the result. 120 languages are supported.
1758
+ *
1759
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}
1760
+ * for data limits.
1761
+ *
1762
+ * ### Examples
1763
+ *
1764
+ * #### Language detection
1765
+ *
1766
+ * ```js
1767
+ * const documents = [<input strings>];
1768
+ * const countryHint = "us";
1769
+ * const results = await client.analyze("LanguageDetection", documents, countryHint);
1770
+ *
1771
+ * for (let i = 0; i < results.length; i++) {
1772
+ * const result = results[i];
1773
+ * if (result.error) {
1774
+ * // a document has an error instead of results
1775
+ * } else {
1776
+ * const { name, confidenceScore, iso6391Name } = result.primaryLanguage;
1777
+ * }
1778
+ * }
1779
+ * ```
1780
+ *
1781
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/language-detection/overview}
1782
+ * for more information on language detection.
1783
+ *
1784
+ * @param actionName - the name of the action to be performed on the input
1785
+ * documents, see ${@link AnalyzeActionName}
1786
+ * @param documents - the input documents to be analyzed
1787
+ * @param options - optional action parameters and settings for the operation
1788
+ *
1789
+ * @returns an array of results where each element contains the primary language
1790
+ * for the corresponding input document.
1897
1791
  */
1898
- readonly completedOn: Date;
1792
+ analyze<ActionName extends "LanguageDetection">(actionName: ActionName, documents: LanguageDetectionInput[], options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions): Promise<AnalyzeResult<ActionName>>;
1899
1793
  /**
1900
- * Discriminant to determine if that this is an error result.
1794
+ * Runs a predictive model to determine the language that the passed-in
1795
+ * input strings are written in, and returns, for each one, the detected
1796
+ * language as well as a score indicating the model's confidence that the
1797
+ * inferred language is correct. Scores close to 1 indicate high certainty in
1798
+ * the result. 120 languages are supported.
1799
+ *
1800
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}
1801
+ * for data limits.
1802
+ *
1803
+ * ### Examples
1804
+ *
1805
+ * #### Language detection
1806
+ *
1807
+ * ```js
1808
+ * const documents = [<input strings>];
1809
+ * const countryHint = "us";
1810
+ * const results = await client.analyze("LanguageDetection", documents, countryHint);
1811
+ *
1812
+ * for (const result of results) {
1813
+ * if (result.error) {
1814
+ * // a document has an error instead of results
1815
+ * } else {
1816
+ * const { name, confidenceScore, iso6391Name } = result.primaryLanguage;
1817
+ * }
1818
+ * }
1819
+ * ```
1820
+ *
1821
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/language-detection/overview}
1822
+ * for more information on language detection.
1823
+ *
1824
+ * @param actionName - the name of the action to be performed on the input
1825
+ * documents, see ${@link AnalyzeActionName}
1826
+ * @param documents - the input documents to be analyzed
1827
+ * @param countryHint - Indicates the country of origin for all of
1828
+ * the input strings to assist the model in predicting the language they are
1829
+ * written in. If unspecified, this value will be set to the default
1830
+ * country hint in `TextAnalysisClientOptions`. If set to an empty string,
1831
+ * or the string "none", the service will apply a model where the country is
1832
+ * explicitly unset. The same country hint is applied to all strings in the
1833
+ * input collection.
1834
+ * @param options - optional action parameters and settings for the operation
1835
+ *
1836
+ * @returns an array of results where each element contains the primary language
1837
+ * for the corresponding input document.
1901
1838
  */
1902
- readonly error?: undefined;
1903
- }
1904
-
1905
- /**
1906
- * Client class for interacting with Azure Text Analytics.
1907
- */
1908
- export declare class TextAnalyticsClient {
1839
+ analyze<ActionName extends "LanguageDetection">(actionName: ActionName, documents: string[], countryHint?: string, options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions): Promise<AnalyzeResult<ActionName>>;
1909
1840
  /**
1910
- * The URL to the TextAnalytics endpoint
1841
+ * Runs a predictive model to perform the action of choice on the input
1842
+ * documents. See ${@link AnalyzeActionName} for a list of supported
1843
+ * actions.
1844
+ *
1845
+ * The layout of each item in the results array depends on the action chosen.
1846
+ * For example, each PIIEntityRecognition document result consists of both
1847
+ * `entities` and `redactedText` where the former is a list of all Pii entities
1848
+ * in the text and the latter is the original text after all such Pii entities
1849
+ * have been redacted from it.
1850
+ *
1851
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}
1852
+ * for data limits.
1853
+ *
1854
+ * ### Examples
1855
+ *
1856
+ * #### Opinion mining
1857
+ *
1858
+ * ```js
1859
+ * const documents = [{
1860
+ * id: "1",
1861
+ * text: "The food and service aren't the best",
1862
+ * language: "en"
1863
+ * }];
1864
+ * const results = await client.analyze("SentimentAnalysis", documents, {
1865
+ * includeOpinionMining: true,
1866
+ * });
1867
+ *
1868
+ * for (const result of results) {
1869
+ * if (result.error) {
1870
+ * // a document has an error instead of results
1871
+ * } else {
1872
+ * const { sentiment, confidenceScores, sentences } = result;
1873
+ * for (const { sentiment, confidenceScores, opinions } of sentences) {
1874
+ * for (const { target, assessments } of opinions) {
1875
+ * const { text, sentiment, confidenceScores } = target;
1876
+ * for (const { text, sentiment } of assessments) {
1877
+ * // Do something
1878
+ * }
1879
+ * }
1880
+ * }
1881
+ * }
1882
+ * }
1883
+ * ```
1884
+ *
1885
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/sentiment-opinion-mining/overview}
1886
+ * for more information on opinion mining.
1887
+ *
1888
+ * #### Personally identifiable information
1889
+ *
1890
+ * ```js
1891
+ * const documents = [<input documents>];
1892
+ * const categoriesFilter = [KnownPiiCategory.USSocialSecurityNumber];
1893
+ * const domainFilter = KnownPiiDomain.Phi;
1894
+ * const results = await client.analyze("PiiEntityRecognition", documents, {
1895
+ * domainFilter, categoriesFilter
1896
+ * });
1897
+ *
1898
+ * for (const result of results) {
1899
+ * if (result.error) {
1900
+ * // a document has an error instead of results
1901
+ * } else {
1902
+ * const { entities, redactedText } = result;
1903
+ * for (const { text, category, confidenceScore, length, offset } of entities) {
1904
+ * // Do something
1905
+ * }
1906
+ * }
1907
+ * }
1908
+ * ```
1909
+ *
1910
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/personally-identifiable-information/overview}
1911
+ * for more information on personally identifiable information.
1912
+ *
1913
+ * @param actionName - the name of the action to be performed on the input
1914
+ * documents, see ${@link AnalyzeActionName}
1915
+ * @param documents - the input documents to be analyzed
1916
+ * @param options - optional action parameters and settings for the operation
1917
+ *
1918
+ * @returns an array of results corresponding to the input documents
1911
1919
  */
1912
- readonly endpointUrl: string;
1920
+ analyze<ActionName extends AnalyzeActionName = AnalyzeActionName>(actionName: ActionName, documents: TextDocumentInput[], options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions): Promise<AnalyzeResult<ActionName>>;
1913
1921
  /**
1914
- * The default country hint to use. Defaults to "us".
1922
+ * Runs a predictive model to perform the action of choice on the input
1923
+ * strings. See ${@link AnalyzeActionName} for a list of supported
1924
+ * actions.
1925
+ *
1926
+ * The layout of each item in the results array depends on the action chosen.
1927
+ * For example, each PIIEntityRecognition document result consists of both
1928
+ * `entities` and `redactedText` where the former is a list of all Pii entities
1929
+ * in the text and the latter is the original text after all such Pii entities
1930
+ * have been redacted from it.
1931
+ *
1932
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}
1933
+ * for data limits.
1934
+ *
1935
+ * ### Examples
1936
+ *
1937
+ * #### Opinion mining
1938
+ *
1939
+ * ```js
1940
+ * const documents = ["The food and service aren't the best"];
1941
+ * const results = await client.analyze("SentimentAnalysis", documents, {
1942
+ * includeOpinionMining: true,
1943
+ * });
1944
+ *
1945
+ * for (const result of results) {
1946
+ * if (result.error) {
1947
+ * // a document has an error instead of results
1948
+ * } else {
1949
+ * const { sentiment, confidenceScores, sentences } = result;
1950
+ * for (const { sentiment, confidenceScores, opinions } of sentences) {
1951
+ * for (const { target, assessments } of opinions) {
1952
+ * const { text, sentiment, confidenceScores } = target;
1953
+ * for (const { text, sentiment } of assessments) {
1954
+ * // Do something
1955
+ * }
1956
+ * }
1957
+ * }
1958
+ * }
1959
+ * }
1960
+ * ```
1961
+ *
1962
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/sentiment-opinion-mining/overview}
1963
+ * for more information on opinion mining.
1964
+ *
1965
+ * #### Personally identifiable information
1966
+ *
1967
+ * ```js
1968
+ * const documents = [<input strings>];
1969
+ * const languageHint = "en";
1970
+ * const categoriesFilter = [KnownPiiCategory.USSocialSecurityNumber];
1971
+ * const domainFilter = KnownPiiDomain.Phi;
1972
+ * const results = await client.analyze("PiiEntityRecognition", documents, languageHint, {
1973
+ * domainFilter, categoriesFilter
1974
+ * });
1975
+ *
1976
+ * for (const result of results) {
1977
+ * if (result.error) {
1978
+ * // a document has an error instead of results
1979
+ * } else {
1980
+ * const { entities, redactedText } = result;
1981
+ * for (const { text, category, confidenceScore, length, offset } of entities) {
1982
+ * // Do something
1983
+ * }
1984
+ * }
1985
+ * }
1986
+ * ```
1987
+ *
1988
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/personally-identifiable-information/overview}
1989
+ * for more information on personally identifiable information.
1990
+ *
1991
+ * @param actionName - the name of the action to be performed on the input
1992
+ * documents, see ${@link AnalyzeActionName}
1993
+ * @param documents - the input documents to be analyzed
1994
+ * @param languageCode - the code of the language that all the input strings are
1995
+ * written in. If unspecified, this value will be set to the default
1996
+ * language in `TextAnalysisClientOptions`. If set to an empty string,
1997
+ * the service will apply a model where the language is explicitly set to
1998
+ * "None". Language support varies per action, for example, more information
1999
+ * about the languages supported for Entity Recognition actions can be
2000
+ * found in {@link https://docs.microsoft.com//azure/cognitive-services/language-service/named-entity-recognition/language-support}
2001
+ * @param options - optional action parameters and settings for the operation
2002
+ *
2003
+ * @returns an array of results corresponding to the input documents
1915
2004
  */
1916
- defaultCountryHint: string;
2005
+ analyze<ActionName extends AnalyzeActionName = AnalyzeActionName>(actionName: ActionName, documents: string[], languageCode?: string, options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions): Promise<AnalyzeResult<ActionName>>;
1917
2006
  /**
1918
- * The default language to use. Defaults to "en".
2007
+ * Performs an array (batch) of actions on the input documents. Each action has
2008
+ * a `kind` field that specifies the nature of the action. See ${@link AnalyzeBatchActionNames}
2009
+ * for a list of supported actions. In addition to `kind`, actions could also
2010
+ * have other parameters such as `disableServiceLogs` and `modelVersion`.
2011
+ *
2012
+ * The results array contains the results for those input actions where each
2013
+ * item also has a `kind` field that specifies the type of the results.
2014
+ *
2015
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}
2016
+ * for data limits.
2017
+ *
2018
+ * ### Examples
2019
+ *
2020
+ * #### Key phrase extraction and Pii entity recognition
2021
+ *
2022
+ * ```js
2023
+ * const poller = await client.beginAnalyzeBatch(
2024
+ * [{ kind: "KeyPhraseExtraction" }, { kind: "PiiEntityRecognition" }],
2025
+ * documents
2026
+ * );
2027
+ * const actionResults = await poller.pollUntilDone();
2028
+ *
2029
+ * for await (const actionResult of actionResults) {
2030
+ * if (actionResult.error) {
2031
+ * throw new Error(`Unexpected error`);
2032
+ * }
2033
+ * switch (actionResult.kind) {
2034
+ * case "KeyPhraseExtraction": {
2035
+ * for (const doc of actionResult.results) {
2036
+ * // do something
2037
+ * }
2038
+ * break;
2039
+ * }
2040
+ * case "PiiEntityRecognition": {
2041
+ * for (const doc of actionResult.results) {
2042
+ * // do something
2043
+ * }
2044
+ * break;
2045
+ * }
2046
+ * }
2047
+ * }
2048
+ * ```
2049
+ *
2050
+ * @param actions - an array of actions that will be run on the input documents
2051
+ * @param documents - the input documents to be analyzed
2052
+ * @param languageCode - the code of the language that all the input strings are
2053
+ * written in. If unspecified, this value will be set to the default
2054
+ * language in `TextAnalysisClientOptions`. If set to an empty string,
2055
+ * the service will apply a model where the language is explicitly set to
2056
+ * "None". Language support varies per action, for example, more information
2057
+ * about the languages supported for Entity Recognition actions can be
2058
+ * found in {@link https://docs.microsoft.com//azure/cognitive-services/language-service/named-entity-recognition/language-support}
2059
+ * @param options - optional settings for the operation
2060
+ *
2061
+ * @returns an array of results corresponding to the input actions
1919
2062
  */
1920
- defaultLanguage: string;
1921
- /* Excluded from this release type: client */
2063
+ beginAnalyzeBatch(actions: AnalyzeBatchAction[], documents: string[], languageCode?: string, options?: BeginAnalyzeBatchOptions): Promise<AnalyzeBatchPoller>;
1922
2064
  /**
1923
- * Creates an instance of TextAnalyticsClient.
2065
+ * Performs an array (batch) of actions on the input documents. Each action has
2066
+ * a `kind` field that specifies the nature of the action. See ${@link AnalyzeBatchActionNames}
2067
+ * for a list of supported actions. In addition to `kind`, actions could also
2068
+ * have other parameters such as `disableServiceLogs` and `modelVersion`.
1924
2069
  *
1925
- * Example usage:
1926
- * ```ts
1927
- * import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics";
2070
+ * The results array contains the results for those input actions where each
2071
+ * item also has a `kind` field that specifies the type of the results.
1928
2072
  *
1929
- * const client = new TextAnalyticsClient(
1930
- * "<service endpoint>",
1931
- * new AzureKeyCredential("<api key>")
2073
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}
2074
+ * for data limits.
2075
+ *
2076
+ * ### Examples
2077
+ *
2078
+ * #### Keyphrase extraction and Pii entity recognition
2079
+ *
2080
+ * ```js
2081
+ * const poller = await client.beginAnalyzeBatch(
2082
+ * [{ kind: "KeyPhraseExtraction" }, { kind: "PiiEntityRecognition" }],
2083
+ * documents
1932
2084
  * );
2085
+ * const actionResults = await poller.pollUntilDone();
2086
+ *
2087
+ * for await (const actionResult of actionResults) {
2088
+ * if (actionResult.error) {
2089
+ * throw new Error(`Unexpected error`);
2090
+ * }
2091
+ * switch (actionResult.kind) {
2092
+ * case "KeyPhraseExtraction": {
2093
+ * for (const doc of actionResult.results) {
2094
+ * // do something
2095
+ * }
2096
+ * break;
2097
+ * }
2098
+ * case "PiiEntityRecognition": {
2099
+ * for (const doc of actionResult.results) {
2100
+ * // do something
2101
+ * }
2102
+ * break;
2103
+ * }
2104
+ * }
2105
+ * }
1933
2106
  * ```
1934
- * @param endpointUrl - The URL to the TextAnalytics endpoint
1935
- * @param credential - Used to authenticate requests to the service.
1936
- * @param options - Used to configure the TextAnalytics client.
2107
+ *
2108
+ * @param actions - an array of actions that will be run on the input documents
2109
+ * @param documents - the input documents to be analyzed
2110
+ * @param options - optional settings for the operation
2111
+ *
2112
+ * @returns an array of results corresponding to the input actions
1937
2113
  */
1938
- constructor(endpointUrl: string, credential: TokenCredential | KeyCredential, options?: TextAnalyticsClientOptions);
2114
+ beginAnalyzeBatch(actions: AnalyzeBatchAction[], documents: TextDocumentInput[], options?: BeginAnalyzeBatchOptions): Promise<AnalyzeBatchPoller>;
1939
2115
  /**
1940
- * Runs a predictive model to determine the language that the passed-in
1941
- * input strings are written in, and returns, for each one, the detected
1942
- * language as well as a score indicating the model's confidence that the
1943
- * inferred language is correct. Scores close to 1 indicate high certainty in
1944
- * the result. 120 languages are supported.
1945
- * @param documents - A collection of input strings to analyze.
1946
- * @param countryHint - Indicates the country of origin for all of
1947
- * the input strings to assist the text analytics model in predicting
1948
- * the language they are written in. If unspecified, this value will be
1949
- * set to the default country hint in `TextAnalyticsClientOptions`.
1950
- * If set to an empty string, or the string "none", the service will apply a
1951
- * model where the country is explicitly unset.
1952
- * The same country hint is applied to all strings in the input collection.
1953
- * @param options - Optional parameters for the operation.
2116
+ * Creates a poller from the serialized state of another poller. This can be
2117
+ * useful when you want to create pollers on a different host or a poller
2118
+ * needs to be constructed after the original one is not in scope.
2119
+ *
2120
+ * @param serializedState - the serialized state of another poller. It is the
2121
+ * result of `poller.toString()`
2122
+ * @param options - optional settings for the operation
2123
+ *
2124
+ * # Example
2125
+ *
2126
+ * `client.beginAnalyzeBatch` returns a promise that will resolve to a poller.
2127
+ * The state of the poller can be serialized and used to create another as follows:
2128
+ *
2129
+ * ```js
2130
+ * const serializedState = poller.toString();
2131
+ * const rehydratedPoller = await client.createAnalyzeBatchPoller(serializedState);
2132
+ * const actionResults = await rehydratedPoller.pollUntilDone();
2133
+ * ```
1954
2134
  */
1955
- detectLanguage(documents: string[], countryHint?: string, options?: DetectLanguageOptions): Promise<DetectLanguageResultArray>;
1956
- /**
1957
- * Runs a predictive model to determine the language that the passed-in
1958
- * input document are written in, and returns, for each one, the detected
1959
- * language as well as a score indicating the model's confidence that the
1960
- * inferred language is correct. Scores close to 1 indicate high certainty in
1961
- * the result. 120 languages are supported.
1962
- * @param documents - A collection of input documents to analyze.
1963
- * @param options - Optional parameters for the operation.
1964
- */
1965
- detectLanguage(documents: DetectLanguageInput[], options?: DetectLanguageOptions): Promise<DetectLanguageResultArray>;
1966
- /**
1967
- * Runs a predictive model to identify a collection of named entities
1968
- * in the passed-in input strings, and categorize those entities into types
1969
- * such as person, location, or organization. For more information on
1970
- * available categories, @see
1971
- * {@link https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types}.
1972
- * For a list of languages supported by this operation, @see
1973
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
1974
- * @param documents - The input strings to analyze.
1975
- * @param language - The language that all the input strings are
1976
- written in. If unspecified, this value will be set to the default
1977
- language in `TextAnalyticsClientOptions`.
1978
- If set to an empty string, the service will apply a model
1979
- where the language is explicitly set to "None".
1980
- * @param options - Optional parameters for the operation.
1981
- */
1982
- recognizeEntities(documents: string[], language?: string, options?: RecognizeCategorizedEntitiesOptions): Promise<RecognizeCategorizedEntitiesResultArray>;
1983
- /**
1984
- * Runs a predictive model to identify a collection of named entities
1985
- * in the passed-in input documents, and categorize those entities into types
1986
- * such as person, location, or organization. For more information on
1987
- * available categories, @see
1988
- * {@link https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types}.
1989
- * For a list of languages supported by this operation, @see
1990
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
1991
- * @param documents - The input documents to analyze.
1992
- * @param options - Optional parameters for the operation.
1993
- */
1994
- recognizeEntities(documents: TextDocumentInput[], options?: RecognizeCategorizedEntitiesOptions): Promise<RecognizeCategorizedEntitiesResultArray>;
1995
- /**
1996
- * Runs a predictive model to identify the positive, negative, neutral, or mixed
1997
- * sentiment contained in the input strings, as well as scores indicating
1998
- * the model's confidence in each of the predicted sentiments. Optionally it
1999
- * can also identify targets in the text and assessments about it through
2000
- * opinion mining. For a list of languages supported by this operation, @see
2001
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
2002
- * @param documents - The input strings to analyze.
2003
- * @param language - The language that all the input strings are
2004
- written in. If unspecified, this value will be set to the default
2005
- language in `TextAnalyticsClientOptions`.
2006
- If set to an empty string, the service will apply a model
2007
- where the lanuage is explicitly set to "None".
2008
- * @param options - Optional parameters that includes enabling opinion mining.
2009
- */
2010
- analyzeSentiment(documents: string[], language?: string, options?: AnalyzeSentimentOptions): Promise<AnalyzeSentimentResultArray>;
2011
- /**
2012
- * Runs a predictive model to identify the positive, negative or neutral, or mixed
2013
- * sentiment contained in the input documents, as well as scores indicating
2014
- * the model's confidence in each of the predicted sentiments.Optionally it
2015
- * can also identify targets in the text and assessments about it through
2016
- * opinion mining. For a list of languages supported by this operation, @see
2017
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
2018
- * @param documents - The input documents to analyze.
2019
- * @param options - Optional parameters that includes enabling opinion mining.
2020
- */
2021
- analyzeSentiment(documents: TextDocumentInput[], options?: AnalyzeSentimentOptions): Promise<AnalyzeSentimentResultArray>;
2022
- /**
2023
- * Runs a model to identify a collection of significant phrases
2024
- * found in the passed-in input strings.
2025
- * For a list of languages supported by this operation, @see
2026
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
2027
- * @param documents - The input strings to analyze.
2028
- * @param language - The language that all the input strings are
2029
- written in. If unspecified, this value will be set to the default
2030
- language in `TextAnalyticsClientOptions`.
2031
- If set to an empty string, the service will apply a model
2032
- where the language is explicitly set to "None".
2033
- * @param options - Options for the operation.
2034
- */
2035
- extractKeyPhrases(documents: string[], language?: string, options?: ExtractKeyPhrasesOptions): Promise<ExtractKeyPhrasesResultArray>;
2036
- /**
2037
- * Runs a model to identify a collection of significant phrases
2038
- * found in the passed-in input documents.
2039
- * For a list of languages supported by this operation, @see
2040
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
2041
- * @param documents - The input documents to analyze.
2042
- * @param options - Options for the operation.
2043
- */
2044
- extractKeyPhrases(documents: TextDocumentInput[], options?: ExtractKeyPhrasesOptions): Promise<ExtractKeyPhrasesResultArray>;
2045
- /**
2046
- * Runs a predictive model to identify a collection of entities containing
2047
- * personally identifiable information found in the passed-in input strings,
2048
- * and categorize those entities into types such as US social security
2049
- * number, drivers license number, or credit card number.
2050
- * For a list of languages supported by this operation, @see
2051
- * {@link https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support}.
2052
- * @param inputs - The input strings to analyze.
2053
- * @param language - The language that all the input strings are
2054
- written in. If unspecified, this value will be set to the default
2055
- language in `TextAnalyticsClientOptions`.
2056
- If set to an empty string, the service will apply a model
2057
- where the language is explicitly set to "None".
2058
- * @param options - Options for the operation.
2059
- */
2060
- recognizePiiEntities(inputs: string[], language?: string, options?: RecognizePiiEntitiesOptions): Promise<RecognizePiiEntitiesResultArray>;
2061
- /**
2062
- * Runs a predictive model to identify a collection of entities containing
2063
- * personally identifiable information found in the passed-in input documents,
2064
- * and categorize those entities into types such as US social security
2065
- * number, drivers license number, or credit card number.
2066
- * For a list of languages supported by this operation, @see
2067
- * {@link https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support}.
2068
- * @param inputs - The input documents to analyze.
2069
- * @param options - Optional parameters for the operation.
2070
- */
2071
- recognizePiiEntities(inputs: TextDocumentInput[], options?: RecognizePiiEntitiesOptions): Promise<RecognizePiiEntitiesResultArray>;
2072
- /**
2073
- * Runs a predictive model to identify a collection of entities
2074
- * found in the passed-in input strings, and include information linking the
2075
- * entities to their corresponding entries in a well-known knowledge base.
2076
- * For a list of languages supported by this operation, @see
2077
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
2078
- * @param documents - The input strings to analyze.
2079
- * @param language - The language that all the input strings are
2080
- written in. If unspecified, this value will be set to the default
2081
- language in `TextAnalyticsClientOptions`.
2082
- If set to an empty string, the service will apply a model
2083
- where the language is explicitly set to "None".
2084
- * @param options - Options for the operation.
2085
- */
2086
- recognizeLinkedEntities(documents: string[], language?: string, options?: RecognizeLinkedEntitiesOptions): Promise<RecognizeLinkedEntitiesResultArray>;
2087
- /**
2088
- * Runs a predictive model to identify a collection of entities
2089
- * found in the passed-in input documents, and include information linking the
2090
- * entities to their corresponding entries in a well-known knowledge base.
2091
- * For a list of languages supported by this operation, @see
2092
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
2093
- * @param documents - The input documents to analyze.
2094
- * @param options - Options for the operation.
2095
- */
2096
- recognizeLinkedEntities(documents: TextDocumentInput[], options?: RecognizeLinkedEntitiesOptions): Promise<RecognizeLinkedEntitiesResultArray>;
2097
- /**
2098
- * Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions,
2099
- * symptoms, etc) and their relations.
2100
- * @param documents - Collection of documents to analyze.
2101
- * @param language - The language that all the input strings are
2102
- written in. If unspecified, this value will be set to the default
2103
- language in `TextAnalyticsClientOptions`.
2104
- If set to an empty string, the service will apply a model
2105
- where the language is explicitly set to "None".
2106
- * @param options - Options for the operation.
2107
- */
2108
- beginAnalyzeHealthcareEntities(documents: string[], language?: string, options?: BeginAnalyzeHealthcareEntitiesOptions): Promise<AnalyzeHealthcareEntitiesPollerLike>;
2109
- /**
2110
- * Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions,
2111
- * symptoms, etc) and their relations.
2112
- * @param documents - Collection of documents to analyze.
2113
- * @param options - Options for the operation.
2114
- */
2115
- beginAnalyzeHealthcareEntities(documents: TextDocumentInput[], options?: BeginAnalyzeHealthcareEntitiesOptions): Promise<AnalyzeHealthcareEntitiesPollerLike>;
2116
- /**
2117
- * Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.
2118
- * @param documents - Collection of documents to analyze
2119
- * @param actions - TextAnalyticsActions to execute.
2120
- * @param language - The language that all the input strings are
2121
- written in. If unspecified, this value will be set to the default
2122
- language in `TextAnalyticsClientOptions`.
2123
- If set to an empty string, the service will apply a model
2124
- where the language is explicitly set to "None".
2125
- * @param options - Options for the operation.
2126
- */
2127
- beginAnalyzeActions(documents: string[], actions: TextAnalyticsActions, language?: string, options?: BeginAnalyzeActionsOptions): Promise<AnalyzeActionsPollerLike>;
2128
- /**
2129
- * Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.
2130
- * @param documents - Collection of documents to analyze
2131
- * @param actions - TextAnalyticsActions to execute.
2132
- * @param options - Options for the operation.
2133
- */
2134
- beginAnalyzeActions(documents: TextDocumentInput[], actions: TextAnalyticsActions, options?: BeginAnalyzeActionsOptions): Promise<AnalyzeActionsPollerLike>;
2135
- }
2136
-
2137
- /**
2138
- * Client options used to configure TextAnalytics API requests.
2139
- */
2140
- export declare interface TextAnalyticsClientOptions extends CommonClientOptions {
2135
+ restoreAnalyzeBatchPoller(serializedState: string, options?: RestoreAnalyzeBatchPollerOptions): Promise<AnalyzeBatchPoller>;
2136
+ }
2137
+
2138
+ /**
2139
+ * Configuration options for {@link TextAnalysisClient}.
2140
+ */
2141
+ export declare interface TextAnalysisClientOptions extends CommonClientOptions {
2141
2142
  /**
2142
2143
  * The default country hint to use. Defaults to "us".
2143
2144
  */
@@ -2146,16 +2147,20 @@ export declare interface TextAnalyticsClientOptions extends CommonClientOptions
2146
2147
  * The default language to use. Defaults to "en".
2147
2148
  */
2148
2149
  defaultLanguage?: string;
2150
+ /**
2151
+ * The version of the Cognitive Language Service API to use.
2152
+ */
2153
+ apiVersion?: string;
2149
2154
  }
2150
2155
 
2151
2156
  /**
2152
- * Type describing an error from the Text Analytics service.
2157
+ * Type describing an API error.
2153
2158
  */
2154
- export declare interface TextAnalyticsError {
2159
+ export declare interface TextAnalysisError {
2155
2160
  /**
2156
- * A code describing the kind of error produced
2161
+ * A code describing the kind of error produced. See {@link KnownTextAnalysisErrorCode}.
2157
2162
  */
2158
- readonly code: ErrorCode;
2163
+ readonly code: string;
2159
2164
  /**
2160
2165
  * A message from the service explaining the error
2161
2166
  */
@@ -2167,10 +2172,9 @@ export declare interface TextAnalyticsError {
2167
2172
  }
2168
2173
 
2169
2174
  /**
2170
- * Base type for error results of text analytics operations corresponding to a
2171
- * single document.
2175
+ * Base type for error results of an action corresponding to a single document.
2172
2176
  */
2173
- export declare interface TextAnalyticsErrorResult {
2177
+ export declare interface TextAnalysisErrorResult {
2174
2178
  /**
2175
2179
  * Unique, non-empty document identifier.
2176
2180
  */
@@ -2178,50 +2182,35 @@ export declare interface TextAnalyticsErrorResult {
2178
2182
  /**
2179
2183
  * The Error for this document result.
2180
2184
  */
2181
- readonly error: TextAnalyticsError;
2185
+ readonly error: TextAnalysisError;
2182
2186
  }
2183
2187
 
2184
2188
  /**
2185
- * Options common to all text analytics operations.
2189
+ * Options common to all operations.
2186
2190
  */
2187
- export declare interface TextAnalyticsOperationOptions extends OperationOptions {
2188
- /**
2189
- * This value indicates which model will be used for scoring. If a model-version is
2190
- * not specified, the API should default to the latest, non-preview version.
2191
- * For supported model versions, see operation-specific documentation, for example:
2192
- * https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis#model-versioning
2193
- */
2194
- modelVersion?: string;
2191
+ export declare interface TextAnalysisOperationOptions extends OperationOptions {
2195
2192
  /**
2196
2193
  * If set to true, response will contain input and document level statistics.
2197
2194
  */
2198
2195
  includeStatistics?: boolean;
2199
2196
  /**
2200
- * If set to true (the default for `beginAnalyzeHealthcareEntities` and `recognizePiiEntities`),
2201
- * you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
2202
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this
2203
- * parameter to true, disables input logging and may limit our ability to remediate issues that
2204
- * occur.
2197
+ * The version of the Cognitive Language Service API to use.
2205
2198
  */
2206
- disableServiceLogs?: boolean;
2199
+ apiVersion?: string;
2207
2200
  }
2208
2201
 
2209
- /** Defines values for State. */
2210
- export declare type TextAnalyticsOperationStatus = "notStarted" | "running" | "succeeded" | "failed" | "rejected" | "cancelled" | "cancelling";
2211
-
2212
2202
  /**
2213
- * Base type for results of text analytics operations corresponding to a single
2214
- * input document.
2203
+ * Base type for results of an action corresponding to a single input document.
2215
2204
  */
2216
- export declare interface TextAnalyticsSuccessResult {
2205
+ export declare interface TextAnalysisSuccessResult {
2217
2206
  /**
2218
2207
  * Unique, non-empty document identifier.
2219
2208
  */
2220
2209
  readonly id: string;
2221
2210
  /**
2222
- * Statistics about the input document and how it was processed
2223
- * by the service. This property will have a value when includeStatistics is set to true
2224
- * in the client call.
2211
+ * Statistics about the input document and how it was processed by the service.
2212
+ * This property will have a value when includeStatistics is set to true in
2213
+ * the client call.
2225
2214
  */
2226
2215
  readonly statistics?: TextDocumentStatistics;
2227
2216
  /**
@@ -2229,21 +2218,13 @@ export declare interface TextAnalyticsSuccessResult {
2229
2218
  *
2230
2219
  * If no warnings were returned, this array will be empty.
2231
2220
  */
2232
- readonly warnings: TextAnalyticsWarning[];
2221
+ readonly warnings: DocumentWarning[];
2233
2222
  /**
2234
- * Discriminant to determine if that this is an error result.
2223
+ * Discriminant to determine if this is an error result.
2235
2224
  */
2236
2225
  readonly error?: undefined;
2237
2226
  }
2238
2227
 
2239
- /** Represents a warning encountered while processing a document. */
2240
- export declare interface TextAnalyticsWarning {
2241
- /** Error code. */
2242
- code: WarningCode;
2243
- /** Warning message. */
2244
- message: string;
2245
- }
2246
-
2247
2228
  /** if includeStatistics=true was specified in the request this field will contain information about the request payload. */
2248
2229
  export declare interface TextDocumentBatchStatistics {
2249
2230
  /** Number of documents submitted in the request. */
@@ -2256,7 +2237,7 @@ export declare interface TextDocumentBatchStatistics {
2256
2237
  transactionCount: number;
2257
2238
  }
2258
2239
 
2259
- /** An object representing an individual text document to be analyzed by the Text Analytics service. The document contains a unique document ID, the full text of the document, and the language of the document's text. */
2240
+ /** An object representing an individual text document to be analyzed by the Language service. The document contains a unique document ID, the full text of the document, and the language of the document's text. */
2260
2241
  export declare interface TextDocumentInput {
2261
2242
  /** A unique, non-empty document identifier. */
2262
2243
  id: string;
@@ -2274,8 +2255,8 @@ export declare interface TextDocumentStatistics {
2274
2255
  transactionCount: number;
2275
2256
  }
2276
2257
 
2277
- /** Defines values for TokenSentimentValue. */
2278
- export declare type TokenSentimentValue = "positive" | "mixed" | "negative";
2258
+ /** Defines values for TokenSentimentLabel. */
2259
+ export declare type TokenSentimentLabel = "positive" | "mixed" | "negative";
2279
2260
 
2280
2261
  /**
2281
2262
  * Defines values for WarningCode. \