@azure/ai-language-text 1.0.0-beta.1 → 1.0.0

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.
@@ -12,9 +12,9 @@ import { AzureKeyCredential } from '@azure/core-auth';
12
12
  import { CommonClientOptions } from '@azure/core-client';
13
13
  import { KeyCredential } from '@azure/core-auth';
14
14
  import { OperationOptions } from '@azure/core-client';
15
+ import { OperationState } from '@azure/core-lro';
15
16
  import { PagedAsyncIterableIterator } from '@azure/core-paging';
16
- import { PollerLike } from '@azure/core-lro';
17
- import { PollOperationState } from '@azure/core-lro';
17
+ import { SimplePollerLike } from '@azure/core-lro';
18
18
  import { TokenCredential } from '@azure/core-auth';
19
19
 
20
20
  /** Configuration common to all actions. */
@@ -29,7 +29,9 @@ export declare interface ActionCommon {
29
29
 
30
30
  /** Parameters object for a text analysis task using custom models. */
31
31
  export declare interface ActionCustom extends ActionCommon {
32
+ /** This field indicates the project name for the model. */
32
33
  projectName: string;
34
+ /** This field indicates the deployment name for the model. */
33
35
  deploymentName: string;
34
36
  }
35
37
 
@@ -81,7 +83,7 @@ export declare type AnalyzeActionParameters<ActionName extends AnalyzeActionName
81
83
  /**
82
84
  * Batch of actions.
83
85
  */
84
- export declare type AnalyzeBatchAction = EntityLinkingBatchAction | EntityRecognitionBatchAction | KeyPhraseExtractionBatchAction | PiiEntityRecognitionBatchAction | HealthcareBatchAction | ExtractiveSummarizationBatchAction | SentimentAnalysisBatchAction | CustomEntityRecognitionBatchAction | CustomSingleLabelClassificationBatchAction | CustomMultiLabelClassificationBatchAction;
86
+ export declare type AnalyzeBatchAction = EntityLinkingBatchAction | EntityRecognitionBatchAction | KeyPhraseExtractionBatchAction | PiiEntityRecognitionBatchAction | HealthcareBatchAction | SentimentAnalysisBatchAction | CustomEntityRecognitionBatchAction | CustomSingleLabelClassificationBatchAction | CustomMultiLabelClassificationBatchAction;
85
87
 
86
88
  /**
87
89
  * Options common to all batch actions.
@@ -108,7 +110,6 @@ export declare const AnalyzeBatchActionNames: {
108
110
  readonly KeyPhraseExtraction: "KeyPhraseExtraction";
109
111
  readonly EntityLinking: "EntityLinking";
110
112
  readonly Healthcare: "Healthcare";
111
- readonly ExtractiveSummarization: "ExtractiveSummarization";
112
113
  readonly CustomEntityRecognition: "CustomEntityRecognition";
113
114
  readonly CustomSingleLabelClassification: "CustomSingleLabelClassification";
114
115
  readonly CustomMultiLabelClassification: "CustomMultiLabelClassification";
@@ -134,10 +135,6 @@ export declare interface AnalyzeBatchOperationMetadata {
134
135
  * The time the operation status was last updated.
135
136
  */
136
137
  readonly modifiedOn: Date;
137
- /**
138
- * The current status of the operation.
139
- */
140
- readonly status: OperationStatus;
141
138
  /**
142
139
  * Number of successfully completed actions.
143
140
  */
@@ -159,7 +156,7 @@ export declare interface AnalyzeBatchOperationMetadata {
159
156
  /**
160
157
  * The state of the begin analyze polling operation.
161
158
  */
162
- export declare interface AnalyzeBatchOperationState extends PollOperationState<PagedAnalyzeBatchResult>, AnalyzeBatchOperationMetadata {
159
+ export declare interface AnalyzeBatchOperationState extends OperationState<PagedAnalyzeBatchResult>, AnalyzeBatchOperationMetadata {
163
160
  }
164
161
 
165
162
  /**
@@ -170,7 +167,7 @@ export declare type AnalyzeBatchPoller = PollerLike<AnalyzeBatchOperationState,
170
167
  /**
171
168
  * Results of a batch of actions.
172
169
  */
173
- export declare type AnalyzeBatchResult = EntityLinkingBatchResult | EntityRecognitionBatchResult | KeyPhraseExtractionBatchResult | PiiEntityRecognitionBatchResult | SentimentAnalysisBatchResult | HealthcareBatchResult | ExtractiveSummarizationBatchResult | CustomEntityRecognitionBatchResult | CustomSingleLabelClassificationBatchResult | CustomMultiLabelClassificationBatchResult;
170
+ export declare type AnalyzeBatchResult = EntityLinkingBatchResult | EntityRecognitionBatchResult | KeyPhraseExtractionBatchResult | PiiEntityRecognitionBatchResult | SentimentAnalysisBatchResult | HealthcareBatchResult | CustomEntityRecognitionBatchResult | CustomSingleLabelClassificationBatchResult | CustomMultiLabelClassificationBatchResult;
174
171
 
175
172
  /**
176
173
  * The type of results of every action in ${@link AnalyzeActionNames}.
@@ -553,56 +550,8 @@ export declare interface EntityRecognitionSuccessResult extends TextAnalysisSucc
553
550
  readonly entities: Entity[];
554
551
  }
555
552
 
556
- /** Supported parameters for an Extractive Summarization task. */
557
- export declare interface ExtractiveSummarizationAction extends ActionPrebuilt {
558
- /** The max number of sentences to be part of the summary. */
559
- maxSentenceCount?: number;
560
- /** The sorting criteria to use for the results of Extractive Summarization. */
561
- orderBy?: ExtractiveSummarizationOrderingCriteria;
562
- /**
563
- * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
564
- *
565
- * The default is the JavaScript's default which is "Utf16CodeUnit".
566
- */
567
- stringIndexType?: StringIndexType;
568
- }
569
-
570
- /** Options for an extractive summarization batch action. */
571
- export declare interface ExtractiveSummarizationBatchAction extends AnalyzeBatchActionCommon, ExtractiveSummarizationAction {
572
- /**
573
- * The kind of the action.
574
- */
575
- kind: "ExtractiveSummarization";
576
- }
577
-
578
- /**
579
- * The result of an extractive summarization batch action.
580
- */
581
- export declare type ExtractiveSummarizationBatchResult = ActionMetadata & BatchActionResult<SummarizationExtractionResult, "ExtractiveSummarization">;
582
-
583
- /**
584
- * Defines values for ExtractiveSummarizationOrderingCriteria. \
585
- * {@link KnownExtractiveSummarizationOrderingCriteria} can be used interchangeably with ExtractiveSummarizationOrderingCriteria,
586
- * this enum contains the known values that the service supports.
587
- * ### Known values supported by the service
588
- * **Offset**: Indicates that results should be sorted in order of appearance in the text. \
589
- * **Rank**: Indicates that results should be sorted in order of importance (i.e. rank score) according to the model.
590
- */
591
- export declare type ExtractiveSummarizationOrderingCriteria = string;
592
-
593
- /**
594
- * Defines values for FhirVersion. \
595
- * {@link KnownFhirVersion} can be used interchangeably with FhirVersion,
596
- * this enum contains the known values that the service supports.
597
- * ### Known values supported by the service
598
- * **4.0.1**
599
- */
600
- export declare type FhirVersion = string;
601
-
602
553
  /** Supported parameters for a Healthcare task. */
603
554
  export declare interface HealthcareAction extends ActionPrebuilt {
604
- /** The FHIR Spec version that the result will use to format the fhirBundle. For additional information see https://www.hl7.org/fhir/overview.html. */
605
- fhirVersion?: FhirVersion;
606
555
  /**
607
556
  * Specifies the measurement unit used to calculate the offset and length properties. For a list of possible values, see {@link KnownStringIndexType}.
608
557
  *
@@ -691,32 +640,32 @@ export declare interface HealthcareEntity extends Entity {
691
640
  * {@link KnownHealthcareEntityCategory} can be used interchangeably with HealthcareEntityCategory,
692
641
  * this enum contains the known values that the service supports.
693
642
  * ### Known values supported by the service
694
- * **BODY_STRUCTURE** \
695
- * **AGE** \
696
- * **GENDER** \
697
- * **EXAMINATION_NAME** \
698
- * **DATE** \
699
- * **DIRECTION** \
700
- * **FREQUENCY** \
701
- * **MEASUREMENT_VALUE** \
702
- * **MEASUREMENT_UNIT** \
703
- * **RELATIONAL_OPERATOR** \
704
- * **TIME** \
705
- * **GENE_OR_PROTEIN** \
706
- * **VARIANT** \
707
- * **ADMINISTRATIVE_EVENT** \
708
- * **CARE_ENVIRONMENT** \
709
- * **HEALTHCARE_PROFESSION** \
710
- * **DIAGNOSIS** \
711
- * **SYMPTOM_OR_SIGN** \
712
- * **CONDITION_QUALIFIER** \
713
- * **MEDICATION_CLASS** \
714
- * **MEDICATION_NAME** \
715
- * **DOSAGE** \
716
- * **MEDICATION_FORM** \
717
- * **MEDICATION_ROUTE** \
718
- * **FAMILY_RELATION** \
719
- * **TREATMENT_NAME**
643
+ * **BodyStructure** \
644
+ * **Age** \
645
+ * **Gender** \
646
+ * **ExaminationName** \
647
+ * **Date** \
648
+ * **Direction** \
649
+ * **Frequency** \
650
+ * **MeasurementValue** \
651
+ * **MeasurementUnit** \
652
+ * **RelationalOperator** \
653
+ * **Time** \
654
+ * **GeneOrProtein** \
655
+ * **Variant** \
656
+ * **AdministrativeEvent** \
657
+ * **CareEnvironment** \
658
+ * **HealthcareProfession** \
659
+ * **Diagnosis** \
660
+ * **SymptomOrSign** \
661
+ * **ConditionQualifier** \
662
+ * **MedicationClass** \
663
+ * **MedicationName** \
664
+ * **Dosage** \
665
+ * **MedicationForm** \
666
+ * **MedicationRoute** \
667
+ * **FamilyRelation** \
668
+ * **TreatmentName**
720
669
  */
721
670
  export declare type HealthcareEntityCategory = string;
722
671
 
@@ -775,11 +724,6 @@ export declare interface HealthcareSuccessResult extends TextAnalysisSuccessResu
775
724
  * Relations between healthcare entities.
776
725
  */
777
726
  readonly entityRelations: HealthcareEntityRelation[];
778
- /**
779
- * JSON bundle containing a FHIR compatible object for consumption in other
780
- * Healthcare tools. For additional information see {@link https://www.hl7.org/fhir/overview.html}.
781
- */
782
- readonly fhirBundle?: Record<string, any>;
783
727
  }
784
728
 
785
729
  /** Options for a key phrase recognition action. */
@@ -850,23 +794,15 @@ export declare enum KnownErrorCode {
850
794
  /** InternalServerError */
851
795
  InternalServerError = "InternalServerError",
852
796
  /** ServiceUnavailable */
853
- ServiceUnavailable = "ServiceUnavailable"
854
- }
855
-
856
- /** Known values of {@link ExtractiveSummarizationOrderingCriteria} that the service accepts. */
857
- export declare enum KnownExtractiveSummarizationOrderingCriteria {
858
- /** Indicates that results should be sorted in order of appearance in the text. */
859
- Offset = "Offset",
860
- /** Indicates that results should be sorted in order of importance (i.e. rank score) according to the model. */
861
- Rank = "Rank"
862
- }
863
-
864
- /**
865
- * Known values of the {@link HealthcareAction.fhirVersion} parameter.
866
- */
867
- export declare enum KnownFhirVersion {
868
- /** 4.0.1 */
869
- "4.0.1" = "4.0.1"
797
+ ServiceUnavailable = "ServiceUnavailable",
798
+ /** Timeout */
799
+ Timeout = "Timeout",
800
+ /** QuotaExceeded */
801
+ QuotaExceeded = "QuotaExceeded",
802
+ /** Conflict */
803
+ Conflict = "Conflict",
804
+ /** Warning */
805
+ Warning = "Warning"
870
806
  }
871
807
 
872
808
  /** Known values of {@link InnerErrorCode} that the service accepts. */
@@ -1298,6 +1234,10 @@ export declare const KnownTextAnalysisErrorCode: {
1298
1234
  AzureCognitiveSearchIndexLimitReached: KnownErrorCode.AzureCognitiveSearchIndexLimitReached;
1299
1235
  InternalServerError: KnownErrorCode.InternalServerError;
1300
1236
  ServiceUnavailable: KnownErrorCode.ServiceUnavailable;
1237
+ Timeout: KnownErrorCode.Timeout;
1238
+ QuotaExceeded: KnownErrorCode.QuotaExceeded;
1239
+ Conflict: KnownErrorCode.Conflict;
1240
+ Warning: KnownErrorCode.Warning;
1301
1241
  };
1302
1242
 
1303
1243
  /** Options for a language detection action. */
@@ -1365,9 +1305,6 @@ export declare interface Match {
1365
1305
  length: number;
1366
1306
  }
1367
1307
 
1368
- /** Defines values for OperationStatus. */
1369
- export declare type OperationStatus = "notStarted" | "running" | "succeeded" | "partiallySucceeded" | "failed" | "cancelled" | "cancelling";
1370
-
1371
1308
  /**
1372
1309
  * A mined opinion object represents an opinion we've extracted from a sentence.
1373
1310
  * It consists of both a target that these assessments are about, and the actual
@@ -1637,6 +1574,16 @@ export declare interface PiiEntityRecognitionSuccessResult extends TextAnalysisS
1637
1574
  readonly redactedText: string;
1638
1575
  }
1639
1576
 
1577
+ /**
1578
+ * Abstract representation of a poller, intended to expose just the minimal API that the user needs to work with.
1579
+ */
1580
+ export declare interface PollerLike<TState extends OperationState<TResult>, TResult> extends SimplePollerLike<TState, TResult> {
1581
+ /**
1582
+ * sends a cancellation request.
1583
+ */
1584
+ sendCancellationRequest: () => Promise<void>;
1585
+ }
1586
+
1640
1587
  /**
1641
1588
  * Defines values for RelationType. \
1642
1589
  * {@link KnownRelationType} can be used interchangeably with RelationType,
@@ -1775,8 +1722,11 @@ export declare interface SentimentAnalysisSuccessResult extends TextAnalysisSucc
1775
1722
 
1776
1723
  /** Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative. */
1777
1724
  export declare interface SentimentConfidenceScores {
1725
+ /** Confidence score for positive sentiment */
1778
1726
  positive: number;
1727
+ /** Confidence score for neutral sentiment */
1779
1728
  neutral: number;
1729
+ /** Confidence score for negative sentiment */
1780
1730
  negative: number;
1781
1731
  }
1782
1732
 
@@ -1791,42 +1741,11 @@ export declare interface SentimentConfidenceScores {
1791
1741
  */
1792
1742
  export declare type StringIndexType = string;
1793
1743
 
1794
- /**
1795
- * An error result from the extractive summarization action on a single document.
1796
- */
1797
- export declare type SummarizationExtractionErrorResult = TextAnalysisErrorResult;
1798
-
1799
- /**
1800
- * The result of the extractive summarization action on a single document.
1801
- */
1802
- export declare type SummarizationExtractionResult = SummarizationExtractionSuccessResult | SummarizationExtractionErrorResult;
1803
-
1804
- /**
1805
- * The result of the extractive summarization action on a single document,
1806
- * containing a collection of the summary identified in that document.
1807
- */
1808
- export declare interface SummarizationExtractionSuccessResult extends TextAnalysisSuccessResult {
1809
- /**
1810
- * A list of sentences composing a summary of the input document.
1811
- */
1812
- readonly sentences: SummarySentence[];
1813
- }
1814
-
1815
- /** A sentence that is part of the extracted summary. */
1816
- export declare interface SummarySentence {
1817
- /** The extracted sentence text. */
1818
- text: string;
1819
- /** A double value representing the relevance of the sentence within the summary. Higher values indicate higher importance. */
1820
- rankScore: number;
1821
- /** The sentence offset from the start of the document, based on the value of the parameter StringIndexType. */
1822
- offset: number;
1823
- /** The length of the sentence. */
1824
- length: number;
1825
- }
1826
-
1827
- /** Represents the confidence scores across all sentiment classes: positive, neutral, negative. */
1744
+ /** Represents the confidence scores across all sentiment classes: positive and negative. */
1828
1745
  export declare interface TargetConfidenceScores {
1746
+ /** Confidence score for positive sentiment */
1829
1747
  positive: number;
1748
+ /** Confidence score for negative sentiment */
1830
1749
  negative: number;
1831
1750
  }
1832
1751
 
@@ -2356,7 +2275,7 @@ export declare interface TextAnalysisClientOptions extends CommonClientOptions {
2356
2275
  /**
2357
2276
  * The version of the Cognitive Language Service API to use.
2358
2277
  */
2359
- apiVersion?: string;
2278
+ serviceVersion?: string;
2360
2279
  }
2361
2280
 
2362
2281
  /**
@@ -2399,10 +2318,6 @@ export declare interface TextAnalysisOperationOptions extends OperationOptions {
2399
2318
  * If set to true, response will contain input and document level statistics.
2400
2319
  */
2401
2320
  includeStatistics?: boolean;
2402
- /**
2403
- * The version of the Cognitive Language Service API to use.
2404
- */
2405
- apiVersion?: string;
2406
2321
  }
2407
2322
 
2408
2323
  /**