@azure/ai-text-analytics 5.2.0-beta.1 → 6.0.0-alpha.20220517.2

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 (97) hide show
  1. package/README.md +376 -132
  2. package/dist/index.js +2803 -3497
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/src/azureKeyCredentialPolicy.js +2 -2
  5. package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
  6. package/dist-esm/src/constants.js +16 -0
  7. package/dist-esm/src/constants.js.map +1 -0
  8. package/dist-esm/src/generated/generatedClient.js +80 -334
  9. package/dist-esm/src/generated/generatedClient.js.map +1 -1
  10. package/dist-esm/src/generated/index.js +1 -1
  11. package/dist-esm/src/generated/index.js.map +1 -1
  12. package/dist-esm/src/generated/models/index.js +106 -35
  13. package/dist-esm/src/generated/models/index.js.map +1 -1
  14. package/dist-esm/src/generated/models/mappers.js +1607 -1464
  15. package/dist-esm/src/generated/models/mappers.js.map +1 -1
  16. package/dist-esm/src/generated/models/parameters.js +18 -104
  17. package/dist-esm/src/generated/models/parameters.js.map +1 -1
  18. package/dist-esm/src/generated/operations/analyzeText.js +105 -0
  19. package/dist-esm/src/generated/operations/analyzeText.js.map +1 -0
  20. package/dist-esm/src/generated/operations/index.js +9 -0
  21. package/dist-esm/src/generated/operations/index.js.map +1 -0
  22. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js +9 -0
  23. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js.map +1 -0
  24. package/dist-esm/src/generated/operationsInterfaces/index.js +9 -0
  25. package/dist-esm/src/generated/operationsInterfaces/index.js.map +1 -0
  26. package/dist-esm/src/index.js +14 -5
  27. package/dist-esm/src/index.js.map +1 -1
  28. package/dist-esm/src/lro.js +195 -0
  29. package/dist-esm/src/lro.js.map +1 -0
  30. package/dist-esm/src/models.js +42 -0
  31. package/dist-esm/src/models.js.map +1 -0
  32. package/dist-esm/src/textAnalysisClient.js +197 -0
  33. package/dist-esm/src/textAnalysisClient.js.map +1 -0
  34. package/dist-esm/src/transforms.js +279 -0
  35. package/dist-esm/src/transforms.js.map +1 -0
  36. package/dist-esm/src/util.js +36 -158
  37. package/dist-esm/src/util.js.map +1 -1
  38. package/package.json +28 -38
  39. package/types/ai-text-analytics.d.ts +1432 -1143
  40. package/CHANGELOG.md +0 -143
  41. package/LICENSE +0 -21
  42. package/dist-esm/src/analyzeActionsResult.js +0 -167
  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 -130
  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 -131
  67. package/dist-esm/src/healthLro.js.map +0 -1
  68. package/dist-esm/src/paging.js +0 -83
  69. package/dist-esm/src/paging.js.map +0 -1
  70. package/dist-esm/src/pollerModels.js +0 -4
  71. package/dist-esm/src/pollerModels.js.map +0 -1
  72. package/dist-esm/src/recognizeCategorizedEntitiesResult.js +0 -17
  73. package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +0 -1
  74. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +0 -11
  75. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +0 -1
  76. package/dist-esm/src/recognizeLinkedEntitiesResult.js +0 -17
  77. package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +0 -1
  78. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +0 -11
  79. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +0 -1
  80. package/dist-esm/src/recognizePiiEntitiesResult.js +0 -18
  81. package/dist-esm/src/recognizePiiEntitiesResult.js.map +0 -1
  82. package/dist-esm/src/recognizePiiEntitiesResultArray.js +0 -11
  83. package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +0 -1
  84. package/dist-esm/src/textAnalyticsAction.js +0 -4
  85. package/dist-esm/src/textAnalyticsAction.js.map +0 -1
  86. package/dist-esm/src/textAnalyticsClient.js +0 -523
  87. package/dist-esm/src/textAnalyticsClient.js.map +0 -1
  88. package/dist-esm/src/textAnalyticsOperationOptions.js +0 -4
  89. package/dist-esm/src/textAnalyticsOperationOptions.js.map +0 -1
  90. package/dist-esm/src/textAnalyticsResult.js +0 -78
  91. package/dist-esm/src/textAnalyticsResult.js.map +0 -1
  92. package/dist-esm/src/tracing.js +0 -12
  93. package/dist-esm/src/tracing.js.map +0 -1
  94. package/dist-esm/src/utils/url.browser.js +0 -6
  95. package/dist-esm/src/utils/url.browser.js.map +0 -1
  96. package/dist-esm/src/utils/url.js +0 -4
  97. package/dist-esm/src/utils/url.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,355 +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;
24
- /**
25
- * Number of failed actions.
26
- */
27
- actionsFailedCount: number;
28
- /**
29
- * Number of actions still in progress.
30
- */
31
- actionsInProgressCount: number;
39
+ export declare interface ActionMetadata {
32
40
  /**
33
- * The operation's display name.
41
+ * The model version used to perform the action.
34
42
  */
35
- displayName?: string;
43
+ readonly modelVersion: string;
36
44
  }
37
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
+
38
52
  /**
39
- * The state of the begin analyze polling operation.
53
+ * Type of actions supported by the {@link TextAnalysisClient.analyze} method.
40
54
  */
41
- export declare interface AnalyzeActionsOperationState extends AnalysisPollOperationState<PagedAnalyzeActionsResult>, AnalyzeActionsOperationMetadata {
42
- }
55
+ export declare type AnalyzeActionName = keyof typeof AnalyzeActionNames;
43
56
 
44
57
  /**
45
- * Result type of the Begin Analyze Actions Long-Running-Operation (LRO).
58
+ * Type of actions supported by the {@link TextAnalysisClient.analyze} method.
46
59
  */
47
- export declare type AnalyzeActionsPollerLike = PollerLike<AnalyzeActionsOperationState, PagedAnalyzeActionsResult>;
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
+ };
48
68
 
49
69
  /**
50
- * The results of an analyze Actions operation.
70
+ * The type of parameters for every action in ${@link AnalyzeActionNames}.
51
71
  */
52
- export declare interface AnalyzeActionsResult {
53
- /**
54
- * Array of the results for each categorized entities recognition action.
55
- */
56
- recognizeEntitiesResults: RecognizeCategorizedEntitiesActionResult[];
57
- /**
58
- * Array of the results for each Pii entities recognition action.
59
- */
60
- recognizePiiEntitiesResults: RecognizePiiEntitiesActionResult[];
61
- /**
62
- * Array of the results for each key phrases extraction action.
63
- */
64
- extractKeyPhrasesResults: ExtractKeyPhrasesActionResult[];
65
- /**
66
- * Array of the results for each linked entities recognition action.
67
- */
68
- recognizeLinkedEntitiesResults: RecognizeLinkedEntitiesActionResult[];
69
- /**
70
- * Array of the results for each analyze sentiment action.
71
- */
72
- analyzeSentimentResults: AnalyzeSentimentActionResult[];
73
- /**
74
- * Array of the results for each extract summary action.
75
- */
76
- extractSummaryResults: ExtractSummaryActionResult[];
77
- }
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];
78
80
 
79
81
  /**
80
- * An error result from the healthcare operation on a single document.
82
+ * Batch of actions.
81
83
  */
82
- export declare type AnalyzeHealthcareEntitiesErrorResult = TextAnalyticsErrorResult;
84
+ export declare type AnalyzeBatchAction = EntityLinkingBatchAction | EntityRecognitionBatchAction | KeyPhraseExtractionBatchAction | PiiEntityRecognitionBatchAction | HealthcareBatchAction | ExtractiveSummarizationBatchAction | SentimentAnalysisBatchAction | CustomEntityRecognitionBatchAction | CustomSingleLabelClassificationBatchAction | CustomMultiLabelClassificationBatchAction;
83
85
 
84
86
  /**
85
- * Result type of the Health Long-Running-Operation (LRO)
87
+ * Options common to all batch actions.
86
88
  */
87
- export declare type AnalyzeHealthcareEntitiesPollerLike = PollerLike<AnalyzeHealthcareOperationState, PagedAnalyzeHealthcareEntitiesResult>;
89
+ export declare interface AnalyzeBatchActionCommon {
90
+ /**
91
+ * The name of the action.
92
+ */
93
+ actionName?: string;
94
+ }
88
95
 
89
96
  /**
90
- * The result of the healthcare operation on a single document.
97
+ * Type of actions supported by the {@link TextAnalysisClient.beginAnalyzeBatch} method.
91
98
  */
92
- export declare type AnalyzeHealthcareEntitiesResult = AnalyzeHealthcareEntitiesSuccessResult | AnalyzeHealthcareEntitiesErrorResult;
99
+ export declare type AnalyzeBatchActionName = keyof typeof AnalyzeBatchActionNames;
93
100
 
94
101
  /**
95
- * Array of {@link AnalyzeHealthcareEntitiesResult}
102
+ * Type of actions supported by the {@link TextAnalysisClient.beginAnalyzeBatch} method.
96
103
  */
97
- export declare interface AnalyzeHealthcareEntitiesResultArray extends Array<AnalyzeHealthcareEntitiesResult> {
98
- }
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
+ };
99
116
 
100
117
  /**
101
- * The results of a successful healthcare operation for a single document.
118
+ * The metadata for long-running operations started by {@link TextAnalysisClient.beginAnalyzeBatch}.
102
119
  */
103
- export declare interface AnalyzeHealthcareEntitiesSuccessResult extends TextAnalyticsSuccessResult {
120
+ export declare interface AnalyzeBatchOperationMetadata {
104
121
  /**
105
- * Healthcare entities.
122
+ * The date and time the operation was created.
106
123
  */
107
- entities: HealthcareEntity[];
124
+ readonly createdOn: Date;
108
125
  /**
109
- * Relations between healthcare entities.
126
+ * The date and time when the operation results will expire on the server.
110
127
  */
111
- entityRelations: HealthcareEntityRelation[];
112
- }
113
-
114
- /**
115
- * The state of the begin analyze healthcare polling operation.
116
- */
117
- export declare interface AnalyzeHealthcareOperationState extends AnalysisPollOperationState<PagedAnalyzeHealthcareEntitiesResult> {
118
- }
119
-
120
- /**
121
- * Options for an analyze sentiment action.
122
- */
123
- export declare interface AnalyzeSentimentAction extends TextAnalyticsAction {
128
+ readonly expiresOn?: Date;
124
129
  /**
125
- * Specifies the measurement unit used to calculate the offset and length properties.
126
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
127
- * The default is the JavaScript's default which is "Utf16CodeUnit".
130
+ * The operation id.
128
131
  */
129
- stringIndexType?: StringIndexType;
132
+ readonly operationId: string;
130
133
  /**
131
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
132
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
133
- * disables input logging and may limit our ability to remediate issues that occur.
134
+ * The time the operation status was last updated.
134
135
  */
135
- disableServiceLogs?: boolean;
136
+ readonly lastModifiedOn: Date;
136
137
  /**
137
- * Whether to mine the opinions of a sentence and conduct more granular
138
- * analysis around the aspects of a product or service (also known as
139
- * aspect-based sentiment analysis). If set to true, the returned
140
- * `SentenceSentiment` objects will have property `opinions` containing
141
- * the result of this analysis.
142
- * 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}
138
+ * The current status of the operation.
143
139
  */
144
- includeOpinionMining?: boolean;
140
+ readonly status: OperationStatus;
141
+ /**
142
+ * Number of successfully completed actions.
143
+ */
144
+ readonly actionSucceededCount: number;
145
+ /**
146
+ * Number of failed actions.
147
+ */
148
+ readonly actionFailedCount: number;
149
+ /**
150
+ * Number of actions still in progress.
151
+ */
152
+ readonly actionInProgressCount: number;
153
+ /**
154
+ * The operation's display name.
155
+ */
156
+ readonly displayName?: string;
145
157
  }
146
158
 
147
159
  /**
148
- * The error of an analyze sentiment action.
160
+ * The state of the begin analyze polling operation.
149
161
  */
150
- export declare type AnalyzeSentimentActionErrorResult = TextAnalyticsActionErrorResult;
162
+ export declare interface AnalyzeBatchOperationState extends PollOperationState<PagedAnalyzeBatchResult>, AnalyzeBatchOperationMetadata {
163
+ }
151
164
 
152
165
  /**
153
- * The result of an analyze sentiment action.
166
+ * A poller that polls long-running operations started by {@link TextAnalysisClient.beginAnalyzeBatch}.
154
167
  */
155
- export declare type AnalyzeSentimentActionResult = AnalyzeSentimentActionSuccessResult | AnalyzeSentimentActionErrorResult;
168
+ export declare type AnalyzeBatchPoller = PollerLike<AnalyzeBatchOperationState, PagedAnalyzeBatchResult>;
156
169
 
157
170
  /**
158
- * The results of a succeeded analyze sentiment action.
171
+ * Results of a batch of actions.
159
172
  */
160
- export declare interface AnalyzeSentimentActionSuccessResult extends TextAnalyticsActionSuccessState {
161
- /**
162
- * Array of the results for each analyze sentiment action.
163
- */
164
- results: AnalyzeSentimentResultArray;
165
- }
173
+ export declare type AnalyzeBatchResult = EntityLinkingBatchResult | EntityRecognitionBatchResult | KeyPhraseExtractionBatchResult | PiiEntityRecognitionBatchResult | SentimentAnalysisBatchResult | HealthcareBatchResult | ExtractiveSummarizationBatchResult | CustomEntityRecognitionBatchResult | CustomSingleLabelClassificationBatchResult | CustomMultiLabelClassificationBatchResult;
166
174
 
167
175
  /**
168
- * An error result from the analyze sentiment operation on a single document.
176
+ * The type of results of every action in ${@link AnalyzeActionNames}.
169
177
  */
170
- export declare type AnalyzeSentimentErrorResult = TextAnalyticsErrorResult;
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;
201
+ }
202
+
203
+ /** Defines values for Association. */
204
+ export declare type Association = "subject" | "other";
205
+
206
+ export { AzureKeyCredential }
171
207
 
