Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR] cognitiveservices/data-plane/TextAnalytics #557

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 28 additions & 20 deletions packages/@azure/cognitiveservices-textanalytics/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ export interface SentimentBatchResult {

/**
* @interface
* An interface representing MatchRecord.
* An interface representing MatchRecordV2dot1.
*/
export interface MatchRecord {
export interface MatchRecordV2dot1 {
/**
* @member {string} [text] Entity text as appears in the request.
*/
Expand All @@ -285,20 +285,18 @@ export interface MatchRecord {

/**
* @interface
* An interface representing EntityRecord.
* An interface representing EntityRecordV2dot1.
*/
export interface EntityRecord {
export interface EntityRecordV2dot1 {
/**
* @member {string} [name] Entity formal name.
*/
name?: string;
/**
* @member {MatchRecord[]} [matches] List of instances this entity appears in
* the text.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
* @member {MatchRecordV2dot1[]} [matches] List of instances this entity
* appears in the text.
*/
readonly matches?: MatchRecord[];
matches?: MatchRecordV2dot1[];
/**
* @member {string} [wikipediaLanguage] Wikipedia language for which the
* WikipediaId and WikipediaUrl refers to.
Expand All @@ -322,37 +320,47 @@ export interface EntityRecord {
* relevant information.
*/
bingId?: string;
/**
* @member {string} [type] Entity type from Named Entity Recognition model
*/
type?: string;
/**
* @member {string} [subType] Entity sub type from Named Entity Recognition
* model
*/
subType?: string;
}

/**
* @interface
* An interface representing EntitiesBatchResultItem.
* An interface representing EntitiesBatchResultItemV2dot1.
*/
export interface EntitiesBatchResultItem {
export interface EntitiesBatchResultItemV2dot1 {
/**
* @member {string} [id] Unique document identifier.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly id?: string;
/**
* @member {EntityRecord[]} [entities] Recognized entities in the document.
* @member {EntityRecordV2dot1[]} [entities] Recognized entities in the
* document.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly entities?: EntityRecord[];
readonly entities?: EntityRecordV2dot1[];
}

/**
* @interface
* An interface representing EntitiesBatchResult.
* An interface representing EntitiesBatchResultV2dot1.
*/
export interface EntitiesBatchResult {
export interface EntitiesBatchResultV2dot1 {
/**
* @member {EntitiesBatchResultItem[]} [documents] **NOTE: This property will
* not be serialized. It can only be populated by the server.**
* @member {EntitiesBatchResultItemV2dot1[]} [documents] **NOTE: This
* property will not be serialized. It can only be populated by the server.**
*/
readonly documents?: EntitiesBatchResultItem[];
readonly documents?: EntitiesBatchResultItemV2dot1[];
/**
* @member {ErrorRecord[]} [errors] **NOTE: This property will not be
* serialized. It can only be populated by the server.**
Expand Down Expand Up @@ -420,7 +428,7 @@ export type SentimentResponse = SentimentBatchResult & {
/**
* Contains response data for the entities operation.
*/
export type EntitiesResponse = EntitiesBatchResult & {
export type EntitiesResponse = EntitiesBatchResultV2dot1 & {
/**
* The underlying HTTP response.
*/
Expand All @@ -432,6 +440,6 @@ export type EntitiesResponse = EntitiesBatchResult & {
/**
* The response body as parsed JSON or XML
*/
parsedBody: EntitiesBatchResult;
parsedBody: EntitiesBatchResultV2dot1;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,11 @@ export const SentimentBatchResult: msRest.CompositeMapper = {
}
};

export const MatchRecord: msRest.CompositeMapper = {
serializedName: "MatchRecord",
export const MatchRecordV2dot1: msRest.CompositeMapper = {
serializedName: "MatchRecordV2dot1",
type: {
name: "Composite",
className: "MatchRecord",
className: "MatchRecordV2dot1",
modelProperties: {
text: {
serializedName: "text",
Expand All @@ -438,11 +438,11 @@ export const MatchRecord: msRest.CompositeMapper = {
}
};

export const EntityRecord: msRest.CompositeMapper = {
serializedName: "EntityRecord",
export const EntityRecordV2dot1: msRest.CompositeMapper = {
serializedName: "EntityRecordV2dot1",
type: {
name: "Composite",
className: "EntityRecord",
className: "EntityRecordV2dot1",
modelProperties: {
name: {
serializedName: "name",
Expand All @@ -451,14 +451,13 @@ export const EntityRecord: msRest.CompositeMapper = {
}
},
matches: {
readOnly: true,
serializedName: "matches",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "MatchRecord"
className: "MatchRecordV2dot1"
}
}
}
Expand Down Expand Up @@ -487,16 +486,28 @@ export const EntityRecord: msRest.CompositeMapper = {
type: {
name: "String"
}
},
type: {
serializedName: "type",
type: {
name: "String"
}
},
subType: {
serializedName: "subType",
type: {
name: "String"
}
}
}
}
};

export const EntitiesBatchResultItem: msRest.CompositeMapper = {
serializedName: "EntitiesBatchResultItem",
export const EntitiesBatchResultItemV2dot1: msRest.CompositeMapper = {
serializedName: "EntitiesBatchResultItemV2dot1",
type: {
name: "Composite",
className: "EntitiesBatchResultItem",
className: "EntitiesBatchResultItemV2dot1",
modelProperties: {
id: {
readOnly: true,
Expand All @@ -513,7 +524,7 @@ export const EntitiesBatchResultItem: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
className: "EntityRecord"
className: "EntityRecordV2dot1"
}
}
}
Expand All @@ -522,11 +533,11 @@ export const EntitiesBatchResultItem: msRest.CompositeMapper = {
}
};

export const EntitiesBatchResult: msRest.CompositeMapper = {
serializedName: "EntitiesBatchResult",
export const EntitiesBatchResultV2dot1: msRest.CompositeMapper = {
serializedName: "EntitiesBatchResultV2dot1",
type: {
name: "Composite",
className: "EntitiesBatchResult",
className: "EntitiesBatchResultV2dot1",
modelProperties: {
documents: {
readOnly: true,
Expand All @@ -536,7 +547,7 @@ export const EntitiesBatchResult: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
className: "EntitiesBatchResultItem"
className: "EntitiesBatchResultItemV2dot1"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,18 @@ class TextAnalyticsClient extends TextAnalyticsClientContext {
}

/**
* To get even more information on each recognized entity we recommend using the Bing Entity Search
* API by querying for the recognized entities names. See the <a
* The API returns a list of recognized entities in a given document. To get even more information
* on each recognized entity we recommend using the Bing Entity Search API by querying for the
* recognized entities names. See the <a
* href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported
* languages in Text Analytics API</a> for the list of enabled languages.The API returns a list of
* known entities and general named entities ("Person", "Location", "Organization" etc) in a given
* document. Known entities are returned with Wikipedia Id and Wikipedia link, and also Bing Id
* which can be used in Bing Entity Search API. General named entities are returned with entity
* types. If a general named entity is also a known entity, then all information regarding it
* (Wikipedia Id, Bing Id, entity type etc) will be returned. See the <a
* href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-entity-linking#supported-types-for-named-entity-recognition">Supported
* Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a
* href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported
* languages in Text Analytics API</a> for the list of enabled languages.
* @summary The API returns a list of recognized entities in a given document.
Expand All @@ -139,14 +149,14 @@ class TextAnalyticsClient extends TextAnalyticsClientContext {
* @param input Collection of documents to analyze.
* @param callback The callback
*/
entities(input: Models.MultiLanguageBatchInput, callback: msRest.ServiceCallback<Models.EntitiesBatchResult>): void;
entities(input: Models.MultiLanguageBatchInput, callback: msRest.ServiceCallback<Models.EntitiesBatchResultV2dot1>): void;
/**
* @param input Collection of documents to analyze.
* @param options The optional parameters
* @param callback The callback
*/
entities(input: Models.MultiLanguageBatchInput, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.EntitiesBatchResult>): void;
entities(input: Models.MultiLanguageBatchInput, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.EntitiesBatchResult>): Promise<Models.EntitiesResponse> {
entities(input: Models.MultiLanguageBatchInput, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.EntitiesBatchResultV2dot1>): void;
entities(input: Models.MultiLanguageBatchInput, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.EntitiesBatchResultV2dot1>): Promise<Models.EntitiesResponse> {
return this.sendOperationRequest(
{
input,
Expand Down Expand Up @@ -246,7 +256,7 @@ const entitiesOperationSpec: msRest.OperationSpec = {
},
responses: {
200: {
bodyMapper: Mappers.EntitiesBatchResult
bodyMapper: Mappers.EntitiesBatchResultV2dot1
},
default: {
bodyMapper: Mappers.ErrorResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "TextAnalyticsClient Library with typescript type definitions for node.js and browser.",
"version": "1.0.0",
"dependencies": {
"ms-rest-js": "^1.0.455",
"ms-rest-js": "^1.0.439",
"tslib": "^1.9.3"
},
"keywords": [
Expand Down