@azure/ai-language-text 1.1.0-alpha.20221104.3 → 1.1.0-alpha.20221116.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.
package/dist/index.js CHANGED
@@ -1158,10 +1158,10 @@ const HealthcareRelationEntity = {
1158
1158
  }
1159
1159
  }
1160
1160
  };
1161
- const DocumentDetectedLanguageForHealthcare = {
1161
+ const DocumentDetectedLanguageString = {
1162
1162
  type: {
1163
1163
  name: "Composite",
1164
- className: "DocumentDetectedLanguageForHealthcare",
1164
+ className: "DocumentDetectedLanguageString",
1165
1165
  modelProperties: {
1166
1166
  detectedLanguage: {
1167
1167
  serializedName: "detectedLanguage",
@@ -1576,6 +1576,21 @@ const Match = {
1576
1576
  }
1577
1577
  }
1578
1578
  };
1579
+ const QuantityResolution = {
1580
+ type: {
1581
+ name: "Composite",
1582
+ className: "QuantityResolution",
1583
+ modelProperties: {
1584
+ value: {
1585
+ serializedName: "value",
1586
+ required: true,
1587
+ type: {
1588
+ name: "Number"
1589
+ }
1590
+ }
1591
+ }
1592
+ }
1593
+ };
1579
1594
  const SummarySentence = {
1580
1595
  type: {
1581
1596
  name: "Composite",
@@ -1717,21 +1732,6 @@ const SummaryContext = {
1717
1732
  }
1718
1733
  }
1719
1734
  };
1720
- const QuantityResolution = {
1721
- type: {
1722
- name: "Composite",
1723
- className: "QuantityResolution",
1724
- modelProperties: {
1725
- value: {
1726
- serializedName: "value",
1727
- required: true,
1728
- type: {
1729
- name: "Number"
1730
- }
1731
- }
1732
- }
1733
- }
1734
- };
1735
1735
  const AnalyzeTextEntityLinkingInput = {
1736
1736
  serializedName: "EntityLinking",
1737
1737
  type: {
@@ -2275,7 +2275,7 @@ const CurrencyResolution = {
2275
2275
  uberParent: "BaseResolution",
2276
2276
  polymorphicDiscriminator: BaseResolution.type.polymorphicDiscriminator,
2277
2277
  modelProperties: Object.assign(Object.assign(Object.assign({}, BaseResolution.type.modelProperties), QuantityResolution.type.modelProperties), { iso4217: {
2278
- serializedName: "ISO4217",
2278
+ serializedName: "iso4217",
2279
2279
  type: {
2280
2280
  name: "String"
2281
2281
  }
@@ -2354,7 +2354,7 @@ const NumberResolution = {
2354
2354
  serializedName: "value",
2355
2355
  required: true,
2356
2356
  type: {
2357
- name: "String"
2357
+ name: "Number"
2358
2358
  }
2359
2359
  } })
2360
2360
  }
@@ -2491,7 +2491,7 @@ const ClassificationDocumentResult = {
2491
2491
  type: {
2492
2492
  name: "Composite",
2493
2493
  className: "ClassificationDocumentResult",
2494
- modelProperties: Object.assign(Object.assign({}, DocumentResult.type.modelProperties), { class: {
2494
+ modelProperties: Object.assign(Object.assign({}, DocumentResult.type.modelProperties), { classifications: {
2495
2495
  serializedName: "class",
2496
2496
  required: true,
2497
2497
  type: {
@@ -2709,24 +2709,24 @@ const SentimentResponseDocumentsItem = {
2709
2709
  modelProperties: Object.assign(Object.assign({}, SentimentDocumentResult.type.modelProperties), DocumentDetectedLanguage.type.modelProperties)
2710
2710
  }
2711
2711
  };
2712
- const EntitiesResultDocumentsItem = {
2712
+ const EntitiesResultWithDetectedLanguage = {
2713
2713
  type: {
2714
2714
  name: "Composite",
2715
- className: "EntitiesResultDocumentsItem",
2715
+ className: "EntitiesResultWithDetectedLanguage",
2716
2716
  modelProperties: Object.assign(Object.assign({}, EntitiesDocumentResult.type.modelProperties), DocumentDetectedLanguage.type.modelProperties)
2717
2717
  }
2718
2718
  };
2719
- const EntityLinkingResultDocumentsItem = {
2719
+ const EntityLinkingResultWithDetectedLanguage = {
2720
2720
  type: {
2721
2721
  name: "Composite",
2722
- className: "EntityLinkingResultDocumentsItem",
2722
+ className: "EntityLinkingResultWithDetectedLanguage",
2723
2723
  modelProperties: Object.assign(Object.assign({}, LinkedEntitiesDocumentResult.type.modelProperties), DocumentDetectedLanguage.type.modelProperties)
2724
2724
  }
2725
2725
  };
2726
- const PiiResultDocumentsItem = {
2726
+ const PIIResultWithDetectedLanguage = {
2727
2727
  type: {
2728
2728
  name: "Composite",
2729
- className: "PiiResultDocumentsItem",
2729
+ className: "PIIResultWithDetectedLanguage",
2730
2730
  modelProperties: Object.assign(Object.assign({}, PiiEntitiesDocumentResult.type.modelProperties), DocumentDetectedLanguage.type.modelProperties)
2731
2731
  }
2732
2732
  };
@@ -2751,11 +2751,11 @@ const AbstractiveSummaryDocumentResultWithDetectedLanguage = {
2751
2751
  modelProperties: Object.assign(Object.assign({}, AbstractiveSummaryDocumentResult.type.modelProperties), DocumentDetectedLanguage.type.modelProperties)
2752
2752
  }
2753
2753
  };
2754
- const HealthcareResultDocumentsItem = {
2754
+ const HealthcareEntitiesDocumentResultWithDocumentDetectedLanguage = {
2755
2755
  type: {
2756
2756
  name: "Composite",
2757
- className: "HealthcareResultDocumentsItem",
2758
- modelProperties: Object.assign(Object.assign({}, HealthcareEntitiesDocumentResult.type.modelProperties), DocumentDetectedLanguageForHealthcare.type.modelProperties)
2757
+ className: "HealthcareEntitiesDocumentResultWithDocumentDetectedLanguage",
2758
+ modelProperties: Object.assign(Object.assign({}, HealthcareEntitiesDocumentResult.type.modelProperties), DocumentDetectedLanguageString.type.modelProperties)
2759
2759
  }
2760
2760
  };
2761
2761
  const HealthcareResult = {
@@ -2770,7 +2770,7 @@ const HealthcareResult = {
2770
2770
  element: {
2771
2771
  type: {
2772
2772
  name: "Composite",
2773
- className: "HealthcareResultDocumentsItem"
2773
+ className: "HealthcareEntitiesDocumentResultWithDocumentDetectedLanguage"
2774
2774
  }
2775
2775
  }
2776
2776
  }
@@ -2808,7 +2808,7 @@ const EntitiesResult = {
2808
2808
  element: {
2809
2809
  type: {
2810
2810
  name: "Composite",
2811
- className: "EntitiesResultDocumentsItem"
2811
+ className: "EntitiesResultWithDetectedLanguage"
2812
2812
  }
2813
2813
  }
2814
2814
  }
@@ -2827,7 +2827,7 @@ const EntityLinkingResult = {
2827
2827
  element: {
2828
2828
  type: {
2829
2829
  name: "Composite",
2830
- className: "EntityLinkingResultDocumentsItem"
2830
+ className: "EntityLinkingResultWithDetectedLanguage"
2831
2831
  }
2832
2832
  }
2833
2833
  }
@@ -2846,7 +2846,7 @@ const PiiResult = {
2846
2846
  element: {
2847
2847
  type: {
2848
2848
  name: "Composite",
2849
- className: "PiiResultDocumentsItem"
2849
+ className: "PIIResultWithDetectedLanguage"
2850
2850
  }
2851
2851
  }
2852
2852
  }
@@ -3614,7 +3614,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
3614
3614
  EntityDataSource: EntityDataSource,
3615
3615
  HealthcareRelation: HealthcareRelation,
3616
3616
  HealthcareRelationEntity: HealthcareRelationEntity,
3617
- DocumentDetectedLanguageForHealthcare: DocumentDetectedLanguageForHealthcare,
3617
+ DocumentDetectedLanguageString: DocumentDetectedLanguageString,
3618
3618
  PreBuiltResult: PreBuiltResult,
3619
3619
  InputError: InputError,
3620
3620
  SentimentConfidenceScores: SentimentConfidenceScores,
@@ -3625,13 +3625,13 @@ var Mappers = /*#__PURE__*/Object.freeze({
3625
3625
  AssessmentSentiment: AssessmentSentiment,
3626
3626
  LinkedEntity: LinkedEntity,
3627
3627
  Match: Match,
3628
+ QuantityResolution: QuantityResolution,
3628
3629
  SummarySentence: SummarySentence,
3629
3630
  Pagination: Pagination,
3630
3631
  AbstractiveSummarizationTaskParametersBase: AbstractiveSummarizationTaskParametersBase,
3631
3632
  AbstractiveSummarizationResultBase: AbstractiveSummarizationResultBase,
3632
3633
  AbstractiveSummary: AbstractiveSummary,
3633
3634
  SummaryContext: SummaryContext,
3634
- QuantityResolution: QuantityResolution,
3635
3635
  AnalyzeTextEntityLinkingInput: AnalyzeTextEntityLinkingInput,
3636
3636
  AnalyzeTextEntityRecognitionInput: AnalyzeTextEntityRecognitionInput,
3637
3637
  AnalyzeTextKeyPhraseExtractionInput: AnalyzeTextKeyPhraseExtractionInput,
@@ -3683,13 +3683,13 @@ var Mappers = /*#__PURE__*/Object.freeze({
3683
3683
  CustomEntitiesResultDocumentsItem: CustomEntitiesResultDocumentsItem,
3684
3684
  CustomLabelClassificationResultDocumentsItem: CustomLabelClassificationResultDocumentsItem,
3685
3685
  SentimentResponseDocumentsItem: SentimentResponseDocumentsItem,
3686
- EntitiesResultDocumentsItem: EntitiesResultDocumentsItem,
3687
- EntityLinkingResultDocumentsItem: EntityLinkingResultDocumentsItem,
3688
- PiiResultDocumentsItem: PiiResultDocumentsItem,
3686
+ EntitiesResultWithDetectedLanguage: EntitiesResultWithDetectedLanguage,
3687
+ EntityLinkingResultWithDetectedLanguage: EntityLinkingResultWithDetectedLanguage,
3688
+ PIIResultWithDetectedLanguage: PIIResultWithDetectedLanguage,
3689
3689
  ExtractedSummaryDocumentResultWithDetectedLanguage: ExtractedSummaryDocumentResultWithDetectedLanguage,
3690
3690
  KeyPhraseResultDocumentsItem: KeyPhraseResultDocumentsItem,
3691
3691
  AbstractiveSummaryDocumentResultWithDetectedLanguage: AbstractiveSummaryDocumentResultWithDetectedLanguage,
3692
- HealthcareResultDocumentsItem: HealthcareResultDocumentsItem,
3692
+ HealthcareEntitiesDocumentResultWithDocumentDetectedLanguage: HealthcareEntitiesDocumentResultWithDocumentDetectedLanguage,
3693
3693
  HealthcareResult: HealthcareResult,
3694
3694
  SentimentResponse: SentimentResponse,
3695
3695
  EntitiesResult: EntitiesResult,
@@ -3891,11 +3891,7 @@ function toSentimentAnalysisResult(docIds, results) {
3891
3891
  });
3892
3892
  }
3893
3893
  function toDynamicClassificationResult(docIds, results) {
3894
- return transformDocumentResults(docIds, results, {
3895
- // FIXME: Fixing a service bug, see https://github.com/Azure/azure-sdk-for-js/issues/23617
3896
- processSuccess: ({ class: classes, id, warnings, statistics, classifications, }) => (Object.assign({ id,
3897
- warnings, classifications: classes ? classes : classifications !== null && classifications !== void 0 ? classifications : [] }, (statistics ? { statistics } : {}))),
3898
- });
3894
+ return transformDocumentResults(docIds, results);
3899
3895
  }
3900
3896
  /**
3901
3897
  * Converts a sentence sentiment object returned by the service to another that
@@ -4034,18 +4030,6 @@ async function throwError(p) {
4034
4030
  throw transformError(e);
4035
4031
  }
4036
4032
  }
4037
- function deserializeDetectedLanguage(input) {
4038
- function helper(str) {
4039
- try {
4040
- return JSON.parse(str);
4041
- }
4042
- catch (e) {
4043
- return undefined;
4044
- }
4045
- }
4046
- const obj = helper(input);
4047
- return obj !== undefined ? obj : { iso6391Name: input };
4048
- }
4049
4033
  function toHealthcareResult(docIds, results) {
4050
4034
  function makeHealthcareEntity(entity) {
4051
4035
  const { dataSources } = entity, rest = tslib.__rest(entity, ["dataSources"]);
@@ -4065,17 +4049,7 @@ function toHealthcareResult(docIds, results) {
4065
4049
  processSuccess: (_a) => {
4066
4050
  var { entities, relations, detectedLanguage } = _a, rest = tslib.__rest(_a, ["entities", "relations", "detectedLanguage"]);
4067
4051
  const newEntities = entities.map(makeHealthcareEntity);
4068
- return Object.assign(Object.assign({ entities: newEntities, entityRelations: relations.map(makeHealthcareRelation(newEntities)) }, (detectedLanguage
4069
- ? { detectedLanguage: deserializeDetectedLanguage(detectedLanguage) }
4070
- : {})), rest);
4071
- },
4072
- });
4073
- }
4074
- function toCustomSingleLabelClassificationResult(docIds, results) {
4075
- return transformDocumentResults(docIds, results, {
4076
- processSuccess: (_a) => {
4077
- var { class: classification } = _a, rest = tslib.__rest(_a, ["class"]);
4078
- return Object.assign({ classifications: classification }, rest);
4052
+ return Object.assign(Object.assign({ entities: newEntities, entityRelations: relations.map(makeHealthcareRelation(newEntities)) }, (detectedLanguage ? { detectedLanguage: { iso6391Name: detectedLanguage } } : {})), rest);
4079
4053
  },
4080
4054
  });
4081
4055
  }
@@ -4125,13 +4099,13 @@ function transformAnalyzeBatchResults(docIds, response = []) {
4125
4099
  case "CustomSingleLabelClassificationLROResults": {
4126
4100
  const { results } = actionData;
4127
4101
  const { deploymentName, projectName, statistics } = results;
4128
- return Object.assign(Object.assign(Object.assign({ kind: "CustomSingleLabelClassification", results: toCustomSingleLabelClassificationResult(docIds, results), completedOn }, (actionName ? { actionName } : {})), (statistics ? { statistics } : {})), { deploymentName,
4102
+ return Object.assign(Object.assign(Object.assign({ kind: "CustomSingleLabelClassification", results: transformDocumentResults(docIds, results), completedOn }, (actionName ? { actionName } : {})), (statistics ? { statistics } : {})), { deploymentName,
4129
4103
  projectName });
4130
4104
  }
4131
4105
  case "CustomMultiLabelClassificationLROResults": {
4132
4106
  const { results } = actionData;
4133
4107
  const { deploymentName, projectName, statistics } = results;
4134
- return Object.assign(Object.assign(Object.assign({ kind: "CustomMultiLabelClassification", results: toCustomSingleLabelClassificationResult(docIds, results), completedOn }, (actionName ? { actionName } : {})), (statistics ? { statistics } : {})), { deploymentName,
4108
+ return Object.assign(Object.assign(Object.assign({ kind: "CustomMultiLabelClassification", results: transformDocumentResults(docIds, results), completedOn }, (actionName ? { actionName } : {})), (statistics ? { statistics } : {})), { deploymentName,
4135
4109
  projectName });
4136
4110
  }
4137
4111
  case "ExtractiveSummarizationLROResults": {
@@ -4292,10 +4266,11 @@ function processAnalyzeResult(options) {
4292
4266
  */
4293
4267
  function createUpdateAnalyzeState(docIds) {
4294
4268
  return (state, lastResponse) => {
4295
- const { createdOn, modifiedOn, id, displayName, expiresOn, tasks } = lastResponse.flatResponse;
4269
+ const { createdOn, modifiedOn, id, displayName, expiresOn, tasks, lastUpdateDateTime } = lastResponse.flatResponse;
4296
4270
  const mutableState = state;
4297
4271
  mutableState.createdOn = createdOn;
4298
- mutableState.modifiedOn = modifiedOn;
4272
+ // FIXME: remove this mitigation when the service API is fixed
4273
+ mutableState.modifiedOn = modifiedOn ? modifiedOn : new Date(lastUpdateDateTime);
4299
4274
  mutableState.expiresOn = expiresOn;
4300
4275
  mutableState.displayName = displayName;
4301
4276
  mutableState.id = id;
@@ -5488,14 +5463,6 @@ exports.KnownRelationType = void 0;
5488
5463
  /** ValueOfExamination */
5489
5464
  KnownRelationType["ValueOfExamination"] = "ValueOfExamination";
5490
5465
  })(exports.KnownRelationType || (exports.KnownRelationType = {}));
5491
- /** Known values of {@link ExtractiveSummarizationOrderingCriteria} that the service accepts. */
5492
- exports.KnownExtractiveSummarizationOrderingCriteria = void 0;
5493
- (function (KnownExtractiveSummarizationOrderingCriteria) {
5494
- /** Indicates that results should be sorted in order of appearance in the text. */
5495
- KnownExtractiveSummarizationOrderingCriteria["Offset"] = "Offset";
5496
- /** Indicates that results should be sorted in order of importance (i.e. rank score) according to the model. */
5497
- KnownExtractiveSummarizationOrderingCriteria["Rank"] = "Rank";
5498
- })(exports.KnownExtractiveSummarizationOrderingCriteria || (exports.KnownExtractiveSummarizationOrderingCriteria = {}));
5499
5466
  /** Known values of {@link AgeUnit} that the service accepts. */
5500
5467
  exports.KnownAgeUnit = void 0;
5501
5468
  (function (KnownAgeUnit) {
@@ -5575,32 +5542,32 @@ exports.KnownSpeedUnit = void 0;
5575
5542
  (function (KnownSpeedUnit) {
5576
5543
  /** Unspecified */
5577
5544
  KnownSpeedUnit["Unspecified"] = "Unspecified";
5578
- /** MetersPerSecond */
5579
- KnownSpeedUnit["MetersPerSecond"] = "MetersPerSecond";
5580
- /** KilometersPerHour */
5581
- KnownSpeedUnit["KilometersPerHour"] = "KilometersPerHour";
5582
- /** KilometersPerMinute */
5583
- KnownSpeedUnit["KilometersPerMinute"] = "KilometersPerMinute";
5584
- /** KilometersPerSecond */
5585
- KnownSpeedUnit["KilometersPerSecond"] = "KilometersPerSecond";
5586
- /** MilesPerHour */
5587
- KnownSpeedUnit["MilesPerHour"] = "MilesPerHour";
5545
+ /** MeterPerSecond */
5546
+ KnownSpeedUnit["MeterPerSecond"] = "MeterPerSecond";
5547
+ /** KilometerPerHour */
5548
+ KnownSpeedUnit["KilometerPerHour"] = "KilometerPerHour";
5549
+ /** KilometerPerMinute */
5550
+ KnownSpeedUnit["KilometerPerMinute"] = "KilometerPerMinute";
5551
+ /** KilometerPerSecond */
5552
+ KnownSpeedUnit["KilometerPerSecond"] = "KilometerPerSecond";
5553
+ /** MilePerHour */
5554
+ KnownSpeedUnit["MilePerHour"] = "MilePerHour";
5588
5555
  /** Knot */
5589
5556
  KnownSpeedUnit["Knot"] = "Knot";
5590
5557
  /** FootPerSecond */
5591
5558
  KnownSpeedUnit["FootPerSecond"] = "FootPerSecond";
5592
5559
  /** FootPerMinute */
5593
5560
  KnownSpeedUnit["FootPerMinute"] = "FootPerMinute";
5594
- /** YardsPerMinute */
5595
- KnownSpeedUnit["YardsPerMinute"] = "YardsPerMinute";
5596
- /** YardsPerSecond */
5597
- KnownSpeedUnit["YardsPerSecond"] = "YardsPerSecond";
5598
- /** MetersPerMillisecond */
5599
- KnownSpeedUnit["MetersPerMillisecond"] = "MetersPerMillisecond";
5600
- /** CentimetersPerMillisecond */
5601
- KnownSpeedUnit["CentimetersPerMillisecond"] = "CentimetersPerMillisecond";
5602
- /** KilometersPerMillisecond */
5603
- KnownSpeedUnit["KilometersPerMillisecond"] = "KilometersPerMillisecond";
5561
+ /** YardPerMinute */
5562
+ KnownSpeedUnit["YardPerMinute"] = "YardPerMinute";
5563
+ /** YardPerSecond */
5564
+ KnownSpeedUnit["YardPerSecond"] = "YardPerSecond";
5565
+ /** MeterPerMillisecond */
5566
+ KnownSpeedUnit["MeterPerMillisecond"] = "MeterPerMillisecond";
5567
+ /** CentimeterPerMillisecond */
5568
+ KnownSpeedUnit["CentimeterPerMillisecond"] = "CentimeterPerMillisecond";
5569
+ /** KilometerPerMillisecond */
5570
+ KnownSpeedUnit["KilometerPerMillisecond"] = "KilometerPerMillisecond";
5604
5571
  })(exports.KnownSpeedUnit || (exports.KnownSpeedUnit = {}));
5605
5572
  /** Known values of {@link AreaUnit} that the service accepts. */
5606
5573
  exports.KnownAreaUnit = void 0;
@@ -5854,6 +5821,14 @@ exports.KnownRangeKind = void 0;
5854
5821
  /** Currency */
5855
5822
  KnownRangeKind["Currency"] = "Currency";
5856
5823
  })(exports.KnownRangeKind || (exports.KnownRangeKind = {}));
5824
+ /** Known values of {@link ExtractiveSummarizationOrderingCriteria} that the service accepts. */
5825
+ exports.KnownExtractiveSummarizationOrderingCriteria = void 0;
5826
+ (function (KnownExtractiveSummarizationOrderingCriteria) {
5827
+ /** Indicates that results should be sorted in order of appearance in the text. */
5828
+ KnownExtractiveSummarizationOrderingCriteria["Offset"] = "Offset";
5829
+ /** Indicates that results should be sorted in order of importance (i.e. rank score) according to the model. */
5830
+ KnownExtractiveSummarizationOrderingCriteria["Rank"] = "Rank";
5831
+ })(exports.KnownExtractiveSummarizationOrderingCriteria || (exports.KnownExtractiveSummarizationOrderingCriteria = {}));
5857
5832
 
5858
5833
  // Copyright (c) Microsoft Corporation.
5859
5834
  /**