@azure/ai-text-analytics 5.2.0-alpha.20211201.2 → 5.2.0-alpha.20220107.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +78 -76
- package/dist/index.js.map +1 -1
- package/dist-esm/src/analyzeActionsResult.js +15 -15
- package/dist-esm/src/analyzeActionsResult.js.map +1 -1
- package/dist-esm/src/analyzeHealthcareEntitiesResult.js +4 -4
- package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +1 -1
- package/dist-esm/src/analyzeLro.js +11 -11
- package/dist-esm/src/analyzeLro.js.map +1 -1
- package/dist-esm/src/analyzeSentimentResult.js +5 -5
- package/dist-esm/src/analyzeSentimentResult.js.map +1 -1
- package/dist-esm/src/analyzeSentimentResultArray.js +1 -1
- package/dist-esm/src/analyzeSentimentResultArray.js.map +1 -1
- package/dist-esm/src/azureKeyCredentialPolicy.js +1 -1
- package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/src/detectLanguageResult.js +1 -1
- package/dist-esm/src/detectLanguageResult.js.map +1 -1
- package/dist-esm/src/detectLanguageResultArray.js +1 -1
- package/dist-esm/src/detectLanguageResultArray.js.map +1 -1
- package/dist-esm/src/extractKeyPhrasesResult.js +1 -1
- package/dist-esm/src/extractKeyPhrasesResult.js.map +1 -1
- package/dist-esm/src/extractKeyPhrasesResultArray.js +1 -1
- package/dist-esm/src/extractKeyPhrasesResultArray.js.map +1 -1
- package/dist-esm/src/extractSummaryResult.js +1 -1
- package/dist-esm/src/extractSummaryResult.js.map +1 -1
- package/dist-esm/src/extractSummaryResultArray.js +1 -1
- package/dist-esm/src/extractSummaryResultArray.js.map +1 -1
- package/dist-esm/src/healthLro.js +12 -12
- package/dist-esm/src/healthLro.js.map +1 -1
- package/dist-esm/src/index.js +2 -4
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/multiCategoryClassifyResult.js +1 -1
- package/dist-esm/src/multiCategoryClassifyResult.js.map +1 -1
- package/dist-esm/src/multiCategoryClassifyResultArray.js +1 -1
- package/dist-esm/src/multiCategoryClassifyResultArray.js.map +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizePiiEntitiesResult.js +1 -1
- package/dist-esm/src/recognizePiiEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizePiiEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/singleCategoryClassifyResult.js +1 -1
- package/dist-esm/src/singleCategoryClassifyResult.js.map +1 -1
- package/dist-esm/src/singleCategoryClassifyResultArray.js +1 -1
- package/dist-esm/src/singleCategoryClassifyResultArray.js.map +1 -1
- package/dist-esm/src/textAnalyticsClient.js +41 -41
- package/dist-esm/src/textAnalyticsClient.js.map +1 -1
- package/dist-esm/src/textAnalyticsResult.js +5 -5
- package/dist-esm/src/textAnalyticsResult.js.map +1 -1
- package/dist-esm/src/tracing.js +1 -1
- package/dist-esm/src/tracing.js.map +1 -1
- package/dist-esm/src/util.js +9 -6
- package/dist-esm/src/util.js.map +1 -1
- package/package.json +7 -10
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('@azure/core-asynciterator-polyfill');
|
|
6
5
|
var coreAuth = require('@azure/core-auth');
|
|
7
6
|
var tslib = require('tslib');
|
|
8
7
|
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
@@ -4016,7 +4015,7 @@ const logger = logger$1.createClientLogger("ai-text-analytics");
|
|
|
4016
4015
|
*/
|
|
4017
4016
|
const createSpan = coreTracing.createSpanFunction({
|
|
4018
4017
|
packagePrefix: "Azure.CognitiveServices.TextAnalytics",
|
|
4019
|
-
namespace: "Microsoft.CognitiveServices"
|
|
4018
|
+
namespace: "Microsoft.CognitiveServices",
|
|
4020
4019
|
});
|
|
4021
4020
|
|
|
4022
4021
|
// Copyright (c) Microsoft Corporation.
|
|
@@ -4056,7 +4055,7 @@ function parseAssessmentIndex(pointer) {
|
|
|
4056
4055
|
const assessmentIndex = {
|
|
4057
4056
|
document: parseInt(res[1]),
|
|
4058
4057
|
sentence: parseInt(res[2]),
|
|
4059
|
-
assessment: parseInt(res[3])
|
|
4058
|
+
assessment: parseInt(res[3]),
|
|
4060
4059
|
};
|
|
4061
4060
|
return assessmentIndex;
|
|
4062
4061
|
}
|
|
@@ -4140,6 +4139,9 @@ function appendReadableErrorMessage(currentMessage, innerMessage) {
|
|
|
4140
4139
|
function compileError(errorResponse) {
|
|
4141
4140
|
var _a;
|
|
4142
4141
|
const castErrorResponse = errorResponse;
|
|
4142
|
+
if (!castErrorResponse.response) {
|
|
4143
|
+
throw errorResponse;
|
|
4144
|
+
}
|
|
4143
4145
|
const topLevelError = (_a = castErrorResponse.response.parsedBody) === null || _a === void 0 ? void 0 : _a.error;
|
|
4144
4146
|
if (!topLevelError)
|
|
4145
4147
|
return errorResponse;
|
|
@@ -4158,7 +4160,7 @@ function compileError(errorResponse) {
|
|
|
4158
4160
|
unwrap(topLevelError);
|
|
4159
4161
|
return new coreRestPipeline.RestError(errorMessage, {
|
|
4160
4162
|
code: invalidDocumentBatchCode ? "InvalidDocumentBatch" : topLevelError.code,
|
|
4161
|
-
statusCode: castErrorResponse.statusCode
|
|
4163
|
+
statusCode: castErrorResponse.statusCode,
|
|
4162
4164
|
});
|
|
4163
4165
|
}
|
|
4164
4166
|
/**
|
|
@@ -4182,8 +4184,8 @@ async function getRawResponse(f, options) {
|
|
|
4182
4184
|
rawResponse: {
|
|
4183
4185
|
statusCode: rawResponse.status,
|
|
4184
4186
|
headers: rawResponse.headers.toJSON(),
|
|
4185
|
-
body: rawResponse.parsedBody
|
|
4186
|
-
}
|
|
4187
|
+
body: rawResponse.parsedBody,
|
|
4188
|
+
},
|
|
4187
4189
|
};
|
|
4188
4190
|
}
|
|
4189
4191
|
/**
|
|
@@ -4197,13 +4199,13 @@ client, spec, spanStr, options, path) {
|
|
|
4197
4199
|
const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, Object.assign(Object.assign({}, spec), { path, httpMethod: "GET" })), finalOptions);
|
|
4198
4200
|
return {
|
|
4199
4201
|
flatResponse: flatResponse,
|
|
4200
|
-
rawResponse
|
|
4202
|
+
rawResponse,
|
|
4201
4203
|
};
|
|
4202
4204
|
}
|
|
4203
4205
|
catch (e) {
|
|
4204
4206
|
span.setStatus({
|
|
4205
4207
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4206
|
-
message: e.message
|
|
4208
|
+
message: e.message,
|
|
4207
4209
|
});
|
|
4208
4210
|
throw e;
|
|
4209
4211
|
}
|
|
@@ -4227,7 +4229,7 @@ function intoTextAnalyticsError(errorModel) {
|
|
|
4227
4229
|
return {
|
|
4228
4230
|
code: errorModel.code,
|
|
4229
4231
|
message: errorModel.message,
|
|
4230
|
-
target: errorModel.target
|
|
4232
|
+
target: errorModel.target,
|
|
4231
4233
|
};
|
|
4232
4234
|
}
|
|
4233
4235
|
/**
|
|
@@ -4237,7 +4239,7 @@ function makeTextAnalyticsSuccessResult(id, warnings, statistics) {
|
|
|
4237
4239
|
return {
|
|
4238
4240
|
id,
|
|
4239
4241
|
statistics,
|
|
4240
|
-
warnings
|
|
4242
|
+
warnings,
|
|
4241
4243
|
};
|
|
4242
4244
|
}
|
|
4243
4245
|
/**
|
|
@@ -4246,7 +4248,7 @@ function makeTextAnalyticsSuccessResult(id, warnings, statistics) {
|
|
|
4246
4248
|
function makeTextAnalyticsErrorResult(id, error) {
|
|
4247
4249
|
return {
|
|
4248
4250
|
id,
|
|
4249
|
-
error: intoTextAnalyticsError(error)
|
|
4251
|
+
error: intoTextAnalyticsError(error),
|
|
4250
4252
|
};
|
|
4251
4253
|
}
|
|
4252
4254
|
/**
|
|
@@ -4274,7 +4276,7 @@ function combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(inp
|
|
|
4274
4276
|
const sorted = processAndCombineSuccessfulAndErroneousDocuments(input, response, processSuccess, processError);
|
|
4275
4277
|
return Object.assign(sorted, {
|
|
4276
4278
|
statistics: response.statistics,
|
|
4277
|
-
modelVersion: response.modelVersion
|
|
4279
|
+
modelVersion: response.modelVersion,
|
|
4278
4280
|
});
|
|
4279
4281
|
}
|
|
4280
4282
|
/**
|
|
@@ -4290,7 +4292,7 @@ function combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInf
|
|
|
4290
4292
|
return Object.assign(sorted, {
|
|
4291
4293
|
statistics: response.statistics,
|
|
4292
4294
|
projectName: response.projectName,
|
|
4293
|
-
deploymentName: response.deploymentName
|
|
4295
|
+
deploymentName: response.deploymentName,
|
|
4294
4296
|
});
|
|
4295
4297
|
}
|
|
4296
4298
|
|
|
@@ -4346,7 +4348,7 @@ function makeRecognizeCategorizedEntitiesResultArray(input, response) {
|
|
|
4346
4348
|
* @internal
|
|
4347
4349
|
*/
|
|
4348
4350
|
function makeAnalyzeSentimentResult(result) {
|
|
4349
|
-
const { id, sentiment, confidenceScores, sentenceSentiments: sentences, warnings, statistics } = result;
|
|
4351
|
+
const { id, sentiment, confidenceScores, sentenceSentiments: sentences, warnings, statistics, } = result;
|
|
4350
4352
|
return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { sentiment,
|
|
4351
4353
|
confidenceScores, sentences: sentences.map((sentence) => convertGeneratedSentenceSentiment(sentence, result)) });
|
|
4352
4354
|
}
|
|
@@ -4379,13 +4381,13 @@ function convertGeneratedSentenceSentiment(sentence, result) {
|
|
|
4379
4381
|
sentiment: target.sentiment,
|
|
4380
4382
|
text: target.text,
|
|
4381
4383
|
offset: target.offset,
|
|
4382
|
-
length: target.length
|
|
4384
|
+
length: target.length,
|
|
4383
4385
|
},
|
|
4384
4386
|
assessments: target.relations
|
|
4385
4387
|
.filter((relation) => relation.relationType === "assessment")
|
|
4386
|
-
.map((relation) => convertTargetRelationToAssessmentSentiment(relation, result))
|
|
4388
|
+
.map((relation) => convertTargetRelationToAssessmentSentiment(relation, result)),
|
|
4387
4389
|
}))
|
|
4388
|
-
: []
|
|
4390
|
+
: [],
|
|
4389
4391
|
};
|
|
4390
4392
|
}
|
|
4391
4393
|
/**
|
|
@@ -4507,7 +4509,7 @@ function textAnalyticsAzureKeyCredentialPolicy(credential) {
|
|
|
4507
4509
|
sendRequest(request, next) {
|
|
4508
4510
|
request.headers.set(API_KEY_HEADER_NAME, credential.key);
|
|
4509
4511
|
return next(request);
|
|
4510
|
-
}
|
|
4512
|
+
},
|
|
4511
4513
|
};
|
|
4512
4514
|
}
|
|
4513
4515
|
|
|
@@ -4529,7 +4531,7 @@ function makeHealthcareEntitiesWithoutNeighbors(entity) {
|
|
|
4529
4531
|
text,
|
|
4530
4532
|
normalizedText: name,
|
|
4531
4533
|
subCategory: subcategory,
|
|
4532
|
-
dataSources: (_a = links === null || links === void 0 ? void 0 : links.map(({ dataSource, id }) => ({ name: dataSource, entityId: id }))) !== null && _a !== void 0 ? _a : []
|
|
4534
|
+
dataSources: (_a = links === null || links === void 0 ? void 0 : links.map(({ dataSource, id }) => ({ name: dataSource, entityId: id }))) !== null && _a !== void 0 ? _a : [],
|
|
4533
4535
|
};
|
|
4534
4536
|
}
|
|
4535
4537
|
/**
|
|
@@ -4540,8 +4542,8 @@ function makeHealthcareRelations(entities, relations) {
|
|
|
4540
4542
|
relationType: relation.relationType,
|
|
4541
4543
|
roles: relation.entities.map((role) => ({
|
|
4542
4544
|
entity: entities[parseHealthcareEntityIndex(role.ref)],
|
|
4543
|
-
name: role.role
|
|
4544
|
-
}))
|
|
4545
|
+
name: role.role,
|
|
4546
|
+
})),
|
|
4545
4547
|
}));
|
|
4546
4548
|
}
|
|
4547
4549
|
/**
|
|
@@ -4569,16 +4571,16 @@ const healthStatusOperationSpec$1 = {
|
|
|
4569
4571
|
httpMethod: "GET",
|
|
4570
4572
|
responses: {
|
|
4571
4573
|
200: {
|
|
4572
|
-
bodyMapper: HealthcareJobState
|
|
4574
|
+
bodyMapper: HealthcareJobState,
|
|
4573
4575
|
},
|
|
4574
4576
|
default: {
|
|
4575
|
-
bodyMapper: ErrorResponse
|
|
4576
|
-
}
|
|
4577
|
+
bodyMapper: ErrorResponse,
|
|
4578
|
+
},
|
|
4577
4579
|
},
|
|
4578
4580
|
queryParameters: [includeStatistics, top, skip],
|
|
4579
4581
|
urlParameters: [endpoint, apiVersion],
|
|
4580
4582
|
headerParameters: [accept],
|
|
4581
|
-
serializer: serializer$1
|
|
4583
|
+
serializer: serializer$1,
|
|
4582
4584
|
};
|
|
4583
4585
|
/**
|
|
4584
4586
|
* @internal
|
|
@@ -4601,14 +4603,14 @@ class HealthLro {
|
|
|
4601
4603
|
const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => this.client.health({ documents: this.documents }, paramOptions), finalOptions);
|
|
4602
4604
|
return {
|
|
4603
4605
|
flatResponse: flatResponse,
|
|
4604
|
-
rawResponse
|
|
4606
|
+
rawResponse,
|
|
4605
4607
|
};
|
|
4606
4608
|
}
|
|
4607
4609
|
catch (e) {
|
|
4608
4610
|
const exception = compileError(e);
|
|
4609
4611
|
span.setStatus({
|
|
4610
4612
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4611
|
-
message: exception.message
|
|
4613
|
+
message: exception.message,
|
|
4612
4614
|
});
|
|
4613
4615
|
throw exception;
|
|
4614
4616
|
}
|
|
@@ -4664,18 +4666,18 @@ client, documents, options) {
|
|
|
4664
4666
|
if (flatResponse.results) {
|
|
4665
4667
|
return {
|
|
4666
4668
|
page: processAndCombineSuccessfulAndErroneousDocuments(documents, flatResponse.results, makeHealthcareEntitiesResult, makeHealthcareEntitiesErrorResult),
|
|
4667
|
-
nextPageLink: flatResponse.nextLink
|
|
4669
|
+
nextPageLink: flatResponse.nextLink,
|
|
4668
4670
|
};
|
|
4669
4671
|
}
|
|
4670
4672
|
else {
|
|
4671
4673
|
throw new Error("Healthcare action has succeeded but there are no results!");
|
|
4672
4674
|
}
|
|
4673
|
-
}
|
|
4675
|
+
},
|
|
4674
4676
|
};
|
|
4675
4677
|
const pagedIterator = corePaging.getPagedAsyncIterator(pagedResult);
|
|
4676
4678
|
return Object.assign(pagedIterator, {
|
|
4677
4679
|
statistics: result.results.statistics,
|
|
4678
|
-
modelVersion: result.results.modelVersion
|
|
4680
|
+
modelVersion: result.results.modelVersion,
|
|
4679
4681
|
});
|
|
4680
4682
|
};
|
|
4681
4683
|
}
|
|
@@ -4838,7 +4840,7 @@ function parseActionError(erredActions) {
|
|
|
4838
4840
|
code: erredActions.code,
|
|
4839
4841
|
message: erredActions.message,
|
|
4840
4842
|
index: parseInt(result[2]),
|
|
4841
|
-
type: convertTaskTypeToActionType(result[1])
|
|
4843
|
+
type: convertTaskTypeToActionType(result[1]),
|
|
4842
4844
|
};
|
|
4843
4845
|
}
|
|
4844
4846
|
else {
|
|
@@ -4909,7 +4911,7 @@ function createErredAction(error, lastUpdateDateTime, taskName) {
|
|
|
4909
4911
|
return {
|
|
4910
4912
|
error: intoTextAnalyticsError(error),
|
|
4911
4913
|
failedOn: lastUpdateDateTime,
|
|
4912
|
-
actionName: taskName
|
|
4914
|
+
actionName: taskName,
|
|
4913
4915
|
};
|
|
4914
4916
|
}
|
|
4915
4917
|
/**
|
|
@@ -4931,14 +4933,14 @@ function makeActionResult(documents, makeResultsArray, succeededTasks, erredActi
|
|
|
4931
4933
|
{
|
|
4932
4934
|
results: recognizeEntitiesResults,
|
|
4933
4935
|
completedOn: lastUpdateDateTime,
|
|
4934
|
-
actionName: taskName
|
|
4935
|
-
}
|
|
4936
|
+
actionName: taskName,
|
|
4937
|
+
},
|
|
4936
4938
|
];
|
|
4937
4939
|
}
|
|
4938
4940
|
else {
|
|
4939
4941
|
return [
|
|
4940
4942
|
...actions,
|
|
4941
|
-
createErredAction(erredActions[errorIndex++], lastUpdateDateTime, taskName)
|
|
4943
|
+
createErredAction(erredActions[errorIndex++], lastUpdateDateTime, taskName),
|
|
4942
4944
|
];
|
|
4943
4945
|
}
|
|
4944
4946
|
}
|
|
@@ -4972,7 +4974,7 @@ function createAnalyzeActionsResult(response, documents) {
|
|
|
4972
4974
|
extractSummaryResults: makeActionResult(documents, makeExtractSummaryResultArray, (_g = response.tasks.extractiveSummarizationTasks) !== null && _g !== void 0 ? _g : [], extractSummarySentencesActionErrors),
|
|
4973
4975
|
recognizeCustomEntitiesResults: makeActionResult(documents, makeRecognizeCustomEntitiesResultArray, (_h = response.tasks.customEntityRecognitionTasks) !== null && _h !== void 0 ? _h : [], recognizeCustomEntitiesActionErrors),
|
|
4974
4976
|
singleCategoryClassifyResults: makeActionResult(documents, makeSingleCategoryClassifyResultArray, (_j = response.tasks.customSingleClassificationTasks) !== null && _j !== void 0 ? _j : [], singleCategoryClassifyActionErrors),
|
|
4975
|
-
multiCategoryClassifyResults: makeActionResult(documents, makeMultiCategoryClassifyResultArray, (_k = response.tasks.customMultiClassificationTasks) !== null && _k !== void 0 ? _k : [], multiCategoryClassifyActionErrors)
|
|
4977
|
+
multiCategoryClassifyResults: makeActionResult(documents, makeMultiCategoryClassifyResultArray, (_k = response.tasks.customMultiClassificationTasks) !== null && _k !== void 0 ? _k : [], multiCategoryClassifyActionErrors),
|
|
4976
4978
|
};
|
|
4977
4979
|
}
|
|
4978
4980
|
|
|
@@ -4983,16 +4985,16 @@ const analyzeStatusOperationSpec$1 = {
|
|
|
4983
4985
|
httpMethod: "GET",
|
|
4984
4986
|
responses: {
|
|
4985
4987
|
200: {
|
|
4986
|
-
bodyMapper: AnalyzeJobState
|
|
4988
|
+
bodyMapper: AnalyzeJobState,
|
|
4987
4989
|
},
|
|
4988
4990
|
default: {
|
|
4989
|
-
bodyMapper: ErrorResponse
|
|
4990
|
-
}
|
|
4991
|
+
bodyMapper: ErrorResponse,
|
|
4992
|
+
},
|
|
4991
4993
|
},
|
|
4992
4994
|
queryParameters: [includeStatistics, top, skip],
|
|
4993
4995
|
urlParameters: [endpoint, apiVersion],
|
|
4994
4996
|
headerParameters: [accept],
|
|
4995
|
-
serializer: serializer$2
|
|
4997
|
+
serializer: serializer$2,
|
|
4996
4998
|
};
|
|
4997
4999
|
/**
|
|
4998
5000
|
* @internal
|
|
@@ -5016,18 +5018,18 @@ class AnalyzeLro {
|
|
|
5016
5018
|
const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => this.client.analyze(Object.assign({ body: {
|
|
5017
5019
|
analysisInput: { documents: this.documents },
|
|
5018
5020
|
tasks: this.tasks,
|
|
5019
|
-
displayName: this.initOptions.displayName
|
|
5021
|
+
displayName: this.initOptions.displayName,
|
|
5020
5022
|
} }, paramOptions)), finalOptions);
|
|
5021
5023
|
return {
|
|
5022
5024
|
flatResponse: flatResponse,
|
|
5023
|
-
rawResponse
|
|
5025
|
+
rawResponse,
|
|
5024
5026
|
};
|
|
5025
5027
|
}
|
|
5026
5028
|
catch (e) {
|
|
5027
5029
|
const exception = compileError(e);
|
|
5028
5030
|
span.setStatus({
|
|
5029
5031
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5030
|
-
message: exception.message
|
|
5032
|
+
message: exception.message,
|
|
5031
5033
|
});
|
|
5032
5034
|
throw exception;
|
|
5033
5035
|
}
|
|
@@ -5071,9 +5073,9 @@ client, documents, options) {
|
|
|
5071
5073
|
const flatResponse = response.flatResponse;
|
|
5072
5074
|
return {
|
|
5073
5075
|
page: createAnalyzeActionsResult(flatResponse, documents),
|
|
5074
|
-
nextPageLink: flatResponse.nextLink
|
|
5076
|
+
nextPageLink: flatResponse.nextLink,
|
|
5075
5077
|
};
|
|
5076
|
-
}
|
|
5078
|
+
},
|
|
5077
5079
|
};
|
|
5078
5080
|
const pagedIterator = corePaging.getPagedAsyncIterator(pagedResult);
|
|
5079
5081
|
// Attach stats if the service starts to return them
|
|
@@ -5135,8 +5137,8 @@ class TextAnalyticsClient {
|
|
|
5135
5137
|
const internalPipelineOptions = Object.assign(Object.assign({}, pipelineOptions), {
|
|
5136
5138
|
loggingOptions: {
|
|
5137
5139
|
logger: logger.info,
|
|
5138
|
-
additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"]
|
|
5139
|
-
}
|
|
5140
|
+
additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"],
|
|
5141
|
+
},
|
|
5140
5142
|
});
|
|
5141
5143
|
this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions);
|
|
5142
5144
|
const authPolicy = coreAuth.isTokenCredential(credential)
|
|
@@ -5163,14 +5165,14 @@ class TextAnalyticsClient {
|
|
|
5163
5165
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-detectLanguages", makeGeneratedDetectLanguageOptions(realOptions));
|
|
5164
5166
|
try {
|
|
5165
5167
|
const result = await this.client.languages({
|
|
5166
|
-
documents: realInputs
|
|
5168
|
+
documents: realInputs,
|
|
5167
5169
|
}, finalOptions);
|
|
5168
5170
|
return makeDetectLanguageResultArray(realInputs, result);
|
|
5169
5171
|
}
|
|
5170
5172
|
catch (e) {
|
|
5171
5173
|
span.setStatus({
|
|
5172
5174
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5173
|
-
message: e.message
|
|
5175
|
+
message: e.message,
|
|
5174
5176
|
});
|
|
5175
5177
|
throw e;
|
|
5176
5178
|
}
|
|
@@ -5198,7 +5200,7 @@ class TextAnalyticsClient {
|
|
|
5198
5200
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeEntities", makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions));
|
|
5199
5201
|
try {
|
|
5200
5202
|
const result = await this.client.entitiesRecognitionGeneral({
|
|
5201
|
-
documents: realInputs
|
|
5203
|
+
documents: realInputs,
|
|
5202
5204
|
}, finalOptions);
|
|
5203
5205
|
return makeRecognizeCategorizedEntitiesResultArray(realInputs, result);
|
|
5204
5206
|
}
|
|
@@ -5214,7 +5216,7 @@ class TextAnalyticsClient {
|
|
|
5214
5216
|
const backwardCompatibleException = compileError(e);
|
|
5215
5217
|
span.setStatus({
|
|
5216
5218
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5217
|
-
message: backwardCompatibleException.message
|
|
5219
|
+
message: backwardCompatibleException.message,
|
|
5218
5220
|
});
|
|
5219
5221
|
throw backwardCompatibleException;
|
|
5220
5222
|
}
|
|
@@ -5240,14 +5242,14 @@ class TextAnalyticsClient {
|
|
|
5240
5242
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-analyzeSentiment", makeGeneratedAnalyzeSentimentOptions(realOptions));
|
|
5241
5243
|
try {
|
|
5242
5244
|
const result = await this.client.sentiment({
|
|
5243
|
-
documents: realInputs
|
|
5245
|
+
documents: realInputs,
|
|
5244
5246
|
}, finalOptions);
|
|
5245
5247
|
return makeAnalyzeSentimentResultArray(realInputs, result);
|
|
5246
5248
|
}
|
|
5247
5249
|
catch (e) {
|
|
5248
5250
|
span.setStatus({
|
|
5249
5251
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5250
|
-
message: e.message
|
|
5252
|
+
message: e.message,
|
|
5251
5253
|
});
|
|
5252
5254
|
throw e;
|
|
5253
5255
|
}
|
|
@@ -5273,14 +5275,14 @@ class TextAnalyticsClient {
|
|
|
5273
5275
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-extractKeyPhrases", makeGeneratedExtractKeyPhrasesOptions(realOptions));
|
|
5274
5276
|
try {
|
|
5275
5277
|
const result = await this.client.keyPhrases({
|
|
5276
|
-
documents: realInputs
|
|
5278
|
+
documents: realInputs,
|
|
5277
5279
|
}, finalOptions);
|
|
5278
5280
|
return makeExtractKeyPhrasesResultArray(realInputs, result);
|
|
5279
5281
|
}
|
|
5280
5282
|
catch (e) {
|
|
5281
5283
|
span.setStatus({
|
|
5282
5284
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5283
|
-
message: e.message
|
|
5285
|
+
message: e.message,
|
|
5284
5286
|
});
|
|
5285
5287
|
throw e;
|
|
5286
5288
|
}
|
|
@@ -5303,14 +5305,14 @@ class TextAnalyticsClient {
|
|
|
5303
5305
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizePiiEntities", makeGeneratedRecognizePiiEntitiesOptions(realOptions));
|
|
5304
5306
|
try {
|
|
5305
5307
|
const result = await this.client.entitiesRecognitionPii({
|
|
5306
|
-
documents: realInputs
|
|
5308
|
+
documents: realInputs,
|
|
5307
5309
|
}, finalOptions);
|
|
5308
5310
|
return makeRecognizePiiEntitiesResultArray(realInputs, result);
|
|
5309
5311
|
}
|
|
5310
5312
|
catch (e) {
|
|
5311
5313
|
span.setStatus({
|
|
5312
5314
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5313
|
-
message: e.message
|
|
5315
|
+
message: e.message,
|
|
5314
5316
|
});
|
|
5315
5317
|
throw e;
|
|
5316
5318
|
}
|
|
@@ -5336,14 +5338,14 @@ class TextAnalyticsClient {
|
|
|
5336
5338
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeLinkedEntities", makeGeneratedRecognizeLinkingEntitiesOptions(realOptions));
|
|
5337
5339
|
try {
|
|
5338
5340
|
const result = await this.client.entitiesLinking({
|
|
5339
|
-
documents: realInputs
|
|
5341
|
+
documents: realInputs,
|
|
5340
5342
|
}, finalOptions);
|
|
5341
5343
|
return makeRecognizeLinkedEntitiesResultArray(realInputs, result);
|
|
5342
5344
|
}
|
|
5343
5345
|
catch (e) {
|
|
5344
5346
|
span.setStatus({
|
|
5345
5347
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5346
|
-
message: e.message
|
|
5348
|
+
message: e.message,
|
|
5347
5349
|
});
|
|
5348
5350
|
throw e;
|
|
5349
5351
|
}
|
|
@@ -5363,13 +5365,13 @@ class TextAnalyticsClient {
|
|
|
5363
5365
|
realInputs = documents;
|
|
5364
5366
|
realOptions = languageOrOptions || {};
|
|
5365
5367
|
}
|
|
5366
|
-
const { updateIntervalInMs, resumeFrom, onResponse, disableServiceLogs, modelVersion, requestOptions, serializerOptions, abortSignal, stringIndexType, includeStatistics, tracingOptions } = realOptions;
|
|
5368
|
+
const { updateIntervalInMs, resumeFrom, onResponse, disableServiceLogs, modelVersion, requestOptions, serializerOptions, abortSignal, stringIndexType, includeStatistics, tracingOptions, } = realOptions;
|
|
5367
5369
|
const lro = new HealthLro(this.client, {
|
|
5368
5370
|
onResponse,
|
|
5369
5371
|
requestOptions,
|
|
5370
5372
|
serializerOptions,
|
|
5371
5373
|
abortSignal,
|
|
5372
|
-
tracingOptions
|
|
5374
|
+
tracingOptions,
|
|
5373
5375
|
}, { loggingOptOut: disableServiceLogs, stringIndexType, modelVersion }, { includeStatistics }, realInputs);
|
|
5374
5376
|
const poller = new coreLro.LroEngine(lro, {
|
|
5375
5377
|
intervalInMs: updateIntervalInMs,
|
|
@@ -5380,10 +5382,10 @@ class TextAnalyticsClient {
|
|
|
5380
5382
|
serializerOptions,
|
|
5381
5383
|
abortSignal,
|
|
5382
5384
|
tracingOptions,
|
|
5383
|
-
includeStatistics
|
|
5385
|
+
includeStatistics,
|
|
5384
5386
|
}),
|
|
5385
5387
|
isDone: isHealthDone,
|
|
5386
|
-
updateState: updateHealthState
|
|
5388
|
+
updateState: updateHealthState,
|
|
5387
5389
|
});
|
|
5388
5390
|
await poller.poll();
|
|
5389
5391
|
return poller;
|
|
@@ -5404,13 +5406,13 @@ class TextAnalyticsClient {
|
|
|
5404
5406
|
realOptions = languageOrOptions || {};
|
|
5405
5407
|
}
|
|
5406
5408
|
const compiledActions = compileAnalyzeInput(actions);
|
|
5407
|
-
const { updateIntervalInMs, resumeFrom, displayName, includeStatistics, onResponse, requestOptions, serializerOptions, abortSignal, tracingOptions } = realOptions;
|
|
5409
|
+
const { updateIntervalInMs, resumeFrom, displayName, includeStatistics, onResponse, requestOptions, serializerOptions, abortSignal, tracingOptions, } = realOptions;
|
|
5408
5410
|
const lro = new AnalyzeLro(this.client, {
|
|
5409
5411
|
onResponse,
|
|
5410
5412
|
requestOptions,
|
|
5411
5413
|
serializerOptions,
|
|
5412
5414
|
abortSignal,
|
|
5413
|
-
tracingOptions
|
|
5415
|
+
tracingOptions,
|
|
5414
5416
|
}, { displayName }, { includeStatistics }, realInputs, compiledActions);
|
|
5415
5417
|
const poller = new coreLro.LroEngine(lro, {
|
|
5416
5418
|
intervalInMs: updateIntervalInMs,
|
|
@@ -5421,10 +5423,10 @@ class TextAnalyticsClient {
|
|
|
5421
5423
|
serializerOptions,
|
|
5422
5424
|
abortSignal,
|
|
5423
5425
|
tracingOptions,
|
|
5424
|
-
includeStatistics
|
|
5426
|
+
includeStatistics,
|
|
5425
5427
|
}),
|
|
5426
5428
|
isDone: isAnalyzeDone,
|
|
5427
|
-
updateState: updateAnalyzeState
|
|
5429
|
+
updateState: updateAnalyzeState,
|
|
5428
5430
|
});
|
|
5429
5431
|
await poller.poll();
|
|
5430
5432
|
return poller;
|
|
@@ -5444,7 +5446,7 @@ function compileAnalyzeInput(actions) {
|
|
|
5444
5446
|
extractiveSummarizationTasks: (_f = actions.extractSummaryActions) === null || _f === void 0 ? void 0 : _f.map(compose(setStrEncodingParam, compose(setSentenceCount, compose(setOrderBy, addParamsToTask)))),
|
|
5445
5447
|
customEntityRecognitionTasks: (_g = actions.recognizeCustomEntitiesActions) === null || _g === void 0 ? void 0 : _g.map(compose(setStrEncodingParam, addParamsToTask)),
|
|
5446
5448
|
customSingleClassificationTasks: (_h = actions.singleCategoryClassifyActions) === null || _h === void 0 ? void 0 : _h.map(addParamsToTask),
|
|
5447
|
-
customMultiClassificationTasks: (_j = actions.multiCategoryClassifyActions) === null || _j === void 0 ? void 0 : _j.map(addParamsToTask)
|
|
5449
|
+
customMultiClassificationTasks: (_j = actions.multiCategoryClassifyActions) === null || _j === void 0 ? void 0 : _j.map(addParamsToTask),
|
|
5448
5450
|
};
|
|
5449
5451
|
}
|
|
5450
5452
|
function isStringArray(documents) {
|
|
@@ -5461,7 +5463,7 @@ function convertToDetectLanguageInput(inputs, countryHint) {
|
|
|
5461
5463
|
return {
|
|
5462
5464
|
id: String(index),
|
|
5463
5465
|
countryHint,
|
|
5464
|
-
text
|
|
5466
|
+
text,
|
|
5465
5467
|
};
|
|
5466
5468
|
});
|
|
5467
5469
|
}
|
|
@@ -5473,7 +5475,7 @@ function convertToTextDocumentInput(inputs, language) {
|
|
|
5473
5475
|
return {
|
|
5474
5476
|
id: String(index),
|
|
5475
5477
|
language,
|
|
5476
|
-
text
|
|
5478
|
+
text,
|
|
5477
5479
|
};
|
|
5478
5480
|
});
|
|
5479
5481
|
}
|
|
@@ -5493,7 +5495,7 @@ function makeGeneratedAnalyzeSentimentOptions(params) {
|
|
|
5493
5495
|
tracingOptions: params.tracingOptions,
|
|
5494
5496
|
onResponse: params.onResponse,
|
|
5495
5497
|
serializerOptions: params.serializerOptions,
|
|
5496
|
-
loggingOptOut: params.disableServiceLogs
|
|
5498
|
+
loggingOptOut: params.disableServiceLogs,
|
|
5497
5499
|
};
|
|
5498
5500
|
}
|
|
5499
5501
|
/**
|
|
@@ -5513,7 +5515,7 @@ function makeGeneratedRecognizePiiEntitiesOptions(params) {
|
|
|
5513
5515
|
piiCategories: params.categoriesFilter,
|
|
5514
5516
|
onResponse: params.onResponse,
|
|
5515
5517
|
serializerOptions: params.serializerOptions,
|
|
5516
|
-
loggingOptOut: params.disableServiceLogs
|
|
5518
|
+
loggingOptOut: params.disableServiceLogs,
|
|
5517
5519
|
};
|
|
5518
5520
|
}
|
|
5519
5521
|
/**
|
|
@@ -5531,7 +5533,7 @@ function makeGeneratedRecognizeCategorizedEntitiesOptions(params) {
|
|
|
5531
5533
|
tracingOptions: params.tracingOptions,
|
|
5532
5534
|
onResponse: params.onResponse,
|
|
5533
5535
|
serializerOptions: params.serializerOptions,
|
|
5534
|
-
loggingOptOut: params.disableServiceLogs
|
|
5536
|
+
loggingOptOut: params.disableServiceLogs,
|
|
5535
5537
|
};
|
|
5536
5538
|
}
|
|
5537
5539
|
/**
|
|
@@ -5548,7 +5550,7 @@ function makeGeneratedDetectLanguageOptions(params) {
|
|
|
5548
5550
|
tracingOptions: params.tracingOptions,
|
|
5549
5551
|
onResponse: params.onResponse,
|
|
5550
5552
|
serializerOptions: params.serializerOptions,
|
|
5551
|
-
loggingOptOut: params.disableServiceLogs
|
|
5553
|
+
loggingOptOut: params.disableServiceLogs,
|
|
5552
5554
|
};
|
|
5553
5555
|
}
|
|
5554
5556
|
/**
|
|
@@ -5565,7 +5567,7 @@ function makeGeneratedExtractKeyPhrasesOptions(params) {
|
|
|
5565
5567
|
tracingOptions: params.tracingOptions,
|
|
5566
5568
|
onResponse: params.onResponse,
|
|
5567
5569
|
serializerOptions: params.serializerOptions,
|
|
5568
|
-
loggingOptOut: params.disableServiceLogs
|
|
5570
|
+
loggingOptOut: params.disableServiceLogs,
|
|
5569
5571
|
};
|
|
5570
5572
|
}
|
|
5571
5573
|
/**
|
|
@@ -5583,7 +5585,7 @@ function makeGeneratedRecognizeLinkingEntitiesOptions(params) {
|
|
|
5583
5585
|
onResponse: params.onResponse,
|
|
5584
5586
|
serializerOptions: params.serializerOptions,
|
|
5585
5587
|
loggingOptOut: params.disableServiceLogs,
|
|
5586
|
-
stringIndexType: setStrEncodingParamValue(params.stringIndexType)
|
|
5588
|
+
stringIndexType: setStrEncodingParamValue(params.stringIndexType),
|
|
5587
5589
|
};
|
|
5588
5590
|
}
|
|
5589
5591
|
|