Skip to content

Commit

Permalink
[language text] Remove resolution feature from entity recognition (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
minhanh-phan authored May 8, 2023
1 parent 1bfcf50 commit 935a507
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 484 deletions.
1 change: 0 additions & 1 deletion sdk/cognitivelanguage/ai-language-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Please see the [Migration Guide](https://github.com/azure/azure-sdk-for-js/blob/
To get started, submit a request for access [here](https://aka.ms/applyforgatedsummarizationfeatures).
* [Script Detection](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cognitivelanguage/ai-language-text/Samples.md#language-detection)
* [Automatic Language Detection](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cognitivelanguage/ai-language-text/Samples.md#automatic-language-detection)
* [Entity Resolutions](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cognitivelanguage/ai-language-text/Samples.md#entity-resolutions)
* [Specifying healthcare document type for better FHIR results](https://github.com/azure/azure-sdk-for-js/blob/main/sdk/cognitivelanguage/ai-language-text/Samples.md#healthcare-analysis)


Expand Down
14 changes: 2 additions & 12 deletions sdk/cognitivelanguage/ai-language-text/Samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

For more samples, check out the [`samples-dev` folder](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cognitivelanguage/ai-language-text/samples-dev)

### Entity Resolutions
### Entity Recognition

Recognize and categorize entities in text as people, places, organizations, dates/times, quantities, currencies, etc. The latest beta release can resolve entities to standard formats. Resolutions provide predictable formats for common quantifiable types and can normalize values to a single, well-known format.
Recognize and categorize entities in text as people, places, organizations, dates/times, quantities, currencies, etc.

The `languageCode` parameter is optional. If it is not specified, the default English model will be used.

Expand All @@ -23,7 +23,6 @@ async function main() {
const actions = [
{
kind: "EntityRecognition",
modelVersion: "2022-10-01-preview",
},
];
const poller = await client.beginAnalyzeBatch(actions, documents, "en");
Expand All @@ -46,15 +45,6 @@ async function main() {
console.log("\tRecognized Entities:");
for (const entity of result.entities) {
console.log(`\t- Entity "${entity.text}" of type ${entity.category}`);

if (entity.resolutions) {
console.log("\tRecognized Resolution:");
for (const resolution of entity.resolutions) {
const { resolutionKind, ...resolutionInfo } = resolution;
console.log(`\t- Resolution of type ${resolutionKind}`);
console.log(`\t- Resolution information ${JSON.stringify(resolutionInfo)}`);
}
}
}
}
}
Expand Down
143 changes: 1 addition & 142 deletions sdk/cognitivelanguage/ai-language-text/review/ai-language-text.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ export interface ActionPrebuilt extends ActionCommon {
modelVersion?: string;
}

// @public
export interface AgeResolution extends BaseResolution, QuantityResolution {
resolutionKind: "AgeResolution";
unit: AgeUnit;
}

// @public
export type AgeUnit = string;

Expand Down Expand Up @@ -155,12 +149,6 @@ export type AnalyzeResult<ActionName extends AnalyzeActionName> = {
LanguageDetection: LanguageDetectionResult[];
}[ActionName];

// @public
export interface AreaResolution extends BaseResolution, QuantityResolution {
resolutionKind: "AreaResolution";
unit: AreaUnit;
}

// @public
export type AreaUnit = string;

Expand All @@ -176,14 +164,6 @@ export interface AssessmentSentiment {

export { AzureKeyCredential }

// @public
export interface BaseResolution {
resolutionKind: "AgeResolution" | "VolumeResolution" | "SpeedResolution" | "AreaResolution" | "LengthResolution" | "InformationResolution" | "TemperatureResolution" | "WeightResolution" | "CurrencyResolution" | "BooleanResolution" | "DateTimeResolution" | "NumberResolution" | "OrdinalResolution" | "TemporalSpanResolution" | "NumericRangeResolution";
}

// @public (undocumented)
export type BaseResolutionUnion = BaseResolution | AgeResolution | VolumeResolution | SpeedResolution | AreaResolution | LengthResolution | InformationResolution | TemperatureResolution | WeightResolution | CurrencyResolution | BooleanResolution | DateTimeResolution | NumberResolution | OrdinalResolution | TemporalSpanResolution | NumericRangeResolution;

// @public
export interface BatchActionErrorResult<Kind extends AnalyzeBatchActionName> extends BatchActionState<Kind> {
readonly error: TextAnalysisError;
Expand Down Expand Up @@ -213,26 +193,12 @@ export interface BeginAnalyzeBatchOptions extends TextAnalysisOperationOptions {
updateIntervalInMs?: number;
}

// @public
export interface BooleanResolution extends BaseResolution {
resolutionKind: "BooleanResolution";
// (undocumented)
value: boolean;
}

// @public
export interface ClassificationCategory {
category: string;
confidenceScore: number;
}

// @public
export interface CurrencyResolution extends BaseResolution, QuantityResolution {
iso4217?: string;
resolutionKind: "CurrencyResolution";
unit: string;
}

// @public
export interface CustomActionMetadata {
readonly deploymentName: string;
Expand Down Expand Up @@ -309,15 +275,6 @@ export interface CustomSingleLabelClassificationSuccessResult extends TextAnalys
readonly classifications: ClassificationCategory[];
}

// @public
export interface DateTimeResolution extends BaseResolution {
dateTimeSubKind: DateTimeSubKind;
modifier?: TemporalModifier;
resolutionKind: "DateTimeResolution";
timex: string;
value: string;
}

// @public
export type DateTimeSubKind = string;

Expand Down Expand Up @@ -413,12 +370,7 @@ export type EntityRecognitionResult = EntityRecognitionSuccessResult | EntityRec

// @public
export interface EntityRecognitionSuccessResult extends TextAnalysisSuccessResult {
readonly entities: EntityWithResolution[];
}

// @public
export interface EntityWithResolution extends Entity {
resolutions?: BaseResolutionUnion[];
readonly entities: Entity[];
}

// @public
Expand Down Expand Up @@ -518,12 +470,6 @@ export interface HealthcareSuccessResult extends TextAnalysisSuccessResult {
readonly fhirBundle?: Record<string, any>;
}

// @public
export interface InformationResolution extends BaseResolution, QuantityResolution {
resolutionKind: "InformationResolution";
unit: InformationUnit;
}

// @public
export type InformationUnit = string;

Expand Down Expand Up @@ -956,25 +902,6 @@ export enum KnownRelativeTo {
Start = "Start"
}

// @public
export enum KnownResolutionKind {
AgeResolution = "AgeResolution",
AreaResolution = "AreaResolution",
BooleanResolution = "BooleanResolution",
CurrencyResolution = "CurrencyResolution",
DateTimeResolution = "DateTimeResolution",
InformationResolution = "InformationResolution",
LengthResolution = "LengthResolution",
NumberResolution = "NumberResolution",
NumericRangeResolution = "NumericRangeResolution",
OrdinalResolution = "OrdinalResolution",
SpeedResolution = "SpeedResolution",
TemperatureResolution = "TemperatureResolution",
TemporalSpanResolution = "TemporalSpanResolution",
VolumeResolution = "VolumeResolution",
WeightResolution = "WeightResolution"
}

// @public
export enum KnownScriptKind {
Latin = "Latin"
Expand Down Expand Up @@ -1143,12 +1070,6 @@ export interface LanguageDetectionSuccessResult extends TextAnalysisSuccessResul
readonly primaryLanguage: DetectedLanguage;
}

// @public
export interface LengthResolution extends BaseResolution, QuantityResolution {
resolutionKind: "LengthResolution";
unit: LengthUnit;
}

// @public
export type LengthUnit = string;

Expand All @@ -1174,35 +1095,12 @@ export interface Match {
// @public
export type NumberKind = string;

// @public
export interface NumberResolution extends BaseResolution {
numberKind: NumberKind;
resolutionKind: "NumberResolution";
value: number;
}

// @public
export interface NumericRangeResolution extends BaseResolution {
maximum: number;
minimum: number;
rangeKind: RangeKind;
resolutionKind: "NumericRangeResolution";
}

// @public
export interface Opinion {
readonly assessments: AssessmentSentiment[];
readonly target: TargetSentiment;
}

// @public
export interface OrdinalResolution extends BaseResolution {
offset: string;
relativeTo: RelativeTo;
resolutionKind: "OrdinalResolution";
value: string;
}

// @public
export type PagedAnalyzeBatchResult = PagedAsyncIterableIterator<AnalyzeBatchResult>;

Expand Down Expand Up @@ -1244,11 +1142,6 @@ export interface PollerLike<TState extends OperationState<TResult>, TResult> ext
sendCancellationRequest: () => Promise<void>;
}

// @public
export interface QuantityResolution {
value: number;
}

// @public
export type RangeKind = string;

Expand Down Expand Up @@ -1313,12 +1206,6 @@ export interface SentimentConfidenceScores {
positive: number;
}

// @public
export interface SpeedResolution extends BaseResolution, QuantityResolution {
resolutionKind: "SpeedResolution";
unit: SpeedUnit;
}

// @public
export type SpeedUnit = string;

Expand Down Expand Up @@ -1354,28 +1241,12 @@ export interface TargetSentiment {
readonly text: string;
}

// @public
export interface TemperatureResolution extends BaseResolution, QuantityResolution {
resolutionKind: "TemperatureResolution";
unit: TemperatureUnit;
}

// @public
export type TemperatureUnit = string;

// @public
export type TemporalModifier = string;

// @public
export interface TemporalSpanResolution extends BaseResolution {
begin?: string;
duration?: string;
end?: string;
modifier?: TemporalModifier;
resolutionKind: "TemporalSpanResolution";
timex?: string;
}

// @public
export class TextAnalysisClient {
constructor(endpointUrl: string, credential: KeyCredential, options?: TextAnalysisClientOptions);
Expand Down Expand Up @@ -1447,24 +1318,12 @@ export interface TextDocumentStatistics {
// @public
export type TokenSentimentLabel = "positive" | "mixed" | "negative";

// @public
export interface VolumeResolution extends BaseResolution, QuantityResolution {
resolutionKind: "VolumeResolution";
unit: VolumeUnit;
}

// @public
export type VolumeUnit = string;

// @public
export type WarningCode = string;

// @public
export interface WeightResolution extends BaseResolution, QuantityResolution {
resolutionKind: "WeightResolution";
unit: WeightUnit;
}

// @public
export type WeightUnit = string;

Expand Down

This file was deleted.

Loading

0 comments on commit 935a507

Please sign in to comment.