172
208
  /**
173
- * Options for the analyze sentiment operation.
209
+ * The error of an analyze batch action.
174
210
  */
175
- export declare interface AnalyzeSentimentOptions extends TextAnalyticsOperationOptions {
211
+ export declare interface BatchActionErrorResult<Kind extends AnalyzeBatchActionName> extends BatchActionState<Kind> {
176
212
  /**
177
- * Whether to mine the opinions of a sentence and conduct more granular
178
- * analysis around the aspects of a product or service (also known as
179
- * aspect-based sentiment analysis). If set to true, the returned
180
- * `SentenceSentiment` objects will have property `opinions` containing
181
- * the result of this analysis.
182
- * 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}
213
+ * When this action was completed by the service.
183
214
  */
184
- includeOpinionMining?: boolean;
215
+ readonly failedOn: Date;
185
216
  /**
186
- * Specifies the measurement unit used to calculate the offset and length properties.
187
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
188
- * The default is the JavaScript's default which is "Utf16CodeUnit".
217
+ * The Error for this action result.
189
218
  */
190
- stringIndexType?: StringIndexType;
219
+ readonly error: TextAnalysisError;
191
220
  }
192
221
 
193
222
  /**
194
- * The result of the analyze sentiment operation on a single document.
223
+ * The result of a batched action.
195
224
  */
196
- export declare type AnalyzeSentimentResult = AnalyzeSentimentSuccessResult | AnalyzeSentimentErrorResult;
225
+ export declare type BatchActionResult<T, Kind extends AnalyzeBatchActionName> = BatchActionSuccessResult<T, Kind> | BatchActionErrorResult<Kind>;
197
226
 
198
- /**
199
- * Array of `AnalyzeSentimentResult` objects corresponding to a batch of input documents, and
200
- * annotated with information about the batch operation.
201
- */
202
- export declare interface AnalyzeSentimentResultArray extends Array<AnalyzeSentimentResult> {
227
+ /** The State of a batched action */
228
+ export declare interface BatchActionState<Kind extends AnalyzeBatchActionName> {
203
229
  /**
204
- * Statistics about the input document batch and how it was processed
205
- * by the service. This property will have a value when includeStatistics is set to true
206
- * in the client call.
230
+ * The kind of the action results.
207
231
  */
208
- statistics?: TextDocumentBatchStatistics;
232
+ readonly kind: Kind;
209
233
  /**
210
- * The version of the text analytics model used by this operation on this
211
- * batch of input documents.
234
+ * The name of the action.
212
235
  */
213
- modelVersion: string;
236
+ readonly actionName?: string;
237
+ /**
238
+ * Action statistics.
239
+ */
240
+ readonly statistics?: TextDocumentBatchStatistics;
214
241
  }
215
242
 
216
243
  /**
217
- * The result of the analyze sentiment operation on a single document,
218
- * containing the predicted sentiment for each sentence as well as for the full document.
244
+ * The state of a succeeded batched action.
219
245
  */
220
- export declare interface AnalyzeSentimentSuccessResult extends TextAnalyticsSuccessResult {
246
+ export declare interface BatchActionSuccessResult<T, Kind extends AnalyzeBatchActionName> extends BatchActionState<Kind> {
221
247
  /**
222
- * Predicted sentiment for document. Possible values
223
- * include: 'positive', 'neutral', 'negative', 'mixed'
248
+ * The list of document results.
224
249
  */
225
- sentiment: DocumentSentimentLabel;
250
+ readonly results: T[];
226
251
  /**
227
- * Document level sentiment confidence scores between 0 and 1 for each sentiment class.
252
+ * When this action was completed by the service.
228
253
  */
229
- confidenceScores: SentimentConfidenceScores;
254
+ readonly completedOn: Date;
230
255
  /**
231
- * The predicted sentiment for each sentence in the corresponding document.
256
+ * Discriminant to determine if that this is an error result.
232
257
  */
233
- sentences: SentenceSentiment[];
234
- }
235
-
236
- /**
237
- * AssessmentSentiment contains the predicted sentiment, confidence scores and
238
- * other information about an assessment of a target. For example, in the sentence
239
- * "The food is good", the assessment of the target 'food' is 'good'.
240
- */
241
- export declare interface AssessmentSentiment extends SentenceAssessment {
258
+ readonly error?: undefined;
242
259
  }
243
- export { AzureKeyCredential }
244
260
 
245
261
  /**
246
262
  * Options for the begin analyze actions operation.
247
263
  */
248
- export declare interface BeginAnalyzeActionsOptions extends OperationOptions {
264
+ export declare interface BeginAnalyzeBatchOptions extends TextAnalysisOperationOptions {
249
265
  /**
250
- * Delay to wait until next poll, in milliseconds.
266
+ * Time delay between poll requests, in milliseconds.
251
267
  */
252
268
  updateIntervalInMs?: number;
253
- /**
254
- * A serialized poller which can be used to resume an existing paused Long-Running-Operation.
255
- */
256
- resumeFrom?: string;
257
- /**
258
- * If set to true, response will contain input and document level statistics.
259
- */
260
- includeStatistics?: boolean;
261
269
  /**
262
270
  * The operation's display name.
263
271
  */
264
272
  displayName?: string;
265
273
  }
266
274
 
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";
288
+
267
289
  /**
268
- * Options for the begin analyze healthcare entities operation.
290
+ * Custom action metadata.
269
291
  */
270
- export declare interface BeginAnalyzeHealthcareEntitiesOptions extends TextAnalyticsOperationOptions {
292
+ export declare interface CustomActionMetadata {
271
293
  /**
272
- * Delay to wait until next poll, in milliseconds.
294
+ * The name of the project used to perform the action.
273
295
  */
274
- stringIndexType?: StringIndexType;
296
+ readonly projectName: string;
275
297
  /**
276
- * Delay to wait until next poll, in milliseconds.
298
+ * The name of the deployment used to perform the action.
277
299
  */
278
- updateIntervalInMs?: number;
300
+ readonly deploymentName: string;
301
+ }
302
+
303
+ /** Supported parameters for a Custom Entities task. */
304
+ export declare type CustomEntityRecognitionAction = ActionCustom & {
305
+ /**
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".
309
+ */
310
+ stringIndexType?: StringIndexType;
311
+ };
312
+
313
+ /** Options for a custom entity recognition batch action. */
314
+ export declare interface CustomEntityRecognitionBatchAction extends AnalyzeBatchActionCommon, CustomEntityRecognitionAction {
279
315
  /**
280
- * A serialized poller which can be used to resume an existing paused Long-Running-Operation.
316
+ * The kind of the action.
281
317
  */
282
- resumeFrom?: string;
318
+ kind: "CustomEntityRecognition";
283
319
  }
284
320
 
285
321
  /**
286
- * An entity from text analysis with information about its categorical
287
- * classification.
322
+ * The result of a custom entity recognition batch action.
288
323
  */
289
- export declare interface CategorizedEntity extends Entity {
290
- }
324
+ export declare type CustomEntityRecognitionBatchResult = CustomActionMetadata & BatchActionResult<CustomEntityRecognitionResult, "CustomEntityRecognition">;
291
325
 
292
- /** Information about the language of a document as identified by the Text Analytics service. */
293
- export declare interface DetectedLanguage {
294
- /** Long name of a detected language (e.g. English, French). */
295
- name: string;
296
- /** A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr). */
297
- iso6391Name: string;
298
- /** A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. */
299
- confidenceScore: number;
300
- }
326
+ /**
327
+ * An error result from the recognize custom entities operation on a single document.
328
+ */
329
+ export declare type CustomEntityRecognitionErrorResult = TextAnalysisErrorResult;
301
330
 
302
331
  /**
303
- * An error result from the detect languge operation on a single document.
332
+ * The result of the custom recognize entities operation on a single document.
304
333
  */
305
- export declare type DetectLanguageErrorResult = TextAnalyticsErrorResult;
334
+ export declare type CustomEntityRecognitionResult = CustomEntityRecognitionSuccessResult | CustomEntityRecognitionErrorResult;
306
335
 
307
- /** 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. */
308
- export declare interface DetectLanguageInput {
309
- /** Unique, non-empty document identifier. */
310
- id: string;
311
- text: string;
312
- countryHint?: string;
336
+ /**
337
+ * The result of the recognize custom entities operation on a single document,
338
+ * containing a collection of the entities identified in that document.
339
+ */
340
+ export declare interface CustomEntityRecognitionSuccessResult extends TextAnalysisSuccessResult {
341
+ /**
342
+ * The collection of entities identified in the input document.
343
+ */
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 {
352
+ /**
353
+ * The kind of the action.
354
+ */
355
+ kind: "CustomMultiLabelClassification";
313
356
  }
314
357
 
315
358
  /**
316
- * Options for the detect languages operation.
359
+ * The result of a custom multi-label classification batch action.
317
360
  */
318
- export declare interface DetectLanguageOptions extends TextAnalyticsOperationOptions {
319
- }
361
+ export declare type CustomMultiLabelClassificationBatchResult = CustomActionMetadata & BatchActionResult<CustomMultiLabelClassificationResult, "CustomMultiLabelClassification">;
362
+
363
+ /**
364
+ * An error result from the custom classify document multi category operation on a multi document.
365
+ */
366
+ export declare type CustomMultiLabelClassificationErrorResult = TextAnalysisErrorResult;
320
367
 
321
368
  /**
322
- * The result of the detect language operation on a single document.
369
+ * The result of the custom classify document multi categories operation on a multi document.
323
370
  */
324
- export declare type DetectLanguageResult = DetectLanguageSuccessResult | DetectLanguageErrorResult;
371
+ export declare type CustomMultiLabelClassificationResult = CustomMultiLabelClassificationSuccessResult | CustomMultiLabelClassificationErrorResult;
325
372
 
326
373
  /**
327
- * Array of `DetectLanguageResult` objects corresponding to a batch of input documents, and
328
- * annotated with information about the batch operation.
374
+ * The result of the custom classify document multi categories operation on a multi document,
375
+ * containing the result of the classification.
329
376
  */
330
- export declare interface DetectLanguageResultArray extends Array<DetectLanguageResult> {
377
+ export declare interface CustomMultiLabelClassificationSuccessResult extends TextAnalysisSuccessResult {
331
378
  /**
332
- * Statistics about the input document batch and how it was processed
333
- * by the service. This property will have a value when includeStatistics is set to true
334
- * in the client call.
379
+ * The collection of classifications in the input document.
335
380
  */
336
- statistics?: TextDocumentBatchStatistics;
381
+ readonly classifications: ClassificationCategory[];
382
+ }
383
+
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 {
337
389
  /**
338
- * The version of the text analytics model used by this operation on this
339
- * batch of input documents.
390
+ * The kind of the action.
340
391
  */
341
- modelVersion: string;
392
+ kind: "CustomSingleLabelClassification";
342
393
  }
343
394
 
344
395
  /**
345
- * The result of the detect language operation on a single document,
346
- * containing a prediction of what language the document is written in.
396
+ * The result of a custom single-label classification batch action.
397
+ */
398
+ export declare type CustomSingleLabelClassificationBatchResult = CustomActionMetadata & BatchActionResult<CustomSingleLabelClassificationResult, "CustomSingleLabelClassification">;
399
+
400
+ /**
401
+ * An error result from the custom classify document single category operation on a single document.
402
+ */
403
+ export declare type CustomSingleLabelClassificationErrorResult = TextAnalysisErrorResult;
404
+
405
+ /**
406
+ * The result of the custom classify document single category operation on a single document.
407
+ */
408
+ export declare type CustomSingleLabelClassificationResult = CustomSingleLabelClassificationSuccessResult | CustomSingleLabelClassificationErrorResult;
409
+
410
+ /**
411
+ * The result of the custom classify document single category operation on a single document,
412
+ * containing the result of the classification.
347
413
  */
348
- export declare interface DetectLanguageSuccessResult extends TextAnalyticsSuccessResult {
414
+ export declare interface CustomSingleLabelClassificationSuccessResult extends TextAnalysisSuccessResult {
349
415
  /**
350
- * The top detected language by confidence score.
416
+ * The collection of classifications in the input document.
351
417
  */
352
- readonly primaryLanguage: DetectedLanguage;
418
+ readonly classifications: ClassificationCategory[];
419
+ }
420
+
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;
353
429
  }
354
430
 
355
431
  /** Defines values for DocumentSentimentLabel. */
356
432
  export declare type DocumentSentimentLabel = "positive" | "neutral" | "negative" | "mixed";
357
433
 
358
- /** 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 . */
359
443
  export declare interface Entity {
360
444
  /** Entity text as appears in the request. */
361
445
  text: string;
@@ -371,222 +455,181 @@ export declare interface Entity {
371
455
  confidenceScore: number;
372
456
  }
373
457
 
374
- export declare interface EntityAssertion {
375
- /** Describes any conditionality on the entity. */
376
- conditionality?: EntityConditionality;
377
- /** Describes the entities certainty and polarity. */
378
- certainty?: EntityCertainty;
379
- /** Describes if the entity is the subject of the text or if it describes someone else. */
380
- 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;
381
464
  }
382
465
 
383
- /** Defines values for Association. */
384
- export declare type EntityAssociation = "subject" | "other";
385
-
386
- /** Defines values for Certainty. */
387
- export declare type EntityCertainty = "positive" | "positivePossible" | "neutralPossible" | "negativePossible" | "negative";
388
-
389
- /** Defines values for Conditionality. */
390
- export declare type EntityConditionality = "hypothetical" | "conditional";
391
-
392
- /**
393
- * A type representing a reference for the healthcare entity into a specific
394
- * entity catalog.
395
- */
396
- export declare interface EntityDataSource {
466
+ /** Options for an entity linking action. */
467
+ export declare type EntityLinkingAction = ActionPrebuilt & {
397
468
  /**
398
- * 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".
399
472
  */
400
- name: string;
473
+ stringIndexType?: StringIndexType;
474
+ };
475
+
476
+ /** Options for an entity linking batch action. */
477
+ export declare interface EntityLinkingBatchAction extends AnalyzeBatchActionCommon, EntityLinkingAction {
401
478
  /**
402
- * Entity id in the given source catalog.
479
+ * The kind of the action.
403
480
  */
404
- entityId: string;
481
+ kind: "EntityLinking";
405
482
  }
406
483
 
407
484
  /**
408
- * An Error Code returned from the Text Analytics service. Possible
409
- * values include:
410
- *
411
- * For more information about the error, see the `message` property of the associated error.
485
+ * The result of an entity linking batch action.
412
486
  */
413
- export declare type ErrorCode = ErrorCodeValue | InnerErrorCodeValue;
487
+ export declare type EntityLinkingBatchResult = ActionMetadata & BatchActionResult<EntityLinkingResult, "EntityLinking">;
414
488
 
415
489
  /**
416
- * Defines values for ErrorCodeValue. \
417
- * {@link KnownErrorCodeValue} can be used interchangeably with ErrorCodeValue,
418
- * this enum contains the known values that the service supports.
419
- * ### Known values supported by the service
420
- * **InvalidRequest** \
421
- * **InvalidArgument** \
422
- * **InternalServerError** \
423
- * **ServiceUnavailable** \
424
- * **NotFound**
490
+ * An error result from an entity linking action on a single document.
425
491
  */
426
- export declare type ErrorCodeValue = string;
492
+ export declare type EntityLinkingErrorResult = TextAnalysisErrorResult;
427
493
 
428
494
  /**
429
- * Options for a key phrases recognition action.
495
+ * The result of an entity linking action on a single document.
430
496
  */
431
- export declare interface ExtractKeyPhrasesAction extends TextAnalyticsAction {
432
- /**
433
- * If set to false, you opt-in to have your text input logged for troubleshooting. By default, Text Analytics
434
- * will not log your input text for pii entities recognition. Setting this parameter to false,
435
- * enables input logging.
436
- */
437
- disableServiceLogs?: boolean;
438
- }
497
+ export declare type EntityLinkingResult = EntityLinkingSuccessResult | EntityLinkingErrorResult;
439
498
 
440
499
  /**
441
- * The error of a extract key phrases 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.
442
502
  */
443
- export declare type ExtractKeyPhrasesActionErrorResult = TextAnalyticsActionErrorResult;
503
+ export declare interface EntityLinkingSuccessResult extends TextAnalysisSuccessResult {
504
+ /**
505
+ * The collection of entities identified in the input document.
506
+ */
507
+ readonly entities: LinkedEntity[];
508
+ }
444
509
 
445
- /**
446
- * The result of a extract key phrases action.
447
- */
448
- 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
+ };
449
519
 
450
- /**
451
- * The results of a succeeded extract key phrases action.
452
- */
453
- export declare interface ExtractKeyPhrasesActionSuccessResult extends TextAnalyticsActionSuccessState {
520
+ /** Options for an entity recognition batch action. */
521
+ export declare interface EntityRecognitionBatchAction extends AnalyzeBatchActionCommon, EntityRecognitionAction {
454
522
  /**
455
- * Array of the results for each extract key phrases action.
523
+ * The kind of the action.
456
524
  */
457
- results: ExtractKeyPhrasesResultArray;
525
+ kind: "EntityRecognition";
458
526
  }
459
527
 
460
528
  /**
461
- * An error result from the extract key phrases operation on a single document.
529
+ * The result of an entity recognition batch action.
462
530
  */
463
- export declare type ExtractKeyPhrasesErrorResult = TextAnalyticsErrorResult;
531
+ export declare type EntityRecognitionBatchResult = ActionMetadata & BatchActionResult<EntityRecognitionResult, "EntityRecognition">;
464
532
 
465
533
  /**
466
- * Options for the extract key phrases operation.
534
+ * An error result from an entity recognition action on a single document.
467
535
  */
468
- export declare interface ExtractKeyPhrasesOptions extends TextAnalyticsOperationOptions {
469
- }
536
+ export declare type EntityRecognitionErrorResult = TextAnalysisErrorResult;
470
537
 
471
538
  /**
472
- * The result of the extract key phrases operation on a single document.
539
+ * The result of an entity recognition action on a single document.
473
540
  */
474
- export declare type ExtractKeyPhrasesResult = ExtractKeyPhrasesSuccessResult | ExtractKeyPhrasesErrorResult;
541
+ export declare type EntityRecognitionResult = EntityRecognitionSuccessResult | EntityRecognitionErrorResult;
475
542
 
476
543
  /**
477
- * Array of `ExtractKeyPhrasesResult` objects corresponding to a batch of input documents, and
478
- * annotated with information about the batch operation.
544
+ * The result of an entity recognition action on a single document, containing
545
+ * a collection of {@link Entity} objects identified in that document.
479
546
  */
480
- export declare interface ExtractKeyPhrasesResultArray extends Array<ExtractKeyPhrasesResult> {
481
- /**
482
- * Statistics about the input document batch and how it was processed
483
- * by the service. This property will have a value when includeStatistics is set to true
484
- * in the client call.
485
- */
486
- statistics?: TextDocumentBatchStatistics;
547
+ export declare interface EntityRecognitionSuccessResult extends TextAnalysisSuccessResult {
487
548
  /**
488
- * The version of the text analytics model used by this operation on this
489
- * batch of input documents.
549
+ * The collection of entities identified in the input document.
490
550
  */
491
- modelVersion: string;
551
+ readonly entities: Entity[];
492
552
  }
493
553
 
494
- /**
495
- * The result of the extract key phrases operation on a single document,
496
- * containing a collection of the key phrases identified in that document.
497
- */
498
- export declare interface ExtractKeyPhrasesSuccessResult extends TextAnalyticsSuccessResult {
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;
499
559
  /**
500
- * A list of representative words or phrases. The number of key phrases returned is proportional
501
- * to the number of words in the input document.
502
- */
503
- keyPhrases: string[];
504
- }
505
-
506
- /**
507
- * Options for an extract summary action.
508
- */
509
- export declare interface ExtractSummaryAction extends TextAnalyticsAction {
510
- /**
511
- * Specifies the measurement unit used to calculate the offset and length properties.
512
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
513
- * The default is the JavaScript's default which is "Utf16CodeUnit".
560
+ * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
561
+ *
562
+ * The default is the JavaScript's default which is "Utf16CodeUnit".
514
563
  */
515
564
  stringIndexType?: StringIndexType;
565
+ };
566
+
567
+ /** Options for an extractive summarization batch action. */
568
+ export declare interface ExtractiveSummarizationBatchAction extends AnalyzeBatchActionCommon, ExtractiveSummarizationAction {
516
569
  /**
517
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
518
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
519
- * disables input logging and may limit our ability to remediate issues that occur.
520
- */
521
- disableServiceLogs?: boolean;
522
- /**
523
- * Specifies the number of summary sentences to return. The default number of sentences is 3.
524
- */
525
- maxSentenceCount?: number;
526
- /**
527
- * Specifies how to sort the returned sentences. Please refer to {@link KnownSummarySentencesSortBy} for possible values.
570
+ * The kind of the action.
528
571
  */
529
- orderBy?: string;
572
+ kind: "ExtractiveSummarization";
530
573
  }
531
574
 
532
575
  /**
533
- * The error of an extract summary action.
576
+ * The result of an extractive summarization batch action.
534
577
  */
535
- export declare type ExtractSummaryActionErrorResult = TextAnalyticsActionErrorResult;
578
+ export declare type ExtractiveSummarizationBatchResult = ActionMetadata & BatchActionResult<SummarizationExtractionResult, "ExtractiveSummarization">;
536
579
 
537
580
  /**
538
- * 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.
539
587
  */
540
- export declare type ExtractSummaryActionResult = ExtractSummaryActionSuccessResult | ExtractSummaryActionErrorResult;
588
+ export declare type ExtractiveSummarizationOrderingCriteria = string;
541
589
 
542
590
  /**
543
- * 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**
544
596
  */
545
- 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;
546
603
  /**
547
- * 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".
548
607
  */
549
- results: ExtractSummaryResultArray;
550
- }
551
-
552
- /**
553
- * An error result from the extract summary operation on a single document.
554
- */
555
- export declare type ExtractSummaryErrorResult = TextAnalyticsErrorResult;
608
+ stringIndexType?: StringIndexType;
609
+ };
556
610
 
557
- /**
558
- * The result of the extract summary operation on a single document.
559
- */
560
- 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
+ }
561
620
 
562
- /**
563
- * Array of `ExtractSummaryResult` objects corresponding to a batch of input documents, and
564
- * annotated with information about the batch operation.
565
- */
566
- export declare interface ExtractSummaryResultArray extends Array<ExtractSummaryResult> {
621
+ /** Options for a healthcare batch action. */
622
+ export declare interface HealthcareBatchAction extends AnalyzeBatchActionCommon, HealthcareAction {
567
623
  /**
568
- * Statistics about the input document batch and how it was processed
569
- * by the service. This property will have a value when includeStatistics is set to true
570
- * in the client call.
624
+ * The kind of the action.
571
625
  */
572
- statistics?: TextDocumentBatchStatistics;
573
- /**
574
- * The version of the text analytics model used by this operation on this
575
- * batch of input documents.
576
- */
577
- modelVersion: string;
626
+ kind: "Healthcare";
578
627
  }
579
628
 
580
629
  /**
581
- * The result of the extract summary operation on a single document,
582
- * containing a collection of the summary identified in that document.
630
+ * The result of a healthcare batch action.
583
631
  */
584
- export declare interface ExtractSummarySuccessResult extends TextAnalyticsSuccessResult {
585
- /**
586
- * A list of sentences composing a summary of the input document.
587
- */
588
- sentences: SummarySentence[];
589
- }
632
+ export declare type HealthcareBatchResult = ActionMetadata & BatchActionResult<HealthcareResult, "Healthcare">;
590
633
 
591
634
  /**
592
635
  * A healthcare entity represented as a node in a directed graph where the edges are
@@ -596,15 +639,15 @@ export declare interface HealthcareEntity extends Entity {
596
639
  /**
597
640
  * Normalized name for the entity. For example, the normalized text for "histologically" is "histologic".
598
641
  */
599
- normalizedText?: string;
642
+ readonly normalizedText?: string;
600
643
  /**
601
644
  * Whether the entity is negated.
602
645
  */
603
- assertion?: EntityAssertion;
646
+ readonly assertion?: HealthcareAssertion;
604
647
  /**
605
648
  * Entity references in known data sources.
606
649
  */
607
- dataSources: EntityDataSource[];
650
+ readonly dataSources: EntityDataSource[];
608
651
  /**
609
652
  * Defines values for HealthcareEntityCategory.
610
653
  * {@link KnownHealthcareEntityCategory} can be used interchangeably with HealthcareEntityCategory,
@@ -637,7 +680,7 @@ export declare interface HealthcareEntity extends Entity {
637
680
  * **FAMILY_RELATION**
638
681
  * **TREATMENT_NAME**
639
682
  */
640
- category: HealthcareEntityCategory;
683
+ readonly category: HealthcareEntityCategory;
641
684
  }
642
685
 
643
686
  /**
@@ -681,11 +724,11 @@ export declare interface HealthcareEntityRelation {
681
724
  /**
682
725
  * The type of the healthcare relation.
683
726
  */
684
- relationType: HealthcareEntityRelationType;
727
+ readonly relationType: RelationType;
685
728
  /**
686
729
  * The list of healthcare entities and their roles in the healthcare relation.
687
730
  */
688
- roles: HealthcareEntityRelationRole[];
731
+ readonly roles: HealthcareEntityRelationRole[];
689
732
  }
690
733
 
691
734
  /**
@@ -695,11 +738,11 @@ export declare interface HealthcareEntityRelationRole {
695
738
  /**
696
739
  * A healthcare entity
697
740
  */
698
- entity: HealthcareEntity;
741
+ readonly entity: HealthcareEntity;
699
742
  /**
700
743
  * The role of the healthcare entity in a particular relation.
701
744
  */
702
- name: HealthcareEntityRelationRoleType;
745
+ readonly name: HealthcareEntityRelationRoleType;
703
746
  }
704
747
 
705
748
  /**
@@ -708,87 +751,117 @@ export declare interface HealthcareEntityRelationRole {
708
751
  export declare type HealthcareEntityRelationRoleType = string;
709
752
 
710
753
  /**
711
- * Defines values for RelationType. \
712
- * {@link KnownRelationType} can be used interchangeably with RelationType,
713
- * this enum contains the known values that the service supports.
714
- * ### Known values supported by the service
715
- * **Abbreviation** \
716
- * **DirectionOfBodyStructure** \
717
- * **DirectionOfCondition** \
718
- * **DirectionOfExamination** \
719
- * **DirectionOfTreatment** \
720
- * **DosageOfMedication** \
721
- * **FormOfMedication** \
722
- * **FrequencyOfMedication** \
723
- * **FrequencyOfTreatment** \
724
- * **QualifierOfCondition** \
725
- * **RelationOfExamination** \
726
- * **RouteOfMedication** \
727
- * **TimeOfCondition** \
728
- * **TimeOfEvent** \
729
- * **TimeOfExamination** \
730
- * **TimeOfMedication** \
731
- * **TimeOfTreatment** \
732
- * **UnitOfCondition** \
733
- * **UnitOfExamination** \
734
- * **ValueOfCondition** \
735
- * **ValueOfExamination**
754
+ * An error result from the healthcare operation on a single document.
736
755
  */
737
- export declare type HealthcareEntityRelationType = string;
756
+ export declare type HealthcareErrorResult = TextAnalysisErrorResult;
738
757
 
739
758
  /**
740
- * Defines values for InnerErrorCodeValue. \
741
- * {@link KnownInnerErrorCodeValue} can be used interchangeably with InnerErrorCodeValue,
742
- * this enum contains the known values that the service supports.
743
- * ### Known values supported by the service
744
- * **InvalidParameterValue** \
745
- * **InvalidRequestBodyFormat** \
746
- * **EmptyRequest** \
747
- * **MissingInputRecords** \
748
- * **InvalidDocument** \
749
- * **ModelVersionIncorrect** \
750
- * **InvalidDocumentBatch** \
751
- * **UnsupportedLanguageCode** \
752
- * **InvalidCountryHint**
753
- */
754
- export declare type InnerErrorCodeValue = string;
755
-
756
- /** Known values of {@link HealthcareEntityCategory} that the service accepts. */
757
- export declare enum KnownHealthcareEntityCategory {
758
- BodyStructure = "BODY_STRUCTURE",
759
- AGE = "AGE",
760
- Gender = "GENDER",
761
- ExaminationName = "EXAMINATION_NAME",
762
- Date = "DATE",
763
- Direction = "DIRECTION",
764
- Frequency = "FREQUENCY",
765
- MeasurementValue = "MEASUREMENT_VALUE",
766
- MeasurementUnit = "MEASUREMENT_UNIT",
767
- RelationalOperator = "RELATIONAL_OPERATOR",
768
- Time = "TIME",
769
- GeneORProtein = "GENE_OR_PROTEIN",
770
- Variant = "VARIANT",
771
- AdministrativeEvent = "ADMINISTRATIVE_EVENT",
772
- CareEnvironment = "CARE_ENVIRONMENT",
773
- HealthcareProfession = "HEALTHCARE_PROFESSION",
774
- Diagnosis = "DIAGNOSIS",
775
- SymptomORSign = "SYMPTOM_OR_SIGN",
776
- ConditionQualifier = "CONDITION_QUALIFIER",
777
- MedicationClass = "MEDICATION_CLASS",
778
- MedicationName = "MEDICATION_NAME",
779
- Dosage = "DOSAGE",
780
- MedicationForm = "MEDICATION_FORM",
781
- MedicationRoute = "MEDICATION_ROUTE",
782
- FamilyRelation = "FAMILY_RELATION",
783
- TreatmentName = "TREATMENT_NAME"
784
- }
785
-
786
- /** Known values of {@link InnerErrorCodeValue} that the service accepts. */
787
- 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",
788
857
  InvalidParameterValue = "InvalidParameterValue",
858
+ KnowledgeBaseNotFound = "KnowledgeBaseNotFound",
859
+ AzureCognitiveSearchNotFound = "AzureCognitiveSearchNotFound",
860
+ AzureCognitiveSearchThrottling = "AzureCognitiveSearchThrottling",
861
+ ExtractionFailure = "ExtractionFailure",
789
862
  InvalidRequestBodyFormat = "InvalidRequestBodyFormat",
790
863
  EmptyRequest = "EmptyRequest",
791
- MissingInputRecords = "MissingInputRecords",
864
+ MissingInputDocuments = "MissingInputDocuments",
792
865
  InvalidDocument = "InvalidDocument",
793
866
  ModelVersionIncorrect = "ModelVersionIncorrect",
794
867
  InvalidDocumentBatch = "InvalidDocumentBatch",
@@ -796,15 +869,264 @@ export declare enum KnownInnerErrorCodeValue {
796
869
  InvalidCountryHint = "InvalidCountryHint"
797
870
  }
798
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
+
799
1116
  /**
800
- * A type representing how to sort sentences for the summarization extraction action.
1117
+ * The result of a language detection action on a single document.
801
1118
  */
802
- export declare type KnownSummarySentencesSortBy = "Offset" | "Rank";
1119
+ export declare type LanguageDetectionResult = LanguageDetectionSuccessResult | LanguageDetectionErrorResult;
803
1120
 
804
- /** Known values of {@link WarningCode} that the service accepts. */
805
- export declare enum KnownWarningCode {
806
- LongWordsInDocument = "LongWordsInDocument",
807
- 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;
808
1130
  }
809
1131
 
810
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. */
@@ -825,7 +1147,7 @@ export declare interface LinkedEntity {
825
1147
  bingEntitySearchApiId?: string;
826
1148
  }
827
1149
 
828
- /** 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. */
829
1151
  export declare interface Match {
830
1152
  /** If a well known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned. */
831
1153
  confidenceScore: number;
@@ -837,31 +1159,8 @@ export declare interface Match {
837
1159
  length: number;
838
1160
  }
839
1161
 
840
- /**
841
- * Metadata information for an analysis poller operation.
842
- */
843
- export declare interface OperationMetadata {
844
- /**
845
- * The date and time the operation was created.
846
- */
847
- createdOn: Date;
848
- /**
849
- * The date and time when the operation results will expire on the server.
850
- */
851
- expiresOn?: Date;
852
- /**
853
- * The operation id.
854
- */
855
- operationId: string;
856
- /**
857
- * The time the operation status was last updated.
858
- */
859
- lastModifiedOn: Date;
860
- /**
861
- * The current status of the operation.
862
- */
863
- status: TextAnalyticsOperationStatus;
864
- }
1162
+ /** Defines values for OperationStatus. */
1163
+ export declare type OperationStatus = "notStarted" | "running" | "succeeded" | "partiallySucceeded" | "failed" | "cancelled" | "cancelling";
865
1164
 
866
1165
  /**
867
1166
  * A mined opinion object represents an opinion we've extracted from a sentence.
@@ -872,58 +1171,17 @@ export declare interface Opinion {
872
1171
  /**
873
1172
  * The target of a product/service that this assessment is about.
874
1173
  */
875
- target: TargetSentiment;
1174
+ readonly target: TargetSentiment;
876
1175
  /**
877
1176
  * The actual assessments of the target.
878
1177
  */
879
- assessments: AssessmentSentiment[];
880
- }
881
-
882
- /**
883
- * The results of an analyze actions operation represented as a paged iterator that
884
- * iterates over the results of the requested actions.
885
- */
886
- export declare interface PagedAnalyzeActionsResult extends PagedAsyncIterableAnalyzeActionsResult {
887
- }
888
-
889
- /**
890
- * The results of a healthcare operation represented as a paged iterator that can
891
- * either iterate over the results on a document-by-document basis or, by
892
- * byPage(), can iterate over pages of documents.
893
- */
894
- export declare interface PagedAnalyzeHealthcareEntitiesResult extends PagedAsyncIterableAnalyzeHealthcareEntitiesResult {
895
- /**
896
- * Statistics about the input document batch and how it was processed
897
- * by the service. This property will have a value when includeStatistics is set to true
898
- * in the client call.
899
- */
900
- statistics?: TextDocumentBatchStatistics;
901
- /**
902
- * The version of the text analytics model used by this operation on this
903
- * batch of input documents.
904
- */
905
- modelVersion: string;
1178
+ readonly assessments: AssessmentSentiment[];
906
1179
  }
907
1180
 
908
1181
  /**
909
- * The results of an analyze Actions operation represented as a paged iterator that
910
- * iterates over the results of the requested actions.
911
- */
912
- export declare type PagedAsyncIterableAnalyzeActionsResult = PagedAsyncIterableIterator<AnalyzeActionsResult, AnalyzeActionsResult>;
913
-
914
- /**
915
- * The results of a healthcare operation represented as a paged iterator that can
916
- * either iterate over the results on a document-by-document basis or, by
917
- * byPage(), can iterate over pages of documents.
918
- */
919
- export declare type PagedAsyncIterableAnalyzeHealthcareEntitiesResult = PagedAsyncIterableIterator<AnalyzeHealthcareEntitiesResult, AnalyzeHealthcareEntitiesResultArray>;
920
-
921
- /**
922
- * An entity from PII recognition with information about the kind of PII
923
- * encountered.
1182
+ * Paged results of the {@link TextAnalysisClient.beginAnalyzeBatch} operation.
924
1183
  */
925
- export declare interface PiiEntity extends Entity {
926
- }
1184
+ export declare type PagedAnalyzeBatchResult = PagedAsyncIterableIterator<AnalyzeBatchResult>;
927
1185
 
928
1186
  /**
929
1187
  * Defines values for PiiCategory. \
@@ -1104,395 +1362,271 @@ export declare interface PiiEntity extends Entity {
1104
1362
  * **All** \
1105
1363
  * **Default**
1106
1364
  */
1107
- export declare type PiiEntityCategory = string;
1365
+ export declare type PiiCategory = string;
1108
1366
 
1109
1367
  /**
1110
- * 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.
1111
1374
  */
1112
- 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 & {
1113
1379
  /**
1114
- * @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.
1115
1383
  */
1116
- PROTECTED_HEALTH_INFORMATION = "PHI"
1117
- }
1118
-
1119
- /**
1120
- * Options for an entities recognition action.
1121
- */
1122
- 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[];
1123
1387
  /**
1124
- * Specifies the measurement unit used to calculate the offset and length properties.
1125
- * 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
+ *
1126
1390
  * The default is the JavaScript's default which is "Utf16CodeUnit".
1127
1391
  */
1128
1392
  stringIndexType?: StringIndexType;
1393
+ };
1394
+
1395
+ /** Options for a pii entity recognition batch action. */
1396
+ export declare interface PiiEntityRecognitionBatchAction extends AnalyzeBatchActionCommon, PiiEntityRecognitionAction {
1129
1397
  /**
1130
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
1131
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
1132
- * disables input logging and may limit our ability to remediate issues that occur.
1398
+ * The kind of the action.
1133
1399
  */
1134
- disableServiceLogs?: boolean;
1400
+ kind: "PiiEntityRecognition";
1135
1401
  }
1136
1402
 
1137
1403
  /**
1138
- * The error of a recognize categorized entities action.
1404
+ * The result of a pii entity recognition batch action.
1405
+ */
1406
+ export declare type PiiEntityRecognitionBatchResult = ActionMetadata & BatchActionResult<PiiEntityRecognitionResult, "PiiEntityRecognition">;
1407
+
1408
+ /**
1409
+ * An error result from a pii entity recognition action on a single document.
1139
1410
  */
1140
- export declare type RecognizeCategorizedEntitiesActionErrorResult = TextAnalyticsActionErrorResult;
1411
+ export declare type PiiEntityRecognitionErrorResult = TextAnalysisErrorResult;
1141
1412
 
1142
1413
  /**
1143
- * The result of a recognize categorized entities action.
1414
+ * The result of an entity recognition action on a single document.
1144
1415
  */
1145
- export declare type RecognizeCategorizedEntitiesActionResult = RecognizeCategorizedEntitiesActionSuccessResult | RecognizeCategorizedEntitiesActionErrorResult;
1416
+ export declare type PiiEntityRecognitionResult = PiiEntityRecognitionSuccessResult | PiiEntityRecognitionErrorResult;
1146
1417
 
1147
1418
  /**
1148
- * The results of a succeeded recognize categorized entities action.
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.
1149
1422
  */
1150
- export declare interface RecognizeCategorizedEntitiesActionSuccessResult extends TextAnalyticsActionSuccessState {
1423
+ export declare interface PiiEntityRecognitionSuccessResult extends TextAnalysisSuccessResult {
1151
1424
  /**
1152
- * Array of the results for each categorized entities recognition action.
1425
+ * The collection of entities identified in the input document.
1426
+ */
1427
+ readonly entities: Entity[];
1428
+ /**
1429
+ * The text redacted.
1153
1430
  */
1154
- results: RecognizeCategorizedEntitiesResultArray;
1431
+ readonly redactedText: string;
1155
1432
  }
1156
1433
 
1157
1434
  /**
1158
- * An error result from the recognize 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**
1159
1460
  */
1160
- export declare type RecognizeCategorizedEntitiesErrorResult = TextAnalyticsErrorResult;
1461
+ export declare type RelationType = string;
1161
1462
 
1162
1463
  /**
1163
- * Options for the recognize entities operation.
1464
+ * Options for the begin analyze actions operation.
1164
1465
  */
1165
- export declare interface RecognizeCategorizedEntitiesOptions extends TextAnalyticsOperationOptions {
1466
+ export declare interface RestoreAnalyzeBatchPollerOptions extends TextAnalysisOperationOptions {
1166
1467
  /**
1167
- * Specifies the measurement unit used to calculate the offset and length properties.
1168
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1169
- * The default is the JavaScript's default which is "Utf16CodeUnit".
1468
+ * Time delay between poll requests, in milliseconds.
1170
1469
  */
1171
- stringIndexType?: StringIndexType;
1470
+ updateIntervalInMs?: number;
1172
1471
  }
1173
1472
 
1174
1473
  /**
1175
- * The result of the recognize entities operation on a single document.
1176
- */
1177
- export declare type RecognizeCategorizedEntitiesResult = RecognizeCategorizedEntitiesSuccessResult | RecognizeCategorizedEntitiesErrorResult;
1178
-
1179
- /**
1180
- * Array of `RecognizeCategorizedEntitiesResult` objects corresponding to a batch of input documents, and
1181
- * annotated with information about the batch operation.
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}.
1182
1476
  */
1183
- export declare interface RecognizeCategorizedEntitiesResultArray extends Array<RecognizeCategorizedEntitiesResult> {
1477
+ export declare interface SentenceSentiment {
1184
1478
  /**
1185
- * Statistics about the input document batch and how it was processed
1186
- * by the service. This property will have a value when includeStatistics is set to true
1187
- * in the client call.
1479
+ * The sentence text.
1188
1480
  */
1189
- statistics?: TextDocumentBatchStatistics;
1481
+ readonly text: string;
1190
1482
  /**
1191
- * The version of the text analytics model used by this operation on this
1192
- * batch of input documents.
1483
+ * The predicted Sentiment for the sentence. For a list of possible values,
1484
+ * see {@link SentenceSentimentLabel}
1193
1485
  */
1194
- modelVersion: string;
1195
- }
1196
-
1197
- /**
1198
- * The result of the recognize entities operation on a single document, containing the collection of
1199
- * `Entity` objects identified in that document.
1200
- */
1201
- export declare interface RecognizeCategorizedEntitiesSuccessResult extends TextAnalyticsSuccessResult {
1486
+ readonly sentiment: SentenceSentimentLabel;
1202
1487
  /**
1203
- * The collection of entities identified in the input document.
1488
+ * The sentiment confidence score between 0 and 1 for the sentence for all
1489
+ * classes.
1204
1490
  */
1205
- readonly entities: CategorizedEntity[];
1206
- }
1207
-
1208
- /**
1209
- * Options for an entities linking action.
1210
- */
1211
- export declare interface RecognizeLinkedEntitiesAction extends TextAnalyticsAction {
1491
+ readonly confidenceScores: SentimentConfidenceScores;
1212
1492
  /**
1213
- * Specifies the measurement unit used to calculate the offset and length properties.
1214
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1215
- * The default is the JavaScript's default which is "Utf16CodeUnit".
1493
+ * The sentence text offset from the start of the document.
1216
1494
  */
1217
- stringIndexType?: StringIndexType;
1495
+ readonly offset: number;
1218
1496
  /**
1219
- * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
1220
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,
1221
- * disables input logging and may limit our ability to remediate issues that occur.
1497
+ * The length of the sentence text.
1222
1498
  */
1223
- disableServiceLogs?: boolean;
1499
+ readonly length: number;
1500
+ /**
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`.
1507
+ */
1508
+ readonly opinions: Opinion[];
1224
1509
  }
1225
1510
 
1226
- /**
1227
- * The error of a recognize linked entities action.
1228
- */
1229
- export declare type RecognizeLinkedEntitiesActionErrorResult = TextAnalyticsActionErrorResult;
1511
+ /** Defines values for SentenceSentimentLabel. */
1512
+ export declare type SentenceSentimentLabel = "positive" | "neutral" | "negative";
1230
1513
 
1231
- /**
1232
- * The result of a recognize linked entities action.
1233
- */
1234
- export declare type RecognizeLinkedEntitiesActionResult = RecognizeLinkedEntitiesActionSuccessResult | RecognizeLinkedEntitiesActionErrorResult;
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;
1518
+ /**
1519
+ * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
1520
+ *
1521
+ * The default is the JavaScript's default which is "Utf16CodeUnit".
1522
+ */
1523
+ stringIndexType?: StringIndexType;
1524
+ };
1235
1525
 
1236
- /**
1237
- * The results of a succeeded recognize linked entities action.
1238
- */
1239
- export declare interface RecognizeLinkedEntitiesActionSuccessResult extends TextAnalyticsActionSuccessState {
1526
+ /** Options for a sentiment analysis batch action. */
1527
+ export declare interface SentimentAnalysisBatchAction extends AnalyzeBatchActionCommon, SentimentAnalysisAction {
1240
1528
  /**
1241
- * Array of the results for each linked entities recognition action.
1529
+ * The kind of the action.
1242
1530
  */
1243
- results: RecognizeLinkedEntitiesResultArray;
1531
+ kind: "SentimentAnalysis";
1244
1532
  }
1245
1533
 
1246
1534
  /**
1247
- * An error result from the recognize linked entities operation on a single document.
1535
+ * The result of a sentiment analysis batch action.
1248
1536
  */
1249
- export declare type RecognizeLinkedEntitiesErrorResult = TextAnalyticsErrorResult;
1537
+ export declare type SentimentAnalysisBatchResult = ActionMetadata & BatchActionResult<SentimentAnalysisResult, "SentimentAnalysis">;
1250
1538
 
1251
1539
  /**
1252
- * Options for the recognize linked entities operation.
1540
+ * An error result from a sentiment analysis action on a single document.
1253
1541
  */
1254
- export declare interface RecognizeLinkedEntitiesOptions extends TextAnalyticsOperationOptions {
1255
- /**
1256
- * Specifies the measurement unit used to calculate the offset and length properties.
1257
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1258
- * The default is the JavaScript's default which is "Utf16CodeUnit".
1259
- */
1260
- stringIndexType?: StringIndexType;
1261
- }
1542
+ export declare type SentimentAnalysisErrorResult = TextAnalysisErrorResult;
1262
1543
 
1263
1544
  /**
1264
- * The result of the recognize linked entities operation on a single document.
1545
+ * The result of a sentiment analysis action on a single document.
1265
1546
  */
1266
- export declare type RecognizeLinkedEntitiesResult = RecognizeLinkedEntitiesSuccessResult | RecognizeLinkedEntitiesErrorResult;
1547
+ export declare type SentimentAnalysisResult = SentimentAnalysisSuccessResult | SentimentAnalysisErrorResult;
1267
1548
 
1268
1549
  /**
1269
- * Array of `RecognizeLinkedEntitiesResult` objects corresponding to a batch of input documents, and
1270
- * annotated with information about the batch operation.
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.
1271
1553
  */
1272
- export declare interface RecognizeLinkedEntitiesResultArray extends Array<RecognizeLinkedEntitiesResult> {
1554
+ export declare interface SentimentAnalysisSuccessResult extends TextAnalysisSuccessResult {
1273
1555
  /**
1274
- * Statistics about the input document batch and how it was processed
1275
- * by the service. This property will have a value when includeStatistics is set to true
1276
- * in the client call.
1556
+ * Predicted sentiment for document. For a list of possible values, see {@link DocumentSentimentLabel}
1277
1557
  */
1278
- statistics?: TextDocumentBatchStatistics;
1558
+ readonly sentiment: DocumentSentimentLabel;
1279
1559
  /**
1280
- * The version of the text analytics model used by this operation on this
1281
- * batch of input documents.
1560
+ * Document level sentiment confidence scores between 0 and 1 for each
1561
+ * sentiment class.
1282
1562
  */
1283
- modelVersion: string;
1284
- }
1285
-
1286
- /**
1287
- * The result of the recognize linked entities operation on a single document,
1288
- * containing a collection of the `LinkedEntity` objects identified in that document.
1289
- */
1290
- export declare interface RecognizeLinkedEntitiesSuccessResult extends TextAnalyticsSuccessResult {
1291
- /**
1292
- * The collection of entities identified in the input document.
1293
- */
1294
- readonly entities: LinkedEntity[];
1295
- }
1296
-
1297
- /**
1298
- * Options for a Pii entities recognition action.
1299
- */
1300
- export declare interface RecognizePiiEntitiesAction extends TextAnalyticsAction {
1301
- /**
1302
- * Filters entities to ones only included in the specified domain (e.g., if
1303
- * set to 'PHI', entities in the Protected Healthcare Information domain will
1304
- * only be returned). @see {@link https://aka.ms/tanerpii} for more information.
1305
- */
1306
- domainFilter?: PiiEntityDomain;
1307
- /**
1308
- * Filters entities to ones only included in the specified array of categories
1309
- */
1310
- categoriesFilter?: PiiEntityCategory[];
1311
- /**
1312
- * Specifies the measurement unit used to calculate the offset and length properties.
1313
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1314
- * The default is the JavaScript's default which is "Utf16CodeUnit".
1315
- */
1316
- stringIndexType?: StringIndexType;
1563
+ readonly confidenceScores: SentimentConfidenceScores;
1317
1564
  /**
1318
- * If set to false, you opt-in to have your text input logged for troubleshooting. By default, Text Analytics
1319
- * will not log your input text for pii entities recognition. Setting this parameter to false,
1320
- * enables input logging.
1321
- */
1322
- disableServiceLogs?: boolean;
1323
- }
1324
-
1325
- /**
1326
- * The error of a recognize pii entities action.
1327
- */
1328
- export declare type RecognizePiiEntitiesActionErrorResult = TextAnalyticsActionErrorResult;
1329
-
1330
- /**
1331
- * The result of a recognize pii entities action.
1332
- */
1333
- export declare type RecognizePiiEntitiesActionResult = RecognizePiiEntitiesActionSuccessResult | RecognizePiiEntitiesActionErrorResult;
1334
-
1335
- /**
1336
- * The results of a succeeded recognize pii entities action.
1337
- */
1338
- export declare interface RecognizePiiEntitiesActionSuccessResult extends TextAnalyticsActionSuccessState {
1339
- /**
1340
- * Array of the results for each pii entities recognition action.
1565
+ * The predicted sentiment for each sentence in the corresponding document.
1341
1566
  */
1342
- results: RecognizePiiEntitiesResultArray;
1567
+ readonly sentences: SentenceSentiment[];
1343
1568
  }
1344
1569
 
1345
- /**
1346
- * An error result from the recognize entities operation on a single document.
1347
- */
1348
- export declare type RecognizePiiEntitiesErrorResult = TextAnalyticsErrorResult;
1349
-
1350
- /**
1351
- * Options for the recognize PII entities operation.
1352
- */
1353
- export declare interface RecognizePiiEntitiesOptions extends TextAnalyticsOperationOptions {
1354
- /**
1355
- * Filters entities to ones only included in the specified domain (e.g., if
1356
- * set to 'PHI', entities in the Protected Healthcare Information domain will
1357
- * only be returned). @see {@link https://aka.ms/tanerpii} for more information.
1358
- */
1359
- domainFilter?: PiiEntityDomain;
1360
- /**
1361
- * Specifies the measurement unit used to calculate the offset and length properties.
1362
- * Possible units are "TextElements_v8", "UnicodeCodePoint", and "Utf16CodeUnit".
1363
- * The default is the JavaScript's default which is "Utf16CodeUnit".
1364
- */
1365
- stringIndexType?: StringIndexType;
1366
- /**
1367
- * Filters entities to ones only included in the specified array of categories
1368
- */
1369
- categoriesFilter?: PiiEntityCategory[];
1570
+ /** Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative. */
1571
+ export declare interface SentimentConfidenceScores {
1572
+ positive: number;
1573
+ neutral: number;
1574
+ negative: number;
1370
1575
  }
1371
1576
 
1372
1577
  /**
1373
- * The result of the recognize entities 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.
1374
1585
  */
1375
- export declare type RecognizePiiEntitiesResult = RecognizePiiEntitiesSuccessResult | RecognizePiiEntitiesErrorResult;
1586
+ export declare type StringIndexType = string;
1376
1587
 
1377
1588
  /**
1378
- * Collection of `RecognizePiiEntitiesResult` objects corresponding to a batch of input documents, and
1379
- * annotated with information about the batch operation.
1589
+ * An error result from the extract summary operation on a single document.
1380
1590
  */
1381
- export declare interface RecognizePiiEntitiesResultArray extends Array<RecognizePiiEntitiesResult> {
1382
- /**
1383
- * Statistics about the input document batch and how it was processed
1384
- * by the service. This property will have a value when includeStatistics is set to true
1385
- * in the client call.
1386
- */
1387
- statistics?: TextDocumentBatchStatistics;
1388
- /**
1389
- * The version of the text analytics model used by this operation on this
1390
- * batch of input documents.
1391
- */
1392
- modelVersion: string;
1393
- }
1591
+ export declare type SummarizationExtractionErrorResult = TextAnalysisErrorResult;
1394
1592
 
1395
1593
  /**
1396
- * The result of the recognize entities operation on a single document, containing the collection of
1397
- * `Entity` objects identified in that document.
1594
+ * The result of the extract summary operation on a single document.
1398
1595
  */
1399
- export declare interface RecognizePiiEntitiesSuccessResult extends TextAnalyticsSuccessResult {
1400
- /**
1401
- * The collection of entities identified in the input document.
1402
- */
1403
- readonly entities: PiiEntity[];
1404
- /**
1405
- * The text redacted.
1406
- */
1407
- redactedText: string;
1408
- }
1409
-
1410
- export declare interface SentenceAssessment {
1411
- /** Assessment sentiment in the sentence. */
1412
- sentiment: TokenSentimentValue;
1413
- /** Assessment sentiment confidence scores in the sentence. */
1414
- confidenceScores: TargetConfidenceScoreLabel;
1415
- /** The assessment offset from the start of the sentence. */
1416
- offset: number;
1417
- /** The length of the assessment. */
1418
- length: number;
1419
- /** The assessment text detected. */
1420
- text: string;
1421
- /** The indicator representing if the assessment is negated. */
1422
- isNegated: boolean;
1423
- }
1596
+ export declare type SummarizationExtractionResult = SummarizationExtractionSuccessResult | SummarizationExtractionErrorResult;
1424
1597
 
1425
1598
  /**
1426
- * 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.
1599
+ * The result of the summarization extraction action on a single document,
1600
+ * containing a collection of the summary identified in that document.
1427
1601
  */
1428
- export declare interface SentenceSentiment {
1429
- /**
1430
- * The sentence text.
1431
- */
1432
- text: string;
1433
- /**
1434
- * The predicted Sentiment for the sentence.
1435
- */
1436
- sentiment: SentenceSentimentLabel;
1437
- /**
1438
- * The sentiment confidence score between 0 and 1 for the sentence for all classes.
1439
- */
1440
- confidenceScores: SentimentConfidenceScores;
1441
- /**
1442
- * The sentence text offset from the start of the document.
1443
- */
1444
- offset: number;
1445
- /**
1446
- * The length of the sentence text.
1447
- */
1448
- length: number;
1602
+ export declare interface SummarizationExtractionSuccessResult extends TextAnalysisSuccessResult {
1449
1603
  /**
1450
- * The list of opinions mined from this sentence. For example in "The food is
1451
- * good, but the service is bad", we would mine these two opinions "food is
1452
- * good", "service is bad". Only returned if `includeOpinionMining` is set to
1453
- * True in the call to `analyzeSentiment`.
1604
+ * A list of sentences composing a summary of the input document.
1454
1605
  */
1455
- opinions: Opinion[];
1606
+ readonly sentences: SummarySentence[];
1456
1607
  }
1457
1608
 
1458
- /** Defines values for SentenceSentimentLabel. */
1459
- export declare type SentenceSentimentLabel = "positive" | "neutral" | "negative";
1460
-
1461
- /** Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative. */
1462
- export declare interface SentimentConfidenceScores {
1463
- positive: number;
1464
- neutral: number;
1465
- negative: number;
1466
- }
1467
-
1468
- /**
1469
- * Measurement units that can used to calculate the offset and length properties.
1470
- */
1471
- export declare type StringIndexType = "TextElement_v8" | "UnicodeCodePoint" | "Utf16CodeUnit";
1472
-
1473
- /**
1474
- * An extracted sentence as part of the summary of a document.
1475
- */
1609
+ /** A sentence that is part of the extracted summary. */
1476
1610
  export declare interface SummarySentence {
1477
1611
  /** The extracted sentence text. */
1478
1612
  text: string;
1479
1613
  /** A double value representing the relevance of the sentence within the summary. Higher values indicate higher importance. */
1480
1614
  rankScore: number;
1481
- /** 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. */
1482
1616
  offset: number;
1483
1617
  /** The length of the sentence. */
1484
1618
  length: number;
1485
1619
  }
1486
1620
 
1487
1621
  /** Represents the confidence scores across all sentiment classes: positive, neutral, negative. */
1488
- export declare interface TargetConfidenceScoreLabel {
1622
+ export declare interface TargetConfidenceScores {
1489
1623
  positive: number;
1490
1624
  negative: number;
1491
1625
  }
1492
1626
 
1493
1627
  /**
1494
1628
  * TargetSentiment contains the predicted sentiment, confidence scores and other
1495
- * 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
1496
1630
  * key component of that product/service. For example in "The food at Hotel Foo
1497
1631
  * is good", "food" is a target of "Hotel Foo".
1498
1632
  */
@@ -1501,335 +1635,510 @@ export declare interface TargetSentiment {
1501
1635
  * The sentiment confidence score between 0 and 1 for the target for
1502
1636
  * 'positive' and 'negative' labels.
1503
1637
  */
1504
- confidenceScores: TargetConfidenceScoreLabel;
1638
+ readonly confidenceScores: TargetConfidenceScores;
1505
1639
  /**
1506
- * The predicted Sentiment for the Target. Possible values include 'positive',
1507
- * 'mixed', and 'negative'.
1640
+ * The predicted Sentiment for the Target. For a list of possible values,
1641
+ * see {@link TokenSentimentLabel}
1508
1642
  */
1509
- sentiment: TokenSentimentValue;
1643
+ readonly sentiment: TokenSentimentLabel;
1510
1644
  /**
1511
1645
  * The target text.
1512
1646
  */
1513
- text: string;
1647
+ readonly text: string;
1514
1648
  /**
1515
1649
  * The Target text offset from the start of the sentence.
1516
1650
  */
1517
- offset: number;
1651
+ readonly offset: number;
1518
1652
  /**
1519
1653
  * The length of the Target text.
1520
1654
  */
1521
- length: number;
1655
+ readonly length: number;
1522
1656
  }
1523
1657
 
1524
1658
  /**
1525
- * The type of a text analytics action.
1526
- */
1527
- export declare interface TextAnalyticsAction {
1528
- /**
1529
- * The version of the text analytics model used by this operation on this
1530
- * batch of input documents.
1531
- */
1532
- modelVersion?: string;
1533
- /**
1534
- * The preferred name for this action.
1535
- */
1536
- actionName?: string;
1537
- }
1538
-
1539
- /**
1540
- * The error of an analyze batch action.
1541
- */
1542
- export declare interface TextAnalyticsActionErrorResult {
1543
- /**
1544
- * When this action was completed by the service.
1545
- */
1546
- readonly failedOn: Date;
1547
- /**
1548
- * The Error for this action result.
1549
- */
1550
- readonly error: TextAnalyticsError;
1551
- }
1552
-
1553
- /**
1554
- * Description of collection of actions for the analyze API to perform on input documents. However, currently, the service can accept up to one action only per action type.
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
+ * ```
1555
1694
  */
1556
- export declare interface TextAnalyticsActions {
1695
+ export declare class TextAnalysisClient {
1696
+ private readonly _client;
1697
+ private readonly _tracing;
1698
+ private readonly defaultCountryHint;
1699
+ private readonly defaultLanguage;
1557
1700
  /**
1558
- * A collection of descriptions of entities recognition actions. However, currently, the service can accept up to one action only for `recognizeEntities`.
1559
- */
1560
- recognizeEntitiesActions?: RecognizeCategorizedEntitiesAction[];
1561
- /**
1562
- * A collection of descriptions of Pii entities recognition actions. However, currently, the service can accept up to one action only for `recognizePiiEntities`.
1563
- */
1564
- recognizePiiEntitiesActions?: RecognizePiiEntitiesAction[];
1565
- /**
1566
- * A collection of descriptions of key phrases recognition actions. However, currently, the service can accept up to one action only for `extractKeyPhrases`.
1567
- */
1568
- extractKeyPhrasesActions?: ExtractKeyPhrasesAction[];
1569
- /**
1570
- * A collection of descriptions of entities linking actions. However, currently, the service can accept up to one action only for `recognizeLinkedEntities`.
1571
- */
1572
- recognizeLinkedEntitiesActions?: RecognizeLinkedEntitiesAction[];
1573
- /**
1574
- * A collection of descriptions of sentiment analysis actions. However, currently, the service can accept up to one action only for `analyzeSentiment`.
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.
1575
1722
  */
1576
- analyzeSentimentActions?: AnalyzeSentimentAction[];
1723
+ constructor(endpointUrl: string, credential: KeyCredential, options?: TextAnalysisClientOptions);
1577
1724
  /**
1578
- * A collection of descriptions of summarization extraction actions. However, currently, the service can accept up to one action only for `extractSummary`.
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.
1579
1750
  */
1580
- extractSummaryActions?: ExtractSummaryAction[];
1581
- }
1582
-
1583
- /**
1584
- * The state of a succeeded action.
1585
- */
1586
- export declare interface TextAnalyticsActionSuccessState {
1751
+ constructor(endpointUrl: string, credential: TokenCredential, options?: TextAnalysisClientOptions);
1587
1752
  /**
1588
- * 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.
1589
1791
  */
1590
- readonly completedOn: Date;
1792
+ analyze<ActionName extends "LanguageDetection">(actionName: ActionName, documents: LanguageDetectionInput[], options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions): Promise<AnalyzeResult<ActionName>>;
1591
1793
  /**
1592
- * 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.
1593
1838
  */
1594
- readonly error?: undefined;
1595
- }
1596
-
1597
- /**
1598
- * Client class for interacting with Azure Text Analytics.
1599
- */
1600
- export declare class TextAnalyticsClient {
1839
+ analyze<ActionName extends "LanguageDetection">(actionName: ActionName, documents: string[], countryHint?: string, options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions): Promise<AnalyzeResult<ActionName>>;
1601
1840
  /**
1602
- * 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
1603
1919
  */
1604
- readonly endpointUrl: string;
1920
+ analyze<ActionName extends AnalyzeActionName = AnalyzeActionName>(actionName: ActionName, documents: TextDocumentInput[], options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions): Promise<AnalyzeResult<ActionName>>;
1605
1921
  /**
1606
- * 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
1607
2004
  */
1608
- defaultCountryHint: string;
2005
+ analyze<ActionName extends AnalyzeActionName = AnalyzeActionName>(actionName: ActionName, documents: string[], languageCode?: string, options?: AnalyzeActionParameters<ActionName> & TextAnalysisOperationOptions): Promise<AnalyzeResult<ActionName>>;
1609
2006
  /**
1610
- * 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
1611
2062
  */
1612
- defaultLanguage: string;
1613
- /* Excluded from this release type: client */
2063
+ beginAnalyzeBatch(actions: AnalyzeBatchAction[], documents: string[], languageCode?: string, options?: BeginAnalyzeBatchOptions): Promise<AnalyzeBatchPoller>;
1614
2064
  /**
1615
- * 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`.
2069
+ *
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.
1616
2072
  *
1617
- * Example usage:
1618
- * ```ts
1619
- * import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics";
2073
+ * See {@link https://docs.microsoft.com//azure/cognitive-services/language-service/concepts/data-limits}
2074
+ * for data limits.
1620
2075
  *
1621
- * const client = new TextAnalyticsClient(
1622
- * "<service endpoint>",
1623
- * new AzureKeyCredential("<api key>")
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
1624
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
+ * }
1625
2106
  * ```
1626
- * @param endpointUrl - The URL to the TextAnalytics endpoint
1627
- * @param credential - Used to authenticate requests to the service.
1628
- * @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
1629
2113
  */
1630
- constructor(endpointUrl: string, credential: TokenCredential | KeyCredential, options?: TextAnalyticsClientOptions);
2114
+ beginAnalyzeBatch(actions: AnalyzeBatchAction[], documents: TextDocumentInput[], options?: BeginAnalyzeBatchOptions): Promise<AnalyzeBatchPoller>;
1631
2115
  /**
1632
- * Runs a predictive model to determine the language that the passed-in
1633
- * input strings are written in, and returns, for each one, the detected
1634
- * language as well as a score indicating the model's confidence that the
1635
- * inferred language is correct. Scores close to 1 indicate high certainty in
1636
- * the result. 120 languages are supported.
1637
- * @param documents - A collection of input strings to analyze.
1638
- * @param countryHint - Indicates the country of origin for all of
1639
- * the input strings to assist the text analytics model in predicting
1640
- * the language they are written in. If unspecified, this value will be
1641
- * set to the default country hint in `TextAnalyticsClientOptions`.
1642
- * If set to an empty string, or the string "none", the service will apply a
1643
- * model where the country is explicitly unset.
1644
- * The same country hint is applied to all strings in the input collection.
1645
- * @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
+ * ```
1646
2134
  */
1647
- detectLanguage(documents: string[], countryHint?: string, options?: DetectLanguageOptions): Promise<DetectLanguageResultArray>;
1648
- /**
1649
- * Runs a predictive model to determine the language that the passed-in
1650
- * input document are written in, and returns, for each one, the detected
1651
- * language as well as a score indicating the model's confidence that the
1652
- * inferred language is correct. Scores close to 1 indicate high certainty in
1653
- * the result. 120 languages are supported.
1654
- * @param documents - A collection of input documents to analyze.
1655
- * @param options - Optional parameters for the operation.
1656
- */
1657
- detectLanguage(documents: DetectLanguageInput[], options?: DetectLanguageOptions): Promise<DetectLanguageResultArray>;
1658
- /**
1659
- * Runs a predictive model to identify a collection of named entities
1660
- * in the passed-in input strings, and categorize those entities into types
1661
- * such as person, location, or organization. For more information on
1662
- * available categories, @see
1663
- * {@link https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types}.
1664
- * For a list of languages supported by this operation, @see
1665
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
1666
- * @param documents - The input strings to analyze.
1667
- * @param language - The language that all the input strings are
1668
- written in. If unspecified, this value will be set to the default
1669
- language in `TextAnalyticsClientOptions`.
1670
- If set to an empty string, the service will apply a model
1671
- where the language is explicitly set to "None".
1672
- * @param options - Optional parameters for the operation.
1673
- */
1674
- recognizeEntities(documents: string[], language?: string, options?: RecognizeCategorizedEntitiesOptions): Promise<RecognizeCategorizedEntitiesResultArray>;
1675
- /**
1676
- * Runs a predictive model to identify a collection of named entities
1677
- * in the passed-in input documents, and categorize those entities into types
1678
- * such as person, location, or organization. For more information on
1679
- * available categories, @see
1680
- * {@link https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types}.
1681
- * For a list of languages supported by this operation, @see
1682
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
1683
- * @param documents - The input documents to analyze.
1684
- * @param options - Optional parameters for the operation.
1685
- */
1686
- recognizeEntities(documents: TextDocumentInput[], options?: RecognizeCategorizedEntitiesOptions): Promise<RecognizeCategorizedEntitiesResultArray>;
1687
- /**
1688
- * Runs a predictive model to identify the positive, negative, neutral, or mixed
1689
- * sentiment contained in the input strings, as well as scores indicating
1690
- * the model's confidence in each of the predicted sentiments. Optionally it
1691
- * can also identify targets in the text and assessments about it through
1692
- * opinion mining. For a list of languages supported by this operation, @see
1693
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
1694
- * @param documents - The input strings to analyze.
1695
- * @param language - The language that all the input strings are
1696
- written in. If unspecified, this value will be set to the default
1697
- language in `TextAnalyticsClientOptions`.
1698
- If set to an empty string, the service will apply a model
1699
- where the lanuage is explicitly set to "None".
1700
- * @param options - Optional parameters that includes enabling opinion mining.
1701
- */
1702
- analyzeSentiment(documents: string[], language?: string, options?: AnalyzeSentimentOptions): Promise<AnalyzeSentimentResultArray>;
1703
- /**
1704
- * Runs a predictive model to identify the positive, negative or neutral, or mixed
1705
- * sentiment contained in the input documents, as well as scores indicating
1706
- * the model's confidence in each of the predicted sentiments.Optionally it
1707
- * can also identify targets in the text and assessments about it through
1708
- * opinion mining. For a list of languages supported by this operation, @see
1709
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
1710
- * @param documents - The input documents to analyze.
1711
- * @param options - Optional parameters that includes enabling opinion mining.
1712
- */
1713
- analyzeSentiment(documents: TextDocumentInput[], options?: AnalyzeSentimentOptions): Promise<AnalyzeSentimentResultArray>;
1714
- /**
1715
- * Runs a model to identify a collection of significant phrases
1716
- * found in the passed-in input strings.
1717
- * For a list of languages supported by this operation, @see
1718
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
1719
- * @param documents - The input strings to analyze.
1720
- * @param language - The language that all the input strings are
1721
- written in. If unspecified, this value will be set to the default
1722
- language in `TextAnalyticsClientOptions`.
1723
- If set to an empty string, the service will apply a model
1724
- where the language is explicitly set to "None".
1725
- * @param options - Options for the operation.
1726
- */
1727
- extractKeyPhrases(documents: string[], language?: string, options?: ExtractKeyPhrasesOptions): Promise<ExtractKeyPhrasesResultArray>;
1728
- /**
1729
- * Runs a model to identify a collection of significant phrases
1730
- * found in the passed-in input documents.
1731
- * For a list of languages supported by this operation, @see
1732
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
1733
- * @param documents - The input documents to analyze.
1734
- * @param options - Options for the operation.
1735
- */
1736
- extractKeyPhrases(documents: TextDocumentInput[], options?: ExtractKeyPhrasesOptions): Promise<ExtractKeyPhrasesResultArray>;
1737
- /**
1738
- * Runs a predictive model to identify a collection of entities containing
1739
- * personally identifiable information found in the passed-in input strings,
1740
- * and categorize those entities into types such as US social security
1741
- * number, drivers license number, or credit card number.
1742
- * For a list of languages supported by this operation, @see
1743
- * {@link https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support}.
1744
- * @param inputs - The input strings to analyze.
1745
- * @param language - The language that all the input strings are
1746
- written in. If unspecified, this value will be set to the default
1747
- language in `TextAnalyticsClientOptions`.
1748
- If set to an empty string, the service will apply a model
1749
- where the language is explicitly set to "None".
1750
- * @param options - Options for the operation.
1751
- */
1752
- recognizePiiEntities(inputs: string[], language?: string, options?: RecognizePiiEntitiesOptions): Promise<RecognizePiiEntitiesResultArray>;
1753
- /**
1754
- * Runs a predictive model to identify a collection of entities containing
1755
- * personally identifiable information found in the passed-in input documents,
1756
- * and categorize those entities into types such as US social security
1757
- * number, drivers license number, or credit card number.
1758
- * For a list of languages supported by this operation, @see
1759
- * {@link https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support}.
1760
- * @param inputs - The input documents to analyze.
1761
- * @param options - Optional parameters for the operation.
1762
- */
1763
- recognizePiiEntities(inputs: TextDocumentInput[], options?: RecognizePiiEntitiesOptions): Promise<RecognizePiiEntitiesResultArray>;
1764
- /**
1765
- * Runs a predictive model to identify a collection of entities
1766
- * found in the passed-in input strings, and include information linking the
1767
- * entities to their corresponding entries in a well-known knowledge base.
1768
- * For a list of languages supported by this operation, @see
1769
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
1770
- * @param documents - The input strings to analyze.
1771
- * @param language - The language that all the input strings are
1772
- written in. If unspecified, this value will be set to the default
1773
- language in `TextAnalyticsClientOptions`.
1774
- If set to an empty string, the service will apply a model
1775
- where the language is explicitly set to "None".
1776
- * @param options - Options for the operation.
1777
- */
1778
- recognizeLinkedEntities(documents: string[], language?: string, options?: RecognizeLinkedEntitiesOptions): Promise<RecognizeLinkedEntitiesResultArray>;
1779
- /**
1780
- * Runs a predictive model to identify a collection of entities
1781
- * found in the passed-in input documents, and include information linking the
1782
- * entities to their corresponding entries in a well-known knowledge base.
1783
- * For a list of languages supported by this operation, @see
1784
- * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.
1785
- * @param documents - The input documents to analyze.
1786
- * @param options - Options for the operation.
1787
- */
1788
- recognizeLinkedEntities(documents: TextDocumentInput[], options?: RecognizeLinkedEntitiesOptions): Promise<RecognizeLinkedEntitiesResultArray>;
1789
- /**
1790
- * Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions,
1791
- * symptoms, etc) and their relations.
1792
- * @param documents - Collection of documents to analyze.
1793
- * @param language - The language that all the input strings are
1794
- written in. If unspecified, this value will be set to the default
1795
- language in `TextAnalyticsClientOptions`.
1796
- If set to an empty string, the service will apply a model
1797
- where the language is explicitly set to "None".
1798
- * @param options - Options for the operation.
1799
- */
1800
- beginAnalyzeHealthcareEntities(documents: string[], language?: string, options?: BeginAnalyzeHealthcareEntitiesOptions): Promise<AnalyzeHealthcareEntitiesPollerLike>;
1801
- /**
1802
- * Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions,
1803
- * symptoms, etc) and their relations.
1804
- * @param documents - Collection of documents to analyze.
1805
- * @param options - Options for the operation.
1806
- */
1807
- beginAnalyzeHealthcareEntities(documents: TextDocumentInput[], options?: BeginAnalyzeHealthcareEntitiesOptions): Promise<AnalyzeHealthcareEntitiesPollerLike>;
1808
- /**
1809
- * Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.
1810
- * @param documents - Collection of documents to analyze
1811
- * @param actions - TextAnalyticsActions to execute.
1812
- * @param language - The language that all the input strings are
1813
- written in. If unspecified, this value will be set to the default
1814
- language in `TextAnalyticsClientOptions`.
1815
- If set to an empty string, the service will apply a model
1816
- where the language is explicitly set to "None".
1817
- * @param options - Options for the operation.
1818
- */
1819
- beginAnalyzeActions(documents: string[], actions: TextAnalyticsActions, language?: string, options?: BeginAnalyzeActionsOptions): Promise<AnalyzeActionsPollerLike>;
1820
- /**
1821
- * Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.
1822
- * @param documents - Collection of documents to analyze
1823
- * @param actions - TextAnalyticsActions to execute.
1824
- * @param options - Options for the operation.
1825
- */
1826
- beginAnalyzeActions(documents: TextDocumentInput[], actions: TextAnalyticsActions, options?: BeginAnalyzeActionsOptions): Promise<AnalyzeActionsPollerLike>;
1827
- }
1828
-
1829
- /**
1830
- * Client options used to configure TextAnalytics API requests.
1831
- */
1832
- 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 {
1833
2142
  /**
1834
2143
  * The default country hint to use. Defaults to "us".
1835
2144
  */
@@ -1838,16 +2147,20 @@ export declare interface TextAnalyticsClientOptions extends CommonClientOptions
1838
2147
  * The default language to use. Defaults to "en".
1839
2148
  */
1840
2149
  defaultLanguage?: string;
2150
+ /**
2151
+ * The version of the Cognitive Language Service API to use.
2152
+ */
2153
+ apiVersion?: string;
1841
2154
  }
1842
2155
 
1843
2156
  /**
1844
- * Type describing an error from the Text Analytics service.
2157
+ * Type describing an API error.
1845
2158
  */
1846
- export declare interface TextAnalyticsError {
2159
+ export declare interface TextAnalysisError {
1847
2160
  /**
1848
- * A code describing the kind of error produced
2161
+ * A code describing the kind of error produced. See {@link KnownTextAnalysisErrorCode}.
1849
2162
  */
1850
- readonly code: ErrorCode;
2163
+ readonly code: string;
1851
2164
  /**
1852
2165
  * A message from the service explaining the error
1853
2166
  */
@@ -1859,10 +2172,9 @@ export declare interface TextAnalyticsError {
1859
2172
  }
1860
2173
 
1861
2174
  /**
1862
- * Base type for error results of text analytics operations corresponding to a
1863
- * single document.
2175
+ * Base type for error results of an action corresponding to a single document.
1864
2176
  */
1865
- export declare interface TextAnalyticsErrorResult {
2177
+ export declare interface TextAnalysisErrorResult {
1866
2178
  /**
1867
2179
  * Unique, non-empty document identifier.
1868
2180
  */
@@ -1870,50 +2182,35 @@ export declare interface TextAnalyticsErrorResult {
1870
2182
  /**
1871
2183
  * The Error for this document result.
1872
2184
  */
1873
- readonly error: TextAnalyticsError;
2185
+ readonly error: TextAnalysisError;
1874
2186
  }
1875
2187
 
1876
2188
  /**
1877
- * Options common to all text analytics operations.
2189
+ * Options common to all operations.
1878
2190
  */
1879
- export declare interface TextAnalyticsOperationOptions extends OperationOptions {
1880
- /**
1881
- * This value indicates which model will be used for scoring. If a model-version is
1882
- * not specified, the API should default to the latest, non-preview version.
1883
- * For supported model versions, see operation-specific documentation, for example:
1884
- * https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis#model-versioning
1885
- */
1886
- modelVersion?: string;
2191
+ export declare interface TextAnalysisOperationOptions extends OperationOptions {
1887
2192
  /**
1888
2193
  * If set to true, response will contain input and document level statistics.
1889
2194
  */
1890
2195
  includeStatistics?: boolean;
1891
2196
  /**
1892
- * If set to true (the default for `beginAnalyzeHealthcareEntities` and `recognizePiiEntities`),
1893
- * you opt-out of having your text input logged for troubleshooting. By default, Text Analytics
1894
- * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this
1895
- * parameter to true, disables input logging and may limit our ability to remediate issues that
1896
- * occur.
2197
+ * The version of the Cognitive Language Service API to use.
1897
2198
  */
1898
- disableServiceLogs?: boolean;
2199
+ apiVersion?: string;
1899
2200
  }
1900
2201
 
1901
- /** Defines values for State. */
1902
- export declare type TextAnalyticsOperationStatus = "notStarted" | "running" | "succeeded" | "failed" | "rejected" | "cancelled" | "cancelling";
1903
-
1904
2202
  /**
1905
- * Base type for results of text analytics operations corresponding to a single
1906
- * input document.
2203
+ * Base type for results of an action corresponding to a single input document.
1907
2204
  */
1908
- export declare interface TextAnalyticsSuccessResult {
2205
+ export declare interface TextAnalysisSuccessResult {
1909
2206
  /**
1910
2207
  * Unique, non-empty document identifier.
1911
2208
  */
1912
2209
  readonly id: string;
1913
2210
  /**
1914
- * Statistics about the input document and how it was processed
1915
- * by the service. This property will have a value when includeStatistics is set to true
1916
- * 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.
1917
2214
  */
1918
2215
  readonly statistics?: TextDocumentStatistics;
1919
2216
  /**
@@ -1921,21 +2218,13 @@ export declare interface TextAnalyticsSuccessResult {
1921
2218
  *
1922
2219
  * If no warnings were returned, this array will be empty.
1923
2220
  */
1924
- readonly warnings: TextAnalyticsWarning[];
2221
+ readonly warnings: DocumentWarning[];
1925
2222
  /**
1926
- * Discriminant to determine if that this is an error result.
2223
+ * Discriminant to determine if this is an error result.
1927
2224
  */
1928
2225
  readonly error?: undefined;
1929
2226
  }
1930
2227
 
1931
- /** Represents a warning encountered while processing a document. */
1932
- export declare interface TextAnalyticsWarning {
1933
- /** Error code. */
1934
- code: WarningCode;
1935
- /** Warning message. */
1936
- message: string;
1937
- }
1938
-
1939
2228
  /** if includeStatistics=true was specified in the request this field will contain information about the request payload. */
1940
2229
  export declare interface TextDocumentBatchStatistics {
1941
2230
  /** Number of documents submitted in the request. */
@@ -1948,7 +2237,7 @@ export declare interface TextDocumentBatchStatistics {
1948
2237
  transactionCount: number;
1949
2238
  }
1950
2239
 
1951
- /** 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. */
1952
2241
  export declare interface TextDocumentInput {
1953
2242
  /** A unique, non-empty document identifier. */
1954
2243
  id: string;
@@ -1966,8 +2255,8 @@ export declare interface TextDocumentStatistics {
1966
2255
  transactionCount: number;
1967
2256
  }
1968
2257
 
1969
- /** Defines values for TokenSentimentValue. */
1970
- export declare type TokenSentimentValue = "positive" | "mixed" | "negative";
2258
+ /** Defines values for TokenSentimentLabel. */
2259
+ export declare type TokenSentimentLabel = "positive" | "mixed" | "negative";
1971
2260
 
1972
2261
  /**
1973
2262
  * Defines values for WarningCode. \