@azure/ai-language-text 1.0.0-alpha.20220816.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.
- package/README.md +2 -53
- package/dist/index.js +198 -455
- package/dist/index.js.map +1 -1
- package/dist-esm/src/constants.js +1 -1
- package/dist-esm/src/constants.js.map +1 -1
- package/dist-esm/src/generated/generatedClient.js +2 -2
- package/dist-esm/src/generated/generatedClient.js.map +1 -1
- package/dist-esm/src/generated/models/index.js +71 -47
- package/dist-esm/src/generated/models/index.js.map +1 -1
- package/dist-esm/src/generated/models/mappers.js +16 -281
- package/dist-esm/src/generated/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/models/parameters.js +1 -1
- package/dist-esm/src/generated/models/parameters.js.map +1 -1
- package/dist-esm/src/index.js +1 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/lro.js +19 -24
- package/dist-esm/src/lro.js.map +1 -1
- package/dist-esm/src/models.js +0 -9
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/src/textAnalysisClient.js +41 -26
- package/dist-esm/src/textAnalysisClient.js.map +1 -1
- package/dist-esm/src/transforms.js +38 -43
- package/dist-esm/src/transforms.js.map +1 -1
- package/dist-esm/src/util.js +7 -8
- package/dist-esm/src/util.js.map +1 -1
- package/package.json +7 -7
- package/types/ai-language-text.d.ts +63 -148
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"sdk-type": "client",
|
4
4
|
"author": "Microsoft Corporation",
|
5
5
|
"description": "An isomorphic client library for the text analysis features in the Azure Cognitive Language Service.",
|
6
|
-
"version": "1.0.0
|
6
|
+
"version": "1.0.0",
|
7
7
|
"keywords": [
|
8
8
|
"node",
|
9
9
|
"azure",
|
@@ -86,19 +86,19 @@
|
|
86
86
|
"@azure/core-auth": "^1.3.0",
|
87
87
|
"@azure/core-client": "^1.0.0",
|
88
88
|
"@azure/core-rest-pipeline": "^1.8.1",
|
89
|
-
"@azure/core-lro": "2.3.0
|
89
|
+
"@azure/core-lro": "^2.3.0",
|
90
90
|
"@azure/core-paging": "^1.3.0",
|
91
|
-
"@azure/core-tracing": "1.0.0",
|
91
|
+
"@azure/core-tracing": "^1.0.0",
|
92
92
|
"@azure/logger": "^1.0.0",
|
93
93
|
"tslib": "^2.2.0"
|
94
94
|
},
|
95
95
|
"devDependencies": {
|
96
|
-
"@azure/dev-tool": "
|
97
|
-
"@azure/eslint-plugin-azure-sdk": "
|
96
|
+
"@azure/dev-tool": "^1.0.0",
|
97
|
+
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
98
98
|
"@azure/identity": "^2.0.1",
|
99
|
-
"@azure/test-utils": "
|
99
|
+
"@azure/test-utils": "^1.0.0",
|
100
100
|
"@azure-tools/test-recorder": "^2.0.0",
|
101
|
-
"@azure-tools/test-credential": "
|
101
|
+
"@azure-tools/test-credential": "^1.0.0",
|
102
102
|
"@microsoft/api-extractor": "7.18.11",
|
103
103
|
"@types/chai": "^4.1.6",
|
104
104
|
"@types/chai-as-promised": "^7.1.0",
|
@@ -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 {
|
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 |
|
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
|
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 |
|
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
|
-
* **
|
695
|
-
* **
|
696
|
-
* **
|
697
|
-
* **
|
698
|
-
* **
|
699
|
-
* **
|
700
|
-
* **
|
701
|
-
* **
|
702
|
-
* **
|
703
|
-
* **
|
704
|
-
* **
|
705
|
-
* **
|
706
|
-
* **
|
707
|
-
* **
|
708
|
-
* **
|
709
|
-
* **
|
710
|
-
* **
|
711
|
-
* **
|
712
|
-
* **
|
713
|
-
* **
|
714
|
-
* **
|
715
|
-
* **
|
716
|
-
* **
|
717
|
-
* **
|
718
|
-
* **
|
719
|
-
* **
|
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
|
-
/**
|
857
|
-
|
858
|
-
/**
|
859
|
-
|
860
|
-
/**
|
861
|
-
|
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
|
-
|
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
|
/**
|