From 5787a885c048cfd6751240e1a784484b038260ec Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Fri, 26 Oct 2018 09:41:43 -0700 Subject: [PATCH 01/20] updated model names in preview version to be consistent with stable version to avoid breaking changes in client side code --- .../preview/v2.1/TextAnalytics.json | 16 ++++++++-------- .../data-plane/TextAnalytics/readme.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json index b5b5b3c7b662..5c86d61bc47f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json @@ -202,7 +202,7 @@ "200": { "description": "A successful call results in a list of recognized entities returned for each valid document", "schema": { - "$ref": "#/definitions/EntitiesBatchResultV2dot1" + "$ref": "#/definitions/EntitiesBatchResult" } }, "default": { @@ -486,13 +486,13 @@ } } }, - "EntitiesBatchResultV2dot1": { + "EntitiesBatchResult": { "type": "object", "properties": { "documents": { "type": "array", "items": { - "$ref": "#/definitions/EntitiesBatchResultItemV2dot1" + "$ref": "#/definitions/EntitiesBatchResultItem" }, "readOnly": true }, @@ -505,7 +505,7 @@ } } }, - "EntitiesBatchResultItemV2dot1": { + "EntitiesBatchResultItem": { "type": "object", "properties": { "id": { @@ -517,13 +517,13 @@ "description": "Recognized entities in the document.", "type": "array", "items": { - "$ref": "#/definitions/EntityRecordV2dot1" + "$ref": "#/definitions/EntityRecord" }, "readOnly": true } } }, - "EntityRecordV2dot1": { + "EntityRecord": { "type": "object", "properties": { "name": { @@ -534,7 +534,7 @@ "description": "List of instances this entity appears in the text.", "type": "array", "items": { - "$ref": "#/definitions/MatchRecordV2dot1" + "$ref": "#/definitions/MatchRecord" } }, "wikipediaLanguage": { @@ -564,7 +564,7 @@ } } }, - "MatchRecordV2dot1": { + "MatchRecord": { "type": "object", "properties": { "text": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index 13bb690d2276..3a4d6c8d4cac 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -118,7 +118,7 @@ The current release is `release_2_0`. A preview release `release_2_1` is also available. ``` yaml -tag: release_2_0 +tag: release_2_1 add-credentials: true ``` From 4149f668cac065e55c00a48196809734702f64fe Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Mon, 26 Nov 2018 16:52:28 -0800 Subject: [PATCH 02/20] changed swagger files --- .../preview/v2.1/TextAnalytics.json | 64 ++++++++++++++----- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json index 5c86d61bc47f..685fd6e2f57e 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json @@ -208,7 +208,7 @@ "default": { "description": "Error Response", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/EntitiesErrorResponse" } } }, @@ -339,6 +339,36 @@ } } }, + "EntitiesErrorRecord": { + "type": "object", + "properties": { + "id": { + "description": "Input document unique identifier the error refers to.", + "type": "string" + }, + "message": { + "description": "Error message.", + "type": "string" + } + } + }, + "EntitiesErrorResponse": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "type": "string" + }, + "innerError": { + "$ref": "#/definitions/InternalError" + } + } + }, "InternalError": { "type": "object", "properties": { @@ -489,17 +519,17 @@ "EntitiesBatchResult": { "type": "object", "properties": { - "documents": { + "Documents": { "type": "array", "items": { "$ref": "#/definitions/EntitiesBatchResultItem" }, "readOnly": true }, - "errors": { + "Errors": { "type": "array", "items": { - "$ref": "#/definitions/ErrorRecord" + "$ref": "#/definitions/EntitiesErrorRecord" }, "readOnly": true } @@ -508,12 +538,12 @@ "EntitiesBatchResultItem": { "type": "object", "properties": { - "id": { + "Id": { "description": "Unique document identifier.", "type": "string", "readOnly": true }, - "entities": { + "Entities": { "description": "Recognized entities in the document.", "type": "array", "items": { @@ -526,39 +556,39 @@ "EntityRecord": { "type": "object", "properties": { - "name": { + "Name": { "description": "Entity formal name.", "type": "string" }, - "matches": { + "Matches": { "description": "List of instances this entity appears in the text.", "type": "array", "items": { "$ref": "#/definitions/MatchRecord" } }, - "wikipediaLanguage": { + "WikipediaLanguage": { "description": "Wikipedia language for which the WikipediaId and WikipediaUrl refers to.", "type": "string" }, - "wikipediaId": { + "WikipediaId": { "description": "Wikipedia unique identifier of the recognized entity.", "type": "string" }, - "wikipediaUrl": { + "WikipediaUrl": { "description": "URL for the entity's English Wikipedia page.", "type": "string", "readOnly": true }, - "bingId": { + "BingId": { "description": "Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information.", "type": "string" }, - "type": { + "Type": { "description": "Entity type from Named Entity Recognition model", "type": "string" }, - "subType": { + "SubType": { "description": "Entity sub type from Named Entity Recognition model", "type": "string" } @@ -567,16 +597,16 @@ "MatchRecord": { "type": "object", "properties": { - "text": { + "Text": { "description": "Entity text as appears in the request.", "type": "string" }, - "offset": { + "Offset": { "format": "int32", "description": "Start position (in Unicode characters) for the entity match text.", "type": "integer" }, - "length": { + "Length": { "format": "int32", "description": "Length (in Unicode characters) for the entity match text.", "type": "integer" From ebe6e08feb6f3f0980f3ac736b221a2a9d4cbf6f Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Mon, 10 Aug 2020 16:32:25 -0700 Subject: [PATCH 03/20] new preview API v3.1-preview.2 --- .../preview/v3.1-preview.1/TextAnalytics.json | 28 + .../preview/v3.1-preview.2/TextAnalytics.json | 1374 +++++++++++++++++ .../examples/SuccessfulEntitiesRequest.json | 91 ++ .../SuccessfulEntityLinkingRequest.json | 101 ++ .../examples/SuccessfulEntityPIIRequest.json | 78 + .../examples/SuccessfulKeyPhrasesRequest.json | 60 + .../examples/SuccessfulLanguagesRequest.json | 61 + .../examples/SuccessfulSentimentRequest.json | 323 ++++ 8 files changed, 2116 insertions(+) create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json index be6c1a405786..6e819d6f04da 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json @@ -60,6 +60,13 @@ "type": "boolean", "required": false }, + { + "name": "stringIndexType", + "in": "query", + "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", + "type": "boolean", + "required": false + }, { "in": "body", "name": "input", @@ -118,6 +125,13 @@ "description": "(Optional) if set to true, response will contain input and document level statistics.", "type": "boolean" }, + { + "name": "stringIndexType", + "in": "query", + "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", + "type": "boolean", + "required": false + }, { "name": "domain", "in": "query", @@ -182,6 +196,13 @@ "description": "(Optional) if set to true, response will contain input and document level statistics.", "type": "boolean" }, + { + "name": "stringIndexType", + "in": "query", + "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", + "type": "boolean", + "required": false + }, { "in": "body", "name": "input", @@ -356,6 +377,13 @@ "description": "(Optional) if set to true, response will contain input and document level statistics.", "type": "boolean" }, + { + "name": "stringIndexType", + "in": "query", + "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", + "type": "boolean", + "required": false + }, { "name": "opinionMining", "in": "query", diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json new file mode 100644 index 000000000000..b519eb8b6d6e --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -0,0 +1,1374 @@ +{ + "swagger": "2.0", + "info": { + "version": "v3.1-preview.2", + "contact": { + "name": "Microsoft Cognitive Services", + "url": "https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", + "email": "mlapi@microsoft.com" + }, + "title": "Text Analytics Client", + "description": "The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" + }, + "securityDefinitions": { + "apim_key": { + "type": "apiKey", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" + } + }, + "security": [ + { + "apim_key": [] + } + ], + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}/text/analytics/v3.1-preview.1", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + }, + "paths": { + "/entities/recognition/general": { + "post": { + "summary": "Named Entity Recognition", + "description": "The API returns a list of general named entities in a given document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "EntitiesRecognitionGeneral", + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "model-version", + "in": "query", + "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "required": false, + "type": "string" + }, + { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain input and document level statistics.", + "type": "boolean", + "required": false + }, + { + "name": "stringIndexType", + "in": "query", + "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", + "type": "boolean", + "required": false + }, + { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + } + } + ], + "responses": { + "200": { + "description": "A successful call results in a list of recognized entities returned for each valid document.", + "schema": { + "$ref": "#/definitions/EntitiesResult" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Entities request": { + "$ref": ".//examples//SuccessfulEntitiesRequest.json" + } + }, + "deprecated": false + } + }, + "/entities/recognition/pii": { + "post": { + "summary": "Entities containing personal information", + "description": "The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.\n", + "operationId": "EntitiesRecognitionPii", + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "model-version", + "in": "query", + "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type": "string" + }, + { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain input and document level statistics.", + "type": "boolean" + }, + { + "name": "stringIndexType", + "in": "query", + "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", + "type": "boolean", + "required": false + }, + { + "name": "domain", + "in": "query", + "description": "(Optional) if set to 'PHI', response will contain only PHI entities.", + "type": "string" + }, + { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + } + } + ], + "responses": { + "200": { + "description": "A successful call results in a list of entities containing personal information returned for each valid document", + "schema": { + "$ref": "#/definitions/EntitiesResult" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Entity PII request": { + "$ref": ".//examples//SuccessfulEntityPIIRequest.json" + } + }, + "deprecated": false + } + }, + "/entities/linking": { + "post": { + "summary": "Linked entities from a well-known knowledge base", + "description": "The API returns a list of recognized entities with links to a well-known knowledge base. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "EntitiesLinking", + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "model-version", + "in": "query", + "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type": "string" + }, + { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain input and document level statistics.", + "type": "boolean" + }, + { + "name": "stringIndexType", + "in": "query", + "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", + "type": "boolean", + "required": false + }, + { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + } + } + ], + "responses": { + "200": { + "description": "A successful call results in a list of recognized entities with links to a well-known knowledge base returned for each valid document", + "schema": { + "$ref": "#/definitions/EntityLinkingResult" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Entity Linking request": { + "$ref": ".//examples//SuccessfulEntityLinkingRequest.json" + } + }, + "deprecated": false + } + }, + "/keyPhrases": { + "post": { + "summary": "Key Phrases", + "description": "The API returns a list of strings denoting the key phrases in the input text. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "KeyPhrases", + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "model-version", + "in": "query", + "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type": "string" + }, + { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain input and document level statistics.", + "type": "boolean" + }, + { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze. Documents can now contain a language field to indicate the text language", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + } + } + ], + "responses": { + "200": { + "description": "A successful response results in 0 or more key phrases identified in each valid document", + "schema": { + "$ref": "#/definitions/KeyPhraseResult" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Key Phrase request": { + "$ref": ".//examples//SuccessfulKeyPhrasesRequest.json" + } + }, + "deprecated": false + } + }, + "/languages": { + "post": { + "summary": "Detect Language", + "description": "The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "Languages", + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "model-version", + "in": "query", + "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type": "string" + }, + { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain input and document level statistics.", + "type": "boolean" + }, + { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/LanguageBatchInput" + } + } + ], + "responses": { + "200": { + "description": "A successful call results in the detected language with the highest probability for each valid document", + "schema": { + "$ref": "#/definitions/LanguageResult" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Detect Language request": { + "$ref": ".//examples//SuccessfulLanguagesRequest.json" + } + }, + "deprecated": false + } + }, + "/sentiment": { + "post": { + "summary": "Sentiment", + "description": "The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple levels of granularity, start from the a document level, down to sentence and key terms (aspects) and opinions.", + "operationId": "Sentiment", + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "model-version", + "in": "query", + "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type": "string" + }, + { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain input and document level statistics.", + "type": "boolean" + }, + { + "name": "stringIndexType", + "in": "query", + "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", + "type": "boolean", + "required": false + }, + { + "name": "opinionMining", + "in": "query", + "description": "(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", + "type": "boolean" + }, + { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + } + } + ], + "responses": { + "200": { + "description": "A successful call results in a document sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral)", + "schema": { + "$ref": "#/definitions/SentimentResponse" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Sentiment request": { + "$ref": ".//examples//SuccessfulSentimentRequest.json" + } + }, + "deprecated": false + } + } + }, + "definitions": { + "MultiLanguageBatchInput": { + "type": "object", + "required": [ + "documents" + ], + "properties": { + "documents": { + "type": "array", + "description": "The set of documents to process as part of this batch.", + "items": { + "$ref": "#/definitions/MultiLanguageInput" + } + } + }, + "description": "Contains a set of input documents to be analyzed by the service." + }, + "MultiLanguageInput": { + "type": "object", + "required": [ + "id", + "text" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique, non-empty document identifier." + }, + "text": { + "type": "string", + "description": "The input text to process." + }, + "language": { + "type": "string", + "description": "(Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default." + } + }, + "description": "Contains an input document to be analyzed by the service." + }, + "DocumentError": { + "type": "object", + "required": [ + "id", + "error" + ], + "properties": { + "id": { + "type": "string", + "description": "Document Id." + }, + "error": { + "type": "object", + "description": "Document Error.", + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "TextAnalyticsError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "invalidRequest", + "invalidArgument", + "internalServerError", + "serviceUnavailable" + ], + "x-ms-enum": { + "name": "ErrorCodeValue", + "modelAsString": false + }, + "description": "Error code." + }, + "message": { + "type": "string", + "description": "Error message." + }, + "target": { + "type": "string", + "description": "Error target." + }, + "innererror": { + "$ref": "#/definitions/InnerError", + "description": "Inner error contains more specific information." + }, + "details": { + "type": "array", + "description": "Details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + } + }, + "TextAnalyticsWarning": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "LongWordsInDocument", + "DocumentTruncated" + ], + "x-ms-enum": { + "name": "WarningCodeValue", + "modelAsString": false + }, + "description": "Error code." + }, + "message": { + "type": "string", + "description": "Warning message." + }, + "targetRef": { + "type": "string", + "description": "A JSON pointer reference indicating the target object." + } + } + }, + "InnerError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "invalidParameterValue", + "invalidRequestBodyFormat", + "emptyRequest", + "missingInputRecords", + "invalidDocument", + "modelVersionIncorrect", + "invalidDocumentBatch", + "unsupportedLanguageCode", + "invalidCountryHint" + ], + "x-ms-enum": { + "name": "InnerErrorCodeValue", + "modelAsString": false + }, + "description": "Error code." + }, + "message": { + "type": "string", + "description": "Error message." + }, + "details": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Error details." + }, + "target": { + "type": "string", + "description": "Error target." + }, + "innererror": { + "$ref": "#/definitions/InnerError", + "description": "Inner error contains more specific information." + } + } + }, + "SentimentResponse": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Sentiment analysis per document.", + "items": { + "$ref": "#/definitions/DocumentSentiment" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "DocumentSentiment": { + "type": "object", + "required": [ + "id", + "sentiment", + "confidenceScores", + "sentences", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "sentiment": { + "type": "string", + "description": "Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).", + "enum": [ + "positive", + "neutral", + "negative", + "mixed" + ], + "x-ms-enum": { + "name": "DocumentSentimentValue", + "modelAsString": false + } + }, + "statistics": { + "$ref": "#/definitions/DocumentStatistics" + }, + "confidenceScores": { + "description": "Document level sentiment confidence scores between 0 and 1 for each sentiment class.", + "$ref": "#/definitions/SentimentConfidenceScorePerLabel" + }, + "sentences": { + "type": "array", + "description": "Sentence level sentiment analysis.", + "items": { + "$ref": "#/definitions/SentenceSentiment" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + } + } + }, + "RequestStatistics": { + "type": "object", + "required": [ + "documentsCount", + "validDocumentsCount", + "erroneousDocumentsCount", + "transactionsCount" + ], + "properties": { + "documentsCount": { + "type": "integer", + "format": "int32", + "description": "Number of documents submitted in the request." + }, + "validDocumentsCount": { + "type": "integer", + "format": "int32", + "description": "Number of valid documents. This excludes empty, over-size limit or non-supported languages documents." + }, + "erroneousDocumentsCount": { + "type": "integer", + "format": "int32", + "description": "Number of invalid documents. This includes empty, over-size limit or non-supported languages documents." + }, + "transactionsCount": { + "type": "integer", + "format": "int64", + "description": "Number of transactions for the request." + } + }, + "description": "if showStats=true was specified in the request this field will contain information about the request payload." + }, + "DocumentStatistics": { + "type": "object", + "required": [ + "charactersCount", + "transactionsCount" + ], + "properties": { + "charactersCount": { + "type": "integer", + "format": "int32", + "description": "Number of text elements recognized in the document." + }, + "transactionsCount": { + "type": "integer", + "format": "int32", + "description": "Number of transactions for the document." + } + }, + "description": "if showStats=true was specified in the request this field will contain information about the document payload." + }, + "SentimentConfidenceScorePerLabel": { + "type": "object", + "required": [ + "positive", + "neutral", + "negative" + ], + "properties": { + "positive": { + "type": "number", + "format": "double" + }, + "neutral": { + "type": "number", + "format": "double" + }, + "negative": { + "type": "number", + "format": "double" + } + }, + "description": "Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative." + }, + "SentenceSentiment": { + "type": "object", + "required": [ + "text", + "sentiment", + "confidenceScores", + "offset", + "length" + ], + "properties": { + "text": { + "type": "string", + "description": "The sentence text." + }, + "sentiment": { + "type": "string", + "description": "The predicted Sentiment for the sentence.", + "enum": [ + "positive", + "neutral", + "negative" + ], + "x-ms-enum": { + "name": "SentenceSentimentValue", + "modelAsString": false + } + }, + "confidenceScores": { + "description": "The sentiment confidence score between 0 and 1 for the sentence for all classes.", + "$ref": "#/definitions/SentimentConfidenceScorePerLabel" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The sentence offset from the start of the document." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "The length of the sentence." + }, + "aspects": { + "type": "array", + "description": "The array of aspect object for the sentence.", + "items": { + "$ref": "#/definitions/SentenceAspect" + } + }, + "opinions": { + "type": "array", + "description": "The array of opinion object for the sentence.", + "items": { + "$ref": "#/definitions/SentenceOpinion" + } + } + } + }, + "SentenceAspect": { + "type": "object", + "required": [ + "confidenceScores", + "length", + "offset", + "relations", + "sentiment", + "text" + ], + "properties": { + "sentiment": { + "type": "string", + "enum": [ + "positive", + "mixed", + "negative" + ], + "description": "Aspect level sentiment for the aspect in the sentence." + }, + "confidenceScores": { + "description": "Aspect level sentiment confidence scores for the aspect in the sentence.", + "$ref": "#/definitions/AspectConfidenceScoreLabel" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The aspect offset from the start of the sentence." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "The length of the aspect." + }, + "text": { + "type": "string", + "description": "The aspect text detected." + }, + "relations": { + "type": "array", + "description": "The array of either opinion or aspect object which is related to the aspect.", + "items": { + "$ref": "#/definitions/AspectRelation" + } + } + } + }, + "SentenceOpinion": { + "type": "object", + "required": [ + "confidenceScores", + "isNegated", + "length", + "offset", + "sentiment", + "text" + ], + "properties": { + "sentiment": { + "type": "string", + "enum": [ + "positive", + "mixed", + "negative" + ], + "description": "Opinion level sentiment for the aspect in the sentence." + }, + "confidenceScores": { + "description": "Opinion level sentiment confidence scores for the aspect in the sentence.", + "$ref": "#/definitions/AspectConfidenceScoreLabel" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The opinion offset from the start of the sentence." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "The length of the opinion." + }, + "text": { + "type": "string", + "description": "The aspect text detected." + }, + "isNegated": { + "type": "boolean", + "description": "The indicator representing if the opinion is negated." + } + } + }, + "AspectRelation": { + "type": "object", + "required": [ + "ref", + "relationType" + ], + "properties": { + "relationType": { + "type": "string", + "enum": [ + "opinion", + "aspect" + ], + "description": "The type related to the aspect." + }, + "ref": { + "type": "string", + "description": "The JSON pointer indicating the linked object." + } + } + }, + "AspectConfidenceScoreLabel": { + "type": "object", + "required": [ + "negative", + "positive" + ], + "properties": { + "positive": { + "type": "number", + "format": "double" + }, + "negative": { + "type": "number", + "format": "double" + } + }, + "description": "Represents the confidence scores across all sentiment classes: positive, neutral, negative." + }, + "EntitiesResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentEntities" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "DocumentEntities": { + "type": "object", + "required": [ + "id", + "entities", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "type": "array", + "description": "Recognized entities in the document.", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + } + } + }, + "Entity": { + "type": "object", + "required": [ + "text", + "category", + "offset", + "length", + "confidenceScore" + ], + "properties": { + "text": { + "type": "string", + "description": "Entity text as appears in the request." + }, + "category": { + "type": "string", + "description": "Entity type, such as Person/Location/Org/SSN etc" + }, + "subcategory": { + "type": "string", + "description": "Entity sub type, such as Age/Year/TimeRange etc" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "Start position for the entity text." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length for the entity text." + }, + "confidenceScore": { + "type": "number", + "format": "double", + "description": "Confidence score between 0 and 1 of the extracted entity." + } + } + }, + "EntityLinkingResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentLinkedEntities" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "DocumentLinkedEntities": { + "type": "object", + "required": [ + "id", + "entities", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "type": "array", + "description": "Recognized well-known entities in the document.", + "items": { + "$ref": "#/definitions/LinkedEntity" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + } + } + }, + "LinkedEntity": { + "type": "object", + "required": [ + "name", + "matches", + "language", + "url", + "dataSource" + ], + "properties": { + "name": { + "type": "string", + "description": "Entity Linking formal name." + }, + "matches": { + "type": "array", + "description": "List of instances this entity appears in the text.", + "items": { + "$ref": "#/definitions/Match" + } + }, + "language": { + "type": "string", + "description": "Language used in the data source." + }, + "id": { + "type": "string", + "description": "Unique identifier of the recognized entity from the data source." + }, + "url": { + "type": "string", + "description": "URL for the entity's page from the data source." + }, + "dataSource": { + "type": "string", + "description": "Data source used to extract entity linking, such as Wiki/Bing etc." + }, + "bingId": { + "type": "string", + "description": "Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information." + } + } + }, + "Match": { + "type": "object", + "required": [ + "confidenceScore", + "text", + "offset", + "length" + ], + "properties": { + "confidenceScore": { + "type": "number", + "format": "double", + "description": "If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned." + }, + "text": { + "type": "string", + "description": "Entity text as appears in the request." + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "Start position for the entity match text." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length for the entity match text." + } + } + }, + "KeyPhraseResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentKeyPhrases" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "DocumentKeyPhrases": { + "type": "object", + "required": [ + "id", + "keyPhrases", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "keyPhrases": { + "type": "array", + "description": "A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.", + "items": { + "type": "string" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + } + } + }, + "LanguageBatchInput": { + "type": "object", + "required": [ + "documents" + ], + "properties": { + "documents": { + "type": "array", + "items": { + "$ref": "#/definitions/LanguageInput" + } + } + } + }, + "LanguageInput": { + "type": "object", + "required": [ + "id", + "text" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "text": { + "type": "string" + }, + "countryHint": { + "type": "string" + } + } + }, + "LanguageResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentLanguage" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "DocumentLanguage": { + "type": "object", + "required": [ + "id", + "detectedLanguage", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "detectedLanguage": { + "description": "Detected Language.", + "$ref": "#/definitions/DetectedLanguage" + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + } + } + }, + "DetectedLanguage": { + "type": "object", + "required": [ + "name", + "iso6391Name", + "confidenceScore" + ], + "properties": { + "name": { + "type": "string", + "description": "Long name of a detected language (e.g. English, French)." + }, + "iso6391Name": { + "type": "string", + "description": "A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr)." + }, + "confidenceScore": { + "type": "number", + "format": "double", + "description": "A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." + } + } + } + }, + "parameters": { + "Endpoint": { + "name": "Endpoint", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json new file mode 100644 index 000000000000..75b4489dcb2d --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json @@ -0,0 +1,91 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "language": "en", + "id": "1", + "text": "I had a wonderful trip to Seattle last week." + }, + { + "language": "en", + "id": "2", + "text": "I work at Microsoft." + }, + { + "language": "en", + "id": "3", + "text": "I visited Space Needle 2 times." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "1", + "entities": [ + { + "text": "Seattle", + "category": "Location", + "offset": 26, + "length": 7, + "confidenceScore": 0.80 + }, + { + "text": "last week", + "category": "DateTime", + "subcategory": "DateRange", + "offset": 34, + "length": 9, + "confidenceScore": 0.8 + } + ], + "warnings": [] + }, + { + "id": "2", + "entities": [ + { + "text": "Microsoft", + "category": "Organization", + "offset": 10, + "length": 9, + "confidenceScore": 0.99 + } + ], + "warnings": [] + }, + { + "id": "3", + "entities": [ + { + "text": "Space Needle", + "category": "Organization", + "offset": 10, + "length": 12, + "confidenceScore": 0.75 + }, + { + "text": "2", + "category": "Quantity", + "subcategory": "Number", + "offset": 23, + "length": 1, + "confidenceScore": 0.8 + } + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2019-10-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json new file mode 100644 index 000000000000..2ad23b9ad32c --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json @@ -0,0 +1,101 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "language": "en", + "id": "1", + "text": "I had a wonderful trip to Seattle last week." + }, + { + "language": "en", + "id": "2", + "text": "I work at Microsoft." + }, + { + "language": "en", + "id": "3", + "text": "I visited Space Needle 2 times." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "1", + "entities": [ + { + "name": "Seattle", + "matches": [ + { + "text": "Seattle", + "offset": 26, + "length": 7, + "confidenceScore": 0.15 + } + ], + "language": "en", + "id": "Seattle", + "url": "https://en.wikipedia.org/wiki/Seattle", + "dataSource": "Wikipedia", + "bingId": "39d000e8-389d-22a3-4309-ffffc115d00e" + } + ], + "warnings": [] + }, + { + "id": "2", + "entities": [ + { + "name": "Microsoft", + "matches": [ + { + "text": "Microsoft", + "offset": 10, + "length": 9, + "confidenceScore": 0.18 + } + ], + "language": "en", + "id": "Microsoft", + "url": "https://en.wikipedia.org/wiki/Microsoft", + "dataSource": "Wikipedia", + "bingId": "39d000e8-389d-22a3-4309-ffffc115d00f" + } + ], + "warnings": [] + }, + { + "id": "3", + "entities": [ + { + "name": "Space Needle", + "matches": [ + { + "text": "Space Needle", + "offset": 10, + "length": 12, + "confidenceScore": 0.15 + } + ], + "language": "en", + "id": "Space Needle", + "url": "https://en.wikipedia.org/wiki/Space_Needle", + "dataSource": "Wikipedia" + } + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2019-10-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json new file mode 100644 index 000000000000..70d30744fd02 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json @@ -0,0 +1,78 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "language": "en", + "id": "0", + "text": "Microsoft employee with ssn 859-98-0987 is using our awesome API's." + }, + { + "language": "en", + "id": "1", + "text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check." + }, + { + "language": "en", + "id": "2", + "text": "Is 998.214.865-68 your Brazilian CPF number?" + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "0", + "entities": [ + { + "text": "859-98-0987", + "category": "U.S. Social Security Number (SSN)", + "subcategory": "", + "offset": 28, + "length": 11, + "confidenceScore": 0.65 + } + ], + "warnings": [] + }, + { + "id": "1", + "entities": [ + { + "text": "111000025", + "category": "ABA Routing Number", + "subcategory": "", + "offset": 18, + "length": 9, + "confidenceScore": 0.75 + } + ], + "warnings": [] + }, + { + "id": "2", + "entities": [ + { + "text": "998.214.865-68", + "category": "Brazil CPF Number", + "subcategory": "", + "offset": 3, + "length": 14, + "confidenceScore": 0.85 + } + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2019-10-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json new file mode 100644 index 000000000000..12ff0ccce583 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "language": "en", + "id": "1", + "text": "Hello world. This is some input text that I love." + }, + { + "language": "fr", + "id": "2", + "text": "Bonjour tout le monde" + }, + { + "language": "es", + "id": "3", + "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "1", + "keyPhrases": [ + "world", + "input text" + ], + "warnings": [] + }, + { + "id": "2", + "keyPhrases": [ + "monde" + ], + "warnings": [] + }, + { + "id": "3", + "keyPhrases": [ + "carretera", + "tráfico", + "día" + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2019-10-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json new file mode 100644 index 000000000000..a74d7155c8e0 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "countryHint": "US", + "id": "1", + "text": "Hello world" + }, + { + "id": "2", + "text": "Bonjour tout le monde" + }, + { + "id": "3", + "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "1", + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 1 + }, + "warnings": [] + }, + { + "id": "2", + "detectedLanguage": { + "name": "French", + "iso6391Name": "fr", + "confidenceScore": 1 + }, + "warnings": [] + }, + { + "id": "3", + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 1 + }, + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2019-10-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json new file mode 100644 index 000000000000..ad3fc48d2cae --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json @@ -0,0 +1,323 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "language": "en", + "id": "1", + "text": "Great atmosphere. Close to plenty of restaurants, hotels, and transit! Staff are friendly and helpful." + }, + { + "language": "en", + "id": "2", + "text": "Bad atmosphere. Not close to plenty of restaurants, hotels, and transit! Staff are not friendly and helpful." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "1", + "sentiment": "positive", + "confidenceScores": { + "positive": 1.0, + "neutral": 0.0, + "negative": 0.0 + }, + "sentences": [ + { + "text": "Great atmosphere.", + "sentiment": "positive", + "confidenceScores": { + "positive": 1.0, + "neutral": 0.0, + "negative": 0.0 + }, + "offset": 0, + "length": 17, + "aspects": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 1.0, + "negative": 0.0 + }, + "offset": 6, + "length": 10, + "text": "atmosphere", + "relations": [ + { + "relationType": "opinion", + "ref": "#/documents/0/sentences/0/opinions/0" + } + ] + } + ], + "opinions": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 1.0, + "negative": 0.0 + }, + "offset": 0, + "length": 5, + "text": "great", + "isNegated": false + } + ] + }, + { + "text": "Close to plenty of restaurants, hotels, and transit!", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.13, + "neutral": 0.86, + "negative": 0.01 + }, + "offset": 18, + "length": 52, + "aspects": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "negative": 0.01 + }, + "offset": 37, + "length": 11, + "text": "restaurants", + "relations": [ + { + "relationType": "opinion", + "ref": "#/documents/0/sentences/1/opinions/0" + } + ] + }, + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "negative": 0.01 + }, + "offset": 50, + "length": 6, + "text": "hotels", + "relations": [ + { + "relationType": "opinion", + "ref": "#/documents/0/sentences/1/opinions/0" + } + ] + } + ], + "opinions": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "negative": 0.01 + }, + "offset": 18, + "length": 15, + "text": "close to plenty", + "isNegated": false + } + ] + }, + { + "text": "Staff are friendly and helpful.", + "sentiment": "positive", + "confidenceScores": { + "positive": 1.0, + "neutral": 0.0, + "negative": 0.0 + }, + "offset": 71, + "length": 31, + "aspects": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 1.0, + "negative": 0.0 + }, + "offset": 71, + "length": 5, + "text": "Staff", + "relations": [ + { + "relationType": "opinion", + "ref": "#/documents/0/sentences/2/opinions/0" + } + ] + } + ], + "opinions": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 1.0, + "negative": 0.0 + }, + "offset": 81, + "length": 8, + "text": "friendly", + "isNegated": false + } + ] + } + ], + "warnings": [] + }, + { + "id": "2", + "sentiment": "negative", + "confidenceScores": { + "positive": 0.01, + "neutral": 0.14, + "negative": 0.85 + }, + "sentences": [ + { + "text": "Bad atmosphere.", + "sentiment": "negative", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.0, + "negative": 1.0 + }, + "offset": 8, + "length": 15, + "aspects": [ + { + "sentiment": "negative", + "confidenceScores": { + "positive": 0.01, + "negative": 0.99 + }, + "offset": 4, + "length": 10, + "text": "atmosphere", + "relations": [ + { + "relationType": "opinion", + "ref": "#/documents/1/sentences/0/opinions/0" + } + ] + } + ], + "opinions": [ + { + "sentiment": "negative", + "confidenceScores": { + "positive": 0.01, + "negative": 0.99 + }, + "offset": 0, + "length": 3, + "text": "bad", + "isNegated": false + } + ] + }, + { + "text": "Not close to plenty of restaurants, hotels, and transit!", + "sentiment": "negative", + "confidenceScores": { + "positive": 0.02, + "neutral": 0.44, + "negative": 0.54 + }, + "offset": 16, + "length": 56, + "aspects": [ + { + "sentiment": "negative", + "confidenceScores": { + "positive": 0.03, + "negative": 0.97 + }, + "offset": 39, + "length": 11, + "text": "restaurants", + "relations": [ + { + "relationType": "opinion", + "ref": "#/documents/1/sentences/1/opinions/0" + } + ] + } + ], + "opinions": [ + { + "sentiment": "negative", + "confidenceScores": { + "positive": 0.03, + "negative": 0.97 + }, + "offset": 20, + "length": 5, + "text": "close", + "isNegated": true + } + ] + }, + { + "text": "Staff are not friendly and helpful.", + "sentiment": "negative", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.0, + "negative": 1.0 + }, + "offset": 73, + "length": 35, + "aspects": [ + { + "sentiment": "negative", + "confidenceScores": { + "positive": 0.0, + "negative": 1.0 + }, + "offset": 73, + "length": 5, + "text": "Staff", + "relations": [ + { + "relationType": "opinion", + "ref": "#/documents/1/sentences/2/opinions/0" + } + ] + } + ], + "opinions": [ + { + "sentiment": "negative", + "confidenceScores": { + "positive": 0.0, + "negative": 1.0 + }, + "offset": 87, + "length": 8, + "text": "friendly", + "isNegated": true + } + ] + } + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-04-01" + } + } + } +} From 8983fbba641e431e4d99fbea9c90d883f31b56a1 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Mon, 10 Aug 2020 16:48:31 -0700 Subject: [PATCH 04/20] new preview API v3.1-preview.2 --- .../preview/v2.1/TextAnalytics.json | 82 ++++++------------- 1 file changed, 26 insertions(+), 56 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json index 685fd6e2f57e..34c7948655ea 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json @@ -202,13 +202,13 @@ "200": { "description": "A successful call results in a list of recognized entities returned for each valid document", "schema": { - "$ref": "#/definitions/EntitiesBatchResult" + "$ref": "#/definitions/EntitiesBatchResultV2dot1" } }, "default": { "description": "Error Response", "schema": { - "$ref": "#/definitions/EntitiesErrorResponse" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -339,36 +339,6 @@ } } }, - "EntitiesErrorRecord": { - "type": "object", - "properties": { - "id": { - "description": "Input document unique identifier the error refers to.", - "type": "string" - }, - "message": { - "description": "Error message.", - "type": "string" - } - } - }, - "EntitiesErrorResponse": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "target": { - "type": "string" - }, - "innerError": { - "$ref": "#/definitions/InternalError" - } - } - }, "InternalError": { "type": "object", "properties": { @@ -516,97 +486,97 @@ } } }, - "EntitiesBatchResult": { + "EntitiesBatchResultV2dot1": { "type": "object", "properties": { - "Documents": { + "documents": { "type": "array", "items": { - "$ref": "#/definitions/EntitiesBatchResultItem" + "$ref": "#/definitions/EntitiesBatchResultItemV2dot1" }, "readOnly": true }, - "Errors": { + "errors": { "type": "array", "items": { - "$ref": "#/definitions/EntitiesErrorRecord" + "$ref": "#/definitions/ErrorRecord" }, "readOnly": true } } }, - "EntitiesBatchResultItem": { + "EntitiesBatchResultItemV2dot1": { "type": "object", "properties": { - "Id": { + "id": { "description": "Unique document identifier.", "type": "string", "readOnly": true }, - "Entities": { + "entities": { "description": "Recognized entities in the document.", "type": "array", "items": { - "$ref": "#/definitions/EntityRecord" + "$ref": "#/definitions/EntityRecordV2dot1" }, "readOnly": true } } }, - "EntityRecord": { + "EntityRecordV2dot1": { "type": "object", "properties": { - "Name": { + "name": { "description": "Entity formal name.", "type": "string" }, - "Matches": { + "matches": { "description": "List of instances this entity appears in the text.", "type": "array", "items": { - "$ref": "#/definitions/MatchRecord" + "$ref": "#/definitions/MatchRecordV2dot1" } }, - "WikipediaLanguage": { + "wikipediaLanguage": { "description": "Wikipedia language for which the WikipediaId and WikipediaUrl refers to.", "type": "string" }, - "WikipediaId": { + "wikipediaId": { "description": "Wikipedia unique identifier of the recognized entity.", "type": "string" }, - "WikipediaUrl": { + "wikipediaUrl": { "description": "URL for the entity's English Wikipedia page.", "type": "string", "readOnly": true }, - "BingId": { + "bingId": { "description": "Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information.", "type": "string" }, - "Type": { + "type": { "description": "Entity type from Named Entity Recognition model", "type": "string" }, - "SubType": { + "subType": { "description": "Entity sub type from Named Entity Recognition model", "type": "string" } } }, - "MatchRecord": { + "MatchRecordV2dot1": { "type": "object", "properties": { - "Text": { + "text": { "description": "Entity text as appears in the request.", "type": "string" }, - "Offset": { + "offset": { "format": "int32", "description": "Start position (in Unicode characters) for the entity match text.", "type": "integer" }, - "Length": { + "length": { "format": "int32", "description": "Length (in Unicode characters) for the entity match text.", "type": "integer" @@ -625,4 +595,4 @@ "x-ms-skip-url-encoding": true } } -} +} \ No newline at end of file From 34cf2bdd05939190e0386d65bb4372505e16eb9f Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Mon, 10 Aug 2020 17:31:30 -0700 Subject: [PATCH 05/20] new preview API v3.1-preview.2 --- .../preview/v3.0-preview.1/TextAnalytics.json | 85 +++++++++++++++---- .../preview/v3.1-preview.1/TextAnalytics.json | 85 +++++++++++++++---- .../preview/v3.1-preview.2/TextAnalytics.json | 85 +++++++++++++++---- .../stable/v3.0/TextAnalytics.json | 73 ++++++++++++---- 4 files changed, 259 insertions(+), 69 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json index ce0e51fa4b86..159a3c92319e 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json @@ -77,10 +77,16 @@ "$ref": "#/definitions/EntitiesResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -135,10 +141,16 @@ "$ref": "#/definitions/EntitiesResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -193,10 +205,16 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -251,10 +269,16 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -309,10 +333,16 @@ "$ref": "#/definitions/LanguageResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -367,10 +397,16 @@ "$ref": "#/definitions/SentimentResponse" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -440,6 +476,19 @@ } } }, + "ErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "description": "Document Error.", + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, "TextAnalyticsError": { "type": "object", "required": [ diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json index 6e819d6f04da..5da6ef9887e4 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json @@ -84,10 +84,16 @@ "$ref": "#/definitions/EntitiesResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -155,10 +161,16 @@ "$ref": "#/definitions/EntitiesResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -220,10 +232,16 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -278,10 +296,16 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -336,10 +360,16 @@ "$ref": "#/definitions/LanguageResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -407,10 +437,16 @@ "$ref": "#/definitions/SentimentResponse" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -480,6 +516,19 @@ } } }, + "ErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "description": "Document Error.", + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, "TextAnalyticsError": { "type": "object", "required": [ diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index b519eb8b6d6e..739ef0bf4913 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -84,10 +84,16 @@ "$ref": "#/definitions/EntitiesResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -155,10 +161,16 @@ "$ref": "#/definitions/EntitiesResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -220,10 +232,16 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -278,10 +296,16 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -336,10 +360,16 @@ "$ref": "#/definitions/LanguageResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -407,10 +437,16 @@ "$ref": "#/definitions/SentimentResponse" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -480,6 +516,19 @@ } } }, + "ErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "description": "Document Error.", + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, "TextAnalyticsError": { "type": "object", "required": [ diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json index 2d566abbda19..50a62c8f80bb 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json @@ -77,10 +77,16 @@ "$ref": "#/definitions/EntitiesResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -135,10 +141,16 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -193,10 +205,16 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -251,10 +269,16 @@ "$ref": "#/definitions/LanguageResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -309,10 +333,16 @@ "$ref": "#/definitions/SentimentResponse" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } }, @@ -382,6 +412,19 @@ } } }, + "ErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "description": "Document Error.", + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, "TextAnalyticsError": { "type": "object", "required": [ From d0d866fce3e26a678e39b2afba63a4f17afc804e Mon Sep 17 00:00:00 2001 From: Thaminda Edirisooriya Date: Wed, 12 Aug 2020 11:34:15 -0700 Subject: [PATCH 06/20] Add the changes to the swagger --- .../preview/v3.1-preview.1/TextAnalytics.json | 16 ++++++--- .../preview/v3.1-preview.2/TextAnalytics.json | 33 +++++++++++++++---- .../examples/SuccessfulEntityPIIRequest.json | 9 +++-- 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json index 5da6ef9887e4..e83f88f20278 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json @@ -64,7 +64,9 @@ "name": "stringIndexType", "in": "query", "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "boolean", + "type": "string", + "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], + "default" : "textelement_v8", "required": false }, { @@ -135,7 +137,9 @@ "name": "stringIndexType", "in": "query", "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "boolean", + "type": "string", + "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], + "default" : "textelement_v8", "required": false }, { @@ -212,7 +216,9 @@ "name": "stringIndexType", "in": "query", "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "boolean", + "type": "string", + "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], + "default" : "textelement_v8", "required": false }, { @@ -411,7 +417,9 @@ "name": "stringIndexType", "in": "query", "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "boolean", + "type": "string", + "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], + "default" : "textelement_v8", "required": false }, { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index 739ef0bf4913..abd2f8fac01d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -64,7 +64,9 @@ "name": "stringIndexType", "in": "query", "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "boolean", + "type": "string", + "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], + "default" : "textelement_v8", "required": false }, { @@ -107,7 +109,7 @@ }, "/entities/recognition/pii": { "post": { - "summary": "Entities containing personal information", + "summary": " Named Entity Recognition (NER) and Redaction of Personal Identifiable Information (PII)", "description": "The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.\n", "operationId": "EntitiesRecognitionPii", "consumes": [ @@ -135,7 +137,9 @@ "name": "stringIndexType", "in": "query", "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "boolean", + "type": "string", + "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], + "default" : "textelement_v8", "required": false }, { @@ -158,7 +162,7 @@ "200": { "description": "A successful call results in a list of entities containing personal information returned for each valid document", "schema": { - "$ref": "#/definitions/EntitiesResult" + "$ref": "#/definitions/PiiResult" } }, "400": { @@ -212,7 +216,9 @@ "name": "stringIndexType", "in": "query", "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "boolean", + "type": "string", + "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], + "default" : "textelement_v8", "required": false }, { @@ -411,7 +417,9 @@ "name": "stringIndexType", "in": "query", "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "boolean", + "type": "string", + "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], + "default" : "textelement_v8", "required": false }, { @@ -991,6 +999,19 @@ }, "description": "Represents the confidence scores across all sentiment classes: positive, neutral, negative." }, + "PiiResult" : { + "allOf" : [ { + "$ref" : "#/definitions/EntitiesResult" + }, { + "type" : "object", + "required" : [ "redactedText" ], + "properties" : { + "redactedText" : { + "type" : "string" + } + } + } ] + }, "EntitiesResult": { "type": "object", "required": [ diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json index 70d30744fd02..02cb1b414b7c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json @@ -36,7 +36,8 @@ "subcategory": "", "offset": 28, "length": 11, - "confidenceScore": 0.65 + "confidenceScore": 0.65, + "redactedText" : "Microsoft employee with ssn *********** is using our awesome API's." } ], "warnings": [] @@ -50,7 +51,8 @@ "subcategory": "", "offset": 18, "length": 9, - "confidenceScore": 0.75 + "confidenceScore": 0.75, + "redactedText": "Your ABA number - ********* - is the first 9 digits in the lower left hand corner of your personal check." } ], "warnings": [] @@ -64,7 +66,8 @@ "subcategory": "", "offset": 3, "length": 14, - "confidenceScore": 0.85 + "confidenceScore": 0.85, + "redactedText": "Is ************** your Brazilian CPF number?" } ], "warnings": [] From 60d2534c5b6bed3e7167545724590dc593d42d9a Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Wed, 12 Aug 2020 11:55:33 -0700 Subject: [PATCH 07/20] new preview API --- .../cognitiveservices/data-plane/TextAnalytics/readme.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index 3cad53b7f8b5..441e055ee4d0 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -170,6 +170,14 @@ These settings apply only when `--tag=release_3_1_preview.1` is specified on the input-file: preview/v3.1-preview.1/TextAnalytics.json ``` +### Release 3.1-Preview.2 + +These settings apply only when `--tag=release_3_1_preview.2` is specified on the command line. + +``` yaml $(tag) == 'release_3_1_preview.2' +input-file: preview/v3.1-preview.2/TextAnalytics.json +``` + ## Swagger to SDK This section describes what SDK should be generated by the automatic system. @@ -268,6 +276,7 @@ input-file: - $(this-folder)/preview/v3.0-preview.1/TextAnalytics.json - $(this-folder)/stable/v3.0/TextAnalytics.json - $(this-folder)/preview/v3.1-preview.1/TextAnalytics.json + - $(this-folder)/preview/v3.1-preview.2/TextAnalytics.json ``` From a55e796bc7b4c5971274c5e81aee401139cc4e8e Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Wed, 12 Aug 2020 16:50:59 -0700 Subject: [PATCH 08/20] sync with v3.2-preview.1 API conventions --- .../preview/v3.1-preview.1/TextAnalytics.json | 259 ++++++++---------- .../examples/SuccessfulEntitiesRequest.json | 22 ++ .../SuccessfulEntityLinkingRequest.json | 22 ++ .../examples/SuccessfulEntityPIIRequest.json | 22 ++ .../examples/SuccessfulKeyPhrasesRequest.json | 22 ++ .../examples/SuccessfulLanguagesRequest.json | 22 ++ .../examples/SuccessfulSentimentRequest.json | 22 ++ .../preview/v3.1-preview.2/TextAnalytics.json | 259 ++++++++---------- .../examples/SuccessfulEntitiesRequest.json | 22 ++ .../SuccessfulEntityLinkingRequest.json | 22 ++ .../examples/SuccessfulEntityPIIRequest.json | 22 ++ .../examples/SuccessfulKeyPhrasesRequest.json | 22 ++ .../examples/SuccessfulLanguagesRequest.json | 22 ++ .../examples/SuccessfulSentimentRequest.json | 22 ++ 14 files changed, 504 insertions(+), 278 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json index e83f88f20278..b4855cbf69ce 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json @@ -47,36 +47,16 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "required": false, - "type": "string" + "$ref": "#/parameters/ModelVersion" }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean", - "required": false + "$ref": "#/parameters/ShowStats" }, { - "name": "stringIndexType", - "in": "query", - "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "string", - "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], - "default" : "textelement_v8", - "required": false + "$ref": "#/parameters/MultiLanguageInput" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/StringIndexType" } ], "responses": { @@ -122,25 +102,10 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string" - }, - { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean" + "$ref": "#/parameters/ModelVersion" }, { - "name": "stringIndexType", - "in": "query", - "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "string", - "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], - "default" : "textelement_v8", - "required": false + "$ref": "#/parameters/ShowStats" }, { "name": "domain", @@ -149,13 +114,10 @@ "type": "string" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" } ], "responses": { @@ -201,34 +163,16 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string" + "$ref": "#/parameters/ModelVersion" }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean" + "$ref": "#/parameters/ShowStats" }, { - "name": "stringIndexType", - "in": "query", - "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "string", - "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], - "default" : "textelement_v8", - "required": false + "$ref": "#/parameters/MultiLanguageInput" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/StringIndexType" } ], "responses": { @@ -274,25 +218,13 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string" + "$ref": "#/parameters/ModelVersion" }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean" + "$ref": "#/parameters/ShowStats" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze. Documents can now contain a language field to indicate the text language", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -338,25 +270,13 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string" + "$ref": "#/parameters/ModelVersion" }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean" + "$ref": "#/parameters/ShowStats" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/LanguageBatchInput" - } + "$ref": "#/parameters/LanguageInput" } ], "responses": { @@ -402,25 +322,10 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string" + "$ref": "#/parameters/ModelVersion" }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean" - }, - { - "name": "stringIndexType", - "in": "query", - "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "string", - "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], - "default" : "textelement_v8", - "required": false + "$ref": "#/parameters/ShowStats" }, { "name": "opinionMining", @@ -429,13 +334,10 @@ "type": "boolean" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" } ], "responses": { @@ -547,10 +449,10 @@ "code": { "type": "string", "enum": [ - "invalidRequest", - "invalidArgument", - "internalServerError", - "serviceUnavailable" + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable" ], "x-ms-enum": { "name": "ErrorCodeValue", @@ -594,7 +496,7 @@ ], "x-ms-enum": { "name": "WarningCodeValue", - "modelAsString": false + "modelAsString": true }, "description": "Error code." }, @@ -618,19 +520,19 @@ "code": { "type": "string", "enum": [ - "invalidParameterValue", - "invalidRequestBodyFormat", - "emptyRequest", - "missingInputRecords", - "invalidDocument", - "modelVersionIncorrect", - "invalidDocumentBatch", - "unsupportedLanguageCode", - "invalidCountryHint" + "InvalidParameterValue", + "InvalidRequestBodyFormat", + "EmptyRequest", + "MissingInputRecords", + "InvalidDocument", + "ModelVersionIncorrect", + "InvalidDocumentBatch", + "UnsupportedLanguageCode", + "InvalidCountryHint" ], "x-ms-enum": { "name": "InnerErrorCodeValue", - "modelAsString": false + "modelAsString": true }, "description": "Error code." }, @@ -887,6 +789,10 @@ "mixed", "negative" ], + "x-ms-enum": { + "name": "TokenSentimentValue", + "modelAsString": false + }, "description": "Aspect level sentiment for the aspect in the sentence." }, "confidenceScores": { @@ -934,6 +840,10 @@ "mixed", "negative" ], + "x-ms-enum": { + "name": "TokenSentimentValue", + "modelAsString": false + }, "description": "Opinion level sentiment for the aspect in the sentence." }, "confidenceScores": { @@ -973,6 +883,10 @@ "opinion", "aspect" ], + "x-ms-enum": { + "name": "AspectRelationType", + "modelAsString": false + }, "description": "The type related to the aspect." }, "ref": { @@ -1422,6 +1336,73 @@ "type": "string", "in": "path", "x-ms-skip-url-encoding": true + }, + "StringIndexType": { + "name": "stringIndexType", + "in": "query", + "type": "string", + "description": "(Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets", + "default": "TextElements_v8", + "enum": [ + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" + ], + "x-ms-enum": { + "name": "StringIndexType", + "modelAsString": false, + "values": [ + { + "value": "TextElements_v8", + "description": "Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." + }, + { + "value": "UnicodeCodePoint", + "description": "Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." + }, + { + "value": "Utf16CodeUnit", + "description": "Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." + } + ] + }, + "x-ms-parameter-location": "client" + }, + "ShowStats": { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain request and document level statistics.", + "type": "boolean", + "required": false, + "x-ms-parameter-location": "method" + }, + "ModelVersion": { + "name": "model-version", + "in": "query", + "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type": "string", + "required": false, + "x-ms-parameter-location": "method" + }, + "MultiLanguageInput": { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + }, + "x-ms-parameter-location": "method" + }, + "LanguageInput": { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze for language endpoint.", + "required": true, + "schema": { + "$ref": "#/definitions/LanguageBatchInput" + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json index 75b4489dcb2d..38f75c3f16b9 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json @@ -86,6 +86,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityLinkingRequest.json index caf12d36bc11..09cb2c7a9495 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -94,6 +94,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json index 70d30744fd02..cc07cabf32ba 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -73,6 +73,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json index 12ff0ccce583..6de512d13179 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -55,6 +55,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulLanguagesRequest.json index a74d7155c8e0..f5e67806fac5 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulLanguagesRequest.json @@ -56,6 +56,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulSentimentRequest.json index ad3fc48d2cae..e01a3f42a372 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulSentimentRequest.json @@ -318,6 +318,28 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index abd2f8fac01d..67d8c38d3111 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -47,36 +47,16 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "required": false, - "type": "string" + "$ref": "#/parameters/ModelVersion" }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean", - "required": false + "$ref": "#/parameters/ShowStats" }, { - "name": "stringIndexType", - "in": "query", - "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "string", - "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], - "default" : "textelement_v8", - "required": false + "$ref": "#/parameters/MultiLanguageInput" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/StringIndexType" } ], "responses": { @@ -122,25 +102,10 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string" - }, - { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean" + "$ref": "#/parameters/ModelVersion" }, { - "name": "stringIndexType", - "in": "query", - "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "string", - "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], - "default" : "textelement_v8", - "required": false + "$ref": "#/parameters/ShowStats" }, { "name": "domain", @@ -149,13 +114,10 @@ "type": "string" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" } ], "responses": { @@ -201,34 +163,16 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string" + "$ref": "#/parameters/ModelVersion" }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean" + "$ref": "#/parameters/ShowStats" }, { - "name": "stringIndexType", - "in": "query", - "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "string", - "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], - "default" : "textelement_v8", - "required": false + "$ref": "#/parameters/MultiLanguageInput" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/StringIndexType" } ], "responses": { @@ -274,25 +218,13 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string" + "$ref": "#/parameters/ModelVersion" }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean" + "$ref": "#/parameters/ShowStats" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze. Documents can now contain a language field to indicate the text language", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -338,25 +270,13 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string" + "$ref": "#/parameters/ModelVersion" }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean" + "$ref": "#/parameters/ShowStats" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/LanguageBatchInput" - } + "$ref": "#/parameters/LanguageInput" } ], "responses": { @@ -402,25 +322,10 @@ ], "parameters": [ { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string" + "$ref": "#/parameters/ModelVersion" }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "type": "boolean" - }, - { - "name": "stringIndexType", - "in": "query", - "description": "(Optional) This value indicates the index type for which the offsets have to be returned.", - "type": "string", - "enum" : [ "textelement_v8", "unicodecodepoint", "utf16codeunit" ], - "default" : "textelement_v8", - "required": false + "$ref": "#/parameters/ShowStats" }, { "name": "opinionMining", @@ -429,13 +334,10 @@ "type": "boolean" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" } ], "responses": { @@ -547,10 +449,10 @@ "code": { "type": "string", "enum": [ - "invalidRequest", - "invalidArgument", - "internalServerError", - "serviceUnavailable" + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable" ], "x-ms-enum": { "name": "ErrorCodeValue", @@ -594,7 +496,7 @@ ], "x-ms-enum": { "name": "WarningCodeValue", - "modelAsString": false + "modelAsString": true }, "description": "Error code." }, @@ -618,19 +520,19 @@ "code": { "type": "string", "enum": [ - "invalidParameterValue", - "invalidRequestBodyFormat", - "emptyRequest", - "missingInputRecords", - "invalidDocument", - "modelVersionIncorrect", - "invalidDocumentBatch", - "unsupportedLanguageCode", - "invalidCountryHint" + "InvalidParameterValue", + "InvalidRequestBodyFormat", + "EmptyRequest", + "MissingInputRecords", + "InvalidDocument", + "ModelVersionIncorrect", + "InvalidDocumentBatch", + "UnsupportedLanguageCode", + "InvalidCountryHint" ], "x-ms-enum": { "name": "InnerErrorCodeValue", - "modelAsString": false + "modelAsString": true }, "description": "Error code." }, @@ -887,6 +789,10 @@ "mixed", "negative" ], + "x-ms-enum": { + "name": "TokenSentimentValue", + "modelAsString": false + }, "description": "Aspect level sentiment for the aspect in the sentence." }, "confidenceScores": { @@ -934,6 +840,10 @@ "mixed", "negative" ], + "x-ms-enum": { + "name": "TokenSentimentValue", + "modelAsString": false + }, "description": "Opinion level sentiment for the aspect in the sentence." }, "confidenceScores": { @@ -973,6 +883,10 @@ "opinion", "aspect" ], + "x-ms-enum": { + "name": "AspectRelationType", + "modelAsString": false + }, "description": "The type related to the aspect." }, "ref": { @@ -1439,6 +1353,73 @@ "type": "string", "in": "path", "x-ms-skip-url-encoding": true + }, + "StringIndexType": { + "name": "stringIndexType", + "in": "query", + "type": "string", + "description": "(Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets", + "default": "TextElements_v8", + "enum": [ + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" + ], + "x-ms-enum": { + "name": "StringIndexType", + "modelAsString": false, + "values": [ + { + "value": "TextElements_v8", + "description": "Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." + }, + { + "value": "UnicodeCodePoint", + "description": "Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." + }, + { + "value": "Utf16CodeUnit", + "description": "Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." + } + ] + }, + "x-ms-parameter-location": "client" + }, + "ShowStats": { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain request and document level statistics.", + "type": "boolean", + "required": false, + "x-ms-parameter-location": "method" + }, + "ModelVersion": { + "name": "model-version", + "in": "query", + "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type": "string", + "required": false, + "x-ms-parameter-location": "method" + }, + "MultiLanguageInput": { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + }, + "x-ms-parameter-location": "method" + }, + "LanguageInput": { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze for language endpoint.", + "required": true, + "schema": { + "$ref": "#/definitions/LanguageBatchInput" + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json index 75b4489dcb2d..38f75c3f16b9 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json @@ -86,6 +86,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json index 2ad23b9ad32c..fa894d4df480 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json @@ -96,6 +96,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json index 02cb1b414b7c..cc858cbbe146 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json @@ -76,6 +76,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json index 12ff0ccce583..6de512d13179 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json @@ -55,6 +55,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json index a74d7155c8e0..f5e67806fac5 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json @@ -56,6 +56,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json index ad3fc48d2cae..e01a3f42a372 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json @@ -318,6 +318,28 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } From 4fdcf687afd15a58a34c9a1bb7a9fa74cbbc5feb Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Wed, 12 Aug 2020 17:24:36 -0700 Subject: [PATCH 09/20] fix build issues --- .../examples/SuccessfulEntitiesRequest.json | 22 + .../SuccessfulEntityLinkingRequest.json | 22 + .../examples/SuccessfulEntityPIIRequest.json | 22 + .../examples/SuccessfulKeyPhrasesRequest.json | 22 + .../examples/SuccessfulLanguagesRequest.json | 22 + .../examples/SuccessfulSentimentRequest.json | 22 + .../preview/v3.1-preview.2/TextAnalytics.json | 2787 +++++++++-------- 7 files changed, 1529 insertions(+), 1390 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json index babd6e22d296..97d1a8aaec0d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json @@ -83,6 +83,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json index c58af39167b9..9709a41c600f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -91,6 +91,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json index 29cba30d10b6..46eb4004b367 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -70,6 +70,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json index 4a61dd56c123..61f275a5d872 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -52,6 +52,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json index 071bf51ea8c9..5cd93699e05f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json @@ -59,6 +59,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json index a61d236644d0..501baf123e18 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json @@ -114,6 +114,28 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index 67d8c38d3111..f361e9a76d7f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -1,1425 +1,1432 @@ { - "swagger": "2.0", - "info": { - "version": "v3.1-preview.2", - "contact": { - "name": "Microsoft Cognitive Services", - "url": "https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", - "email": "mlapi@microsoft.com" - }, - "title": "Text Analytics Client", - "description": "The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" - }, - "securityDefinitions": { - "apim_key": { - "type": "apiKey", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" - } - }, - "security": [ - { - "apim_key": [] - } - ], - "x-ms-parameterized-host": { - "hostTemplate": "{Endpoint}/text/analytics/v3.1-preview.1", - "useSchemePrefix": false, - "parameters": [ + "swagger":"2.0", + "info":{ + "version":"v3.1-preview.2", + "contact":{ + "name":"Microsoft Cognitive Services", + "url":"https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", + "email":"mlapi@microsoft.com" + }, + "title":"Text Analytics Client", + "description":"The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" + }, + "securityDefinitions":{ + "apim_key":{ + "type":"apiKey", + "name":"Ocp-Apim-Subscription-Key", + "in":"header" + } + }, + "security":[ { - "$ref": "#/parameters/Endpoint" + "apim_key":[ + + ] } - ] - }, - "paths": { - "/entities/recognition/general": { - "post": { - "summary": "Named Entity Recognition", - "description": "The API returns a list of general named entities in a given document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId": "EntitiesRecognitionGeneral", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "$ref": "#/parameters/MultiLanguageInput" - }, - { - "$ref": "#/parameters/StringIndexType" - } - ], - "responses": { - "200": { - "description": "A successful call results in a list of recognized entities returned for each valid document.", - "schema": { - "$ref": "#/definitions/EntitiesResult" + ], + "x-ms-parameterized-host":{ + "hostTemplate":"{Endpoint}/text/analytics/v3.1-preview.1", + "useSchemePrefix":false, + "parameters":[ + { + "$ref":"#/parameters/Endpoint" + } + ] + }, + "paths":{ + "/entities/recognition/general":{ + "post":{ + "summary":"Named Entity Recognition", + "description":"The API returns a list of general named entities in a given document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId":"EntitiesRecognitionGeneral", + "consumes":[ + "application/json", + "text/json" + ], + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "$ref":"#/parameters/MultiLanguageInput" + }, + { + "$ref":"#/parameters/StringIndexType" + } + ], + "responses":{ + "200":{ + "description":"A successful call results in a list of recognized entities returned for each valid document.", + "schema":{ + "$ref":"#/definitions/EntitiesResult" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Entities request":{ + "$ref":".//examples//SuccessfulEntitiesRequest.json" + } + }, + "deprecated":false + } + }, + "/entities/recognition/pii":{ + "post":{ + "summary":"Named Entity Recognition (NER) and Redaction of Personal Identifiable Information (PII)", + "description":"The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.\n", + "operationId":"EntitiesRecognitionPii", + "consumes":[ + "application/json", + "text/json" + ], + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "name":"domain", + "in":"query", + "description":"(Optional) if set to 'PHI', response will contain only PHI entities.", + "type":"string" + }, + { + "$ref":"#/parameters/MultiLanguageInput" + }, + { + "$ref":"#/parameters/StringIndexType" + } + ], + "responses":{ + "200":{ + "description":"A successful call results in a list of entities containing personal information returned for each valid document", + "schema":{ + "$ref":"#/definitions/PiiResult" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Entity PII request":{ + "$ref":".//examples//SuccessfulEntityPIIRequest.json" + } + }, + "deprecated":false + } + }, + "/entities/linking":{ + "post":{ + "summary":"Linked entities from a well-known knowledge base", + "description":"The API returns a list of recognized entities with links to a well-known knowledge base. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId":"EntitiesLinking", + "consumes":[ + "application/json", + "text/json" + ], + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "$ref":"#/parameters/MultiLanguageInput" + }, + { + "$ref":"#/parameters/StringIndexType" + } + ], + "responses":{ + "200":{ + "description":"A successful call results in a list of recognized entities with links to a well-known knowledge base returned for each valid document", + "schema":{ + "$ref":"#/definitions/EntityLinkingResult" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Entity Linking request":{ + "$ref":".//examples//SuccessfulEntityLinkingRequest.json" + } + }, + "deprecated":false + } + }, + "/keyPhrases":{ + "post":{ + "summary":"Key Phrases", + "description":"The API returns a list of strings denoting the key phrases in the input text. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId":"KeyPhrases", + "consumes":[ + "application/json", + "text/json" + ], + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "$ref":"#/parameters/MultiLanguageInput" + } + ], + "responses":{ + "200":{ + "description":"A successful response results in 0 or more key phrases identified in each valid document", + "schema":{ + "$ref":"#/definitions/KeyPhraseResult" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Key Phrase request":{ + "$ref":".//examples//SuccessfulKeyPhrasesRequest.json" + } + }, + "deprecated":false + } + }, + "/languages":{ + "post":{ + "summary":"Detect Language", + "description":"The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId":"Languages", + "consumes":[ + "application/json", + "text/json" + ], + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "$ref":"#/parameters/LanguageInput" + } + ], + "responses":{ + "200":{ + "description":"A successful call results in the detected language with the highest probability for each valid document", + "schema":{ + "$ref":"#/definitions/LanguageResult" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Detect Language request":{ + "$ref":".//examples//SuccessfulLanguagesRequest.json" + } + }, + "deprecated":false + } + }, + "/sentiment":{ + "post":{ + "summary":"Sentiment", + "description":"The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple levels of granularity, start from the a document level, down to sentence and key terms (aspects) and opinions.", + "operationId":"Sentiment", + "consumes":[ + "application/json", + "text/json" + ], + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "name":"opinionMining", + "in":"query", + "description":"(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", + "type":"boolean" + }, + { + "$ref":"#/parameters/MultiLanguageInput" + }, + { + "$ref":"#/parameters/StringIndexType" + } + ], + "responses":{ + "200":{ + "description":"A successful call results in a document sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral)", + "schema":{ + "$ref":"#/definitions/SentimentResponse" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Sentiment request":{ + "$ref":".//examples//SuccessfulSentimentRequest.json" + } + }, + "deprecated":false + } + } + }, + "definitions":{ + "MultiLanguageBatchInput":{ + "type":"object", + "required":[ + "documents" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"The set of documents to process as part of this batch.", + "items":{ + "$ref":"#/definitions/MultiLanguageInput" + } } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" + }, + "description":"Contains a set of input documents to be analyzed by the service." + }, + "MultiLanguageInput":{ + "type":"object", + "required":[ + "id", + "text" + ], + "properties":{ + "id":{ + "type":"string", + "description":"A unique, non-empty document identifier." + }, + "text":{ + "type":"string", + "description":"The input text to process." + }, + "language":{ + "type":"string", + "description":"(Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default." } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" + }, + "description":"Contains an input document to be analyzed by the service." + }, + "DocumentError":{ + "type":"object", + "required":[ + "id", + "error" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Document Id." + }, + "error":{ + "type":"object", + "description":"Document Error.", + "$ref":"#/definitions/TextAnalyticsError" } - } - }, - "x-ms-examples": { - "Successful Entities request": { - "$ref": ".//examples//SuccessfulEntitiesRequest.json" - } - }, - "deprecated": false - } - }, - "/entities/recognition/pii": { - "post": { - "summary": " Named Entity Recognition (NER) and Redaction of Personal Identifiable Information (PII)", - "description": "The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.\n", - "operationId": "EntitiesRecognitionPii", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "name": "domain", - "in": "query", - "description": "(Optional) if set to 'PHI', response will contain only PHI entities.", - "type": "string" - }, - { - "$ref": "#/parameters/MultiLanguageInput" - }, - { - "$ref": "#/parameters/StringIndexType" - } - ], - "responses": { - "200": { - "description": "A successful call results in a list of entities containing personal information returned for each valid document", - "schema": { - "$ref": "#/definitions/PiiResult" + } + }, + "ErrorResponse":{ + "type":"object", + "required":[ + "error" + ], + "properties":{ + "error":{ + "type":"object", + "description":"Document Error.", + "$ref":"#/definitions/TextAnalyticsError" } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" + } + }, + "TextAnalyticsError":{ + "type":"object", + "required":[ + "code", + "message" + ], + "properties":{ + "code":{ + "type":"string", + "enum":[ + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable" + ], + "x-ms-enum":{ + "name":"ErrorCodeValue", + "modelAsString":false + }, + "description":"Error code." + }, + "message":{ + "type":"string", + "description":"Error message." + }, + "target":{ + "type":"string", + "description":"Error target." + }, + "innererror":{ + "$ref":"#/definitions/InnerError", + "description":"Inner error contains more specific information." + }, + "details":{ + "type":"array", + "description":"Details about specific errors that led to this reported error.", + "items":{ + "$ref":"#/definitions/TextAnalyticsError" + } } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" + } + }, + "TextAnalyticsWarning":{ + "type":"object", + "required":[ + "code", + "message" + ], + "properties":{ + "code":{ + "type":"string", + "enum":[ + "LongWordsInDocument", + "DocumentTruncated" + ], + "x-ms-enum":{ + "name":"WarningCodeValue", + "modelAsString":true + }, + "description":"Error code." + }, + "message":{ + "type":"string", + "description":"Warning message." + }, + "targetRef":{ + "type":"string", + "description":"A JSON pointer reference indicating the target object." } - } - }, - "x-ms-examples": { - "Successful Entity PII request": { - "$ref": ".//examples//SuccessfulEntityPIIRequest.json" - } - }, - "deprecated": false - } - }, - "/entities/linking": { - "post": { - "summary": "Linked entities from a well-known knowledge base", - "description": "The API returns a list of recognized entities with links to a well-known knowledge base. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId": "EntitiesLinking", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "$ref": "#/parameters/MultiLanguageInput" - }, - { - "$ref": "#/parameters/StringIndexType" - } - ], - "responses": { - "200": { - "description": "A successful call results in a list of recognized entities with links to a well-known knowledge base returned for each valid document", - "schema": { - "$ref": "#/definitions/EntityLinkingResult" + } + }, + "InnerError":{ + "type":"object", + "required":[ + "code", + "message" + ], + "properties":{ + "code":{ + "type":"string", + "enum":[ + "InvalidParameterValue", + "InvalidRequestBodyFormat", + "EmptyRequest", + "MissingInputRecords", + "InvalidDocument", + "ModelVersionIncorrect", + "InvalidDocumentBatch", + "UnsupportedLanguageCode", + "InvalidCountryHint" + ], + "x-ms-enum":{ + "name":"InnerErrorCodeValue", + "modelAsString":true + }, + "description":"Error code." + }, + "message":{ + "type":"string", + "description":"Error message." + }, + "details":{ + "type":"object", + "additionalProperties":{ + "type":"string" + }, + "description":"Error details." + }, + "target":{ + "type":"string", + "description":"Error target." + }, + "innererror":{ + "$ref":"#/definitions/InnerError", + "description":"Inner error contains more specific information." } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" + } + }, + "SentimentResponse":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Sentiment analysis per document.", + "items":{ + "$ref":"#/definitions/DocumentSentiment" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" + } + }, + "DocumentSentiment":{ + "type":"object", + "required":[ + "id", + "sentiment", + "confidenceScores", + "sentences", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "sentiment":{ + "type":"string", + "description":"Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).", + "enum":[ + "positive", + "neutral", + "negative", + "mixed" + ], + "x-ms-enum":{ + "name":"DocumentSentimentValue", + "modelAsString":false + } + }, + "statistics":{ + "$ref":"#/definitions/DocumentStatistics" + }, + "confidenceScores":{ + "description":"Document level sentiment confidence scores between 0 and 1 for each sentiment class.", + "$ref":"#/definitions/SentimentConfidenceScorePerLabel" + }, + "sentences":{ + "type":"array", + "description":"Sentence level sentiment analysis.", + "items":{ + "$ref":"#/definitions/SentenceSentiment" + } + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } } - } - }, - "x-ms-examples": { - "Successful Entity Linking request": { - "$ref": ".//examples//SuccessfulEntityLinkingRequest.json" - } - }, - "deprecated": false - } - }, - "/keyPhrases": { - "post": { - "summary": "Key Phrases", - "description": "The API returns a list of strings denoting the key phrases in the input text. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId": "KeyPhrases", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "$ref": "#/parameters/MultiLanguageInput" - } - ], - "responses": { - "200": { - "description": "A successful response results in 0 or more key phrases identified in each valid document", - "schema": { - "$ref": "#/definitions/KeyPhraseResult" + } + }, + "RequestStatistics":{ + "type":"object", + "required":[ + "documentsCount", + "validDocumentsCount", + "erroneousDocumentsCount", + "transactionsCount" + ], + "properties":{ + "documentsCount":{ + "type":"integer", + "format":"int32", + "description":"Number of documents submitted in the request." + }, + "validDocumentsCount":{ + "type":"integer", + "format":"int32", + "description":"Number of valid documents. This excludes empty, over-size limit or non-supported languages documents." + }, + "erroneousDocumentsCount":{ + "type":"integer", + "format":"int32", + "description":"Number of invalid documents. This includes empty, over-size limit or non-supported languages documents." + }, + "transactionsCount":{ + "type":"integer", + "format":"int64", + "description":"Number of transactions for the request." } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" + }, + "description":"if showStats=true was specified in the request this field will contain information about the request payload." + }, + "DocumentStatistics":{ + "type":"object", + "required":[ + "charactersCount", + "transactionsCount" + ], + "properties":{ + "charactersCount":{ + "type":"integer", + "format":"int32", + "description":"Number of text elements recognized in the document." + }, + "transactionsCount":{ + "type":"integer", + "format":"int32", + "description":"Number of transactions for the document." } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" + }, + "description":"if showStats=true was specified in the request this field will contain information about the document payload." + }, + "SentimentConfidenceScorePerLabel":{ + "type":"object", + "required":[ + "positive", + "neutral", + "negative" + ], + "properties":{ + "positive":{ + "type":"number", + "format":"double" + }, + "neutral":{ + "type":"number", + "format":"double" + }, + "negative":{ + "type":"number", + "format":"double" } - } - }, - "x-ms-examples": { - "Successful Key Phrase request": { - "$ref": ".//examples//SuccessfulKeyPhrasesRequest.json" - } - }, - "deprecated": false - } - }, - "/languages": { - "post": { - "summary": "Detect Language", - "description": "The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId": "Languages", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "$ref": "#/parameters/LanguageInput" - } - ], - "responses": { - "200": { - "description": "A successful call results in the detected language with the highest probability for each valid document", - "schema": { - "$ref": "#/definitions/LanguageResult" + }, + "description":"Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative." + }, + "SentenceSentiment":{ + "type":"object", + "required":[ + "text", + "sentiment", + "confidenceScores", + "offset", + "length" + ], + "properties":{ + "text":{ + "type":"string", + "description":"The sentence text." + }, + "sentiment":{ + "type":"string", + "description":"The predicted Sentiment for the sentence.", + "enum":[ + "positive", + "neutral", + "negative" + ], + "x-ms-enum":{ + "name":"SentenceSentimentValue", + "modelAsString":false + } + }, + "confidenceScores":{ + "description":"The sentiment confidence score between 0 and 1 for the sentence for all classes.", + "$ref":"#/definitions/SentimentConfidenceScorePerLabel" + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"The sentence offset from the start of the document." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"The length of the sentence." + }, + "aspects":{ + "type":"array", + "description":"The array of aspect object for the sentence.", + "items":{ + "$ref":"#/definitions/SentenceAspect" + } + }, + "opinions":{ + "type":"array", + "description":"The array of opinion object for the sentence.", + "items":{ + "$ref":"#/definitions/SentenceOpinion" + } } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" + } + }, + "SentenceAspect":{ + "type":"object", + "required":[ + "confidenceScores", + "length", + "offset", + "relations", + "sentiment", + "text" + ], + "properties":{ + "sentiment":{ + "type":"string", + "enum":[ + "positive", + "mixed", + "negative" + ], + "x-ms-enum":{ + "name":"TokenSentimentValue", + "modelAsString":false + }, + "description":"Aspect level sentiment for the aspect in the sentence." + }, + "confidenceScores":{ + "description":"Aspect level sentiment confidence scores for the aspect in the sentence.", + "$ref":"#/definitions/AspectConfidenceScoreLabel" + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"The aspect offset from the start of the sentence." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"The length of the aspect." + }, + "text":{ + "type":"string", + "description":"The aspect text detected." + }, + "relations":{ + "type":"array", + "description":"The array of either opinion or aspect object which is related to the aspect.", + "items":{ + "$ref":"#/definitions/AspectRelation" + } } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" + } + }, + "SentenceOpinion":{ + "type":"object", + "required":[ + "confidenceScores", + "isNegated", + "length", + "offset", + "sentiment", + "text" + ], + "properties":{ + "sentiment":{ + "type":"string", + "enum":[ + "positive", + "mixed", + "negative" + ], + "x-ms-enum":{ + "name":"TokenSentimentValue", + "modelAsString":false + }, + "description":"Opinion level sentiment for the aspect in the sentence." + }, + "confidenceScores":{ + "description":"Opinion level sentiment confidence scores for the aspect in the sentence.", + "$ref":"#/definitions/AspectConfidenceScoreLabel" + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"The opinion offset from the start of the sentence." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"The length of the opinion." + }, + "text":{ + "type":"string", + "description":"The aspect text detected." + }, + "isNegated":{ + "type":"boolean", + "description":"The indicator representing if the opinion is negated." } - } - }, - "x-ms-examples": { - "Successful Detect Language request": { - "$ref": ".//examples//SuccessfulLanguagesRequest.json" - } - }, - "deprecated": false - } - }, - "/sentiment": { - "post": { - "summary": "Sentiment", - "description": "The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple levels of granularity, start from the a document level, down to sentence and key terms (aspects) and opinions.", - "operationId": "Sentiment", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "name": "opinionMining", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", - "type": "boolean" - }, + } + }, + "AspectRelation":{ + "type":"object", + "required":[ + "ref", + "relationType" + ], + "properties":{ + "relationType":{ + "type":"string", + "enum":[ + "opinion", + "aspect" + ], + "x-ms-enum":{ + "name":"AspectRelationType", + "modelAsString":false + }, + "description":"The type related to the aspect." + }, + "ref":{ + "type":"string", + "description":"The JSON pointer indicating the linked object." + } + } + }, + "AspectConfidenceScoreLabel":{ + "type":"object", + "required":[ + "negative", + "positive" + ], + "properties":{ + "positive":{ + "type":"number", + "format":"double" + }, + "negative":{ + "type":"number", + "format":"double" + } + }, + "description":"Represents the confidence scores across all sentiment classes: positive, neutral, negative." + }, + "PiiResult":{ + "allOf":[ { - "$ref": "#/parameters/MultiLanguageInput" + "$ref":"#/definitions/EntitiesResult" }, { - "$ref": "#/parameters/StringIndexType" + "type":"object", + "required":[ + "redactedText" + ], + "properties":{ + "redactedText":{ + "type":"string" + } + } } - ], - "responses": { - "200": { - "description": "A successful call results in a document sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral)", - "schema": { - "$ref": "#/definitions/SentimentResponse" + ] + }, + "EntitiesResult":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Response by document", + "items":{ + "$ref":"#/definitions/DocumentEntities" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" + } + }, + "DocumentEntities":{ + "type":"object", + "required":[ + "id", + "entities", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "entities":{ + "type":"array", + "description":"Recognized entities in the document.", + "items":{ + "$ref":"#/definitions/Entity" + } + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + }, + "statistics":{ + "description":"if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref":"#/definitions/DocumentStatistics" } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" + } + }, + "Entity":{ + "type":"object", + "required":[ + "text", + "category", + "offset", + "length", + "confidenceScore" + ], + "properties":{ + "text":{ + "type":"string", + "description":"Entity text as appears in the request." + }, + "category":{ + "type":"string", + "description":"Entity type, such as Person/Location/Org/SSN etc" + }, + "subcategory":{ + "type":"string", + "description":"Entity sub type, such as Age/Year/TimeRange etc" + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"Start position for the entity text." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"Length for the entity text." + }, + "confidenceScore":{ + "type":"number", + "format":"double", + "description":"Confidence score between 0 and 1 of the extracted entity." } - } - }, - "x-ms-examples": { - "Successful Sentiment request": { - "$ref": ".//examples//SuccessfulSentimentRequest.json" - } - }, - "deprecated": false - } - } - }, - "definitions": { - "MultiLanguageBatchInput": { - "type": "object", - "required": [ - "documents" - ], - "properties": { - "documents": { - "type": "array", - "description": "The set of documents to process as part of this batch.", - "items": { - "$ref": "#/definitions/MultiLanguageInput" - } - } + } }, - "description": "Contains a set of input documents to be analyzed by the service." - }, - "MultiLanguageInput": { - "type": "object", - "required": [ - "id", - "text" - ], - "properties": { - "id": { - "type": "string", - "description": "A unique, non-empty document identifier." - }, - "text": { - "type": "string", - "description": "The input text to process." - }, - "language": { - "type": "string", - "description": "(Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default." - } + "EntityLinkingResult":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Response by document", + "items":{ + "$ref":"#/definitions/DocumentLinkedEntities" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." + } + } }, - "description": "Contains an input document to be analyzed by the service." - }, - "DocumentError": { - "type": "object", - "required": [ - "id", - "error" - ], - "properties": { - "id": { - "type": "string", - "description": "Document Id." - }, - "error": { - "type": "object", - "description": "Document Error.", - "$ref": "#/definitions/TextAnalyticsError" - } - } - }, - "ErrorResponse": { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "description": "Document Error.", - "$ref": "#/definitions/TextAnalyticsError" - } - } - }, - "TextAnalyticsError": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "InvalidRequest", - "InvalidArgument", - "InternalServerError", - "ServiceUnavailable" - ], - "x-ms-enum": { - "name": "ErrorCodeValue", - "modelAsString": false - }, - "description": "Error code." - }, - "message": { - "type": "string", - "description": "Error message." - }, - "target": { - "type": "string", - "description": "Error target." - }, - "innererror": { - "$ref": "#/definitions/InnerError", - "description": "Inner error contains more specific information." - }, - "details": { - "type": "array", - "description": "Details about specific errors that led to this reported error.", - "items": { - "$ref": "#/definitions/TextAnalyticsError" - } - } - } - }, - "TextAnalyticsWarning": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "LongWordsInDocument", - "DocumentTruncated" - ], - "x-ms-enum": { - "name": "WarningCodeValue", - "modelAsString": true - }, - "description": "Error code." - }, - "message": { - "type": "string", - "description": "Warning message." - }, - "targetRef": { - "type": "string", - "description": "A JSON pointer reference indicating the target object." - } - } - }, - "InnerError": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "InvalidParameterValue", - "InvalidRequestBodyFormat", - "EmptyRequest", - "MissingInputRecords", - "InvalidDocument", - "ModelVersionIncorrect", - "InvalidDocumentBatch", - "UnsupportedLanguageCode", - "InvalidCountryHint" - ], - "x-ms-enum": { - "name": "InnerErrorCodeValue", - "modelAsString": true - }, - "description": "Error code." - }, - "message": { - "type": "string", - "description": "Error message." - }, - "details": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Error details." - }, - "target": { - "type": "string", - "description": "Error target." - }, - "innererror": { - "$ref": "#/definitions/InnerError", - "description": "Inner error contains more specific information." - } - } - }, - "SentimentResponse": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Sentiment analysis per document.", - "items": { - "$ref": "#/definitions/DocumentSentiment" - } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." - } - } - }, - "DocumentSentiment": { - "type": "object", - "required": [ - "id", - "sentiment", - "confidenceScores", - "sentences", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "sentiment": { - "type": "string", - "description": "Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).", - "enum": [ - "positive", - "neutral", - "negative", - "mixed" - ], - "x-ms-enum": { - "name": "DocumentSentimentValue", - "modelAsString": false - } - }, - "statistics": { - "$ref": "#/definitions/DocumentStatistics" - }, - "confidenceScores": { - "description": "Document level sentiment confidence scores between 0 and 1 for each sentiment class.", - "$ref": "#/definitions/SentimentConfidenceScorePerLabel" - }, - "sentences": { - "type": "array", - "description": "Sentence level sentiment analysis.", - "items": { - "$ref": "#/definitions/SentenceSentiment" - } - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" - } - } - } - }, - "RequestStatistics": { - "type": "object", - "required": [ - "documentsCount", - "validDocumentsCount", - "erroneousDocumentsCount", - "transactionsCount" - ], - "properties": { - "documentsCount": { - "type": "integer", - "format": "int32", - "description": "Number of documents submitted in the request." - }, - "validDocumentsCount": { - "type": "integer", - "format": "int32", - "description": "Number of valid documents. This excludes empty, over-size limit or non-supported languages documents." - }, - "erroneousDocumentsCount": { - "type": "integer", - "format": "int32", - "description": "Number of invalid documents. This includes empty, over-size limit or non-supported languages documents." - }, - "transactionsCount": { - "type": "integer", - "format": "int64", - "description": "Number of transactions for the request." - } + "DocumentLinkedEntities":{ + "type":"object", + "required":[ + "id", + "entities", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "entities":{ + "type":"array", + "description":"Recognized well-known entities in the document.", + "items":{ + "$ref":"#/definitions/LinkedEntity" + } + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + }, + "statistics":{ + "description":"if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref":"#/definitions/DocumentStatistics" + } + } }, - "description": "if showStats=true was specified in the request this field will contain information about the request payload." - }, - "DocumentStatistics": { - "type": "object", - "required": [ - "charactersCount", - "transactionsCount" - ], - "properties": { - "charactersCount": { - "type": "integer", - "format": "int32", - "description": "Number of text elements recognized in the document." - }, - "transactionsCount": { - "type": "integer", - "format": "int32", - "description": "Number of transactions for the document." - } + "LinkedEntity":{ + "type":"object", + "required":[ + "name", + "matches", + "language", + "url", + "dataSource" + ], + "properties":{ + "name":{ + "type":"string", + "description":"Entity Linking formal name." + }, + "matches":{ + "type":"array", + "description":"List of instances this entity appears in the text.", + "items":{ + "$ref":"#/definitions/Match" + } + }, + "language":{ + "type":"string", + "description":"Language used in the data source." + }, + "id":{ + "type":"string", + "description":"Unique identifier of the recognized entity from the data source." + }, + "url":{ + "type":"string", + "description":"URL for the entity's page from the data source." + }, + "dataSource":{ + "type":"string", + "description":"Data source used to extract entity linking, such as Wiki/Bing etc." + }, + "bingId":{ + "type":"string", + "description":"Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information." + } + } }, - "description": "if showStats=true was specified in the request this field will contain information about the document payload." - }, - "SentimentConfidenceScorePerLabel": { - "type": "object", - "required": [ - "positive", - "neutral", - "negative" - ], - "properties": { - "positive": { - "type": "number", - "format": "double" - }, - "neutral": { - "type": "number", - "format": "double" - }, - "negative": { - "type": "number", - "format": "double" - } + "Match":{ + "type":"object", + "required":[ + "confidenceScore", + "text", + "offset", + "length" + ], + "properties":{ + "confidenceScore":{ + "type":"number", + "format":"double", + "description":"If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned." + }, + "text":{ + "type":"string", + "description":"Entity text as appears in the request." + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"Start position for the entity match text." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"Length for the entity match text." + } + } }, - "description": "Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative." - }, - "SentenceSentiment": { - "type": "object", - "required": [ - "text", - "sentiment", - "confidenceScores", - "offset", - "length" - ], - "properties": { - "text": { - "type": "string", - "description": "The sentence text." - }, - "sentiment": { - "type": "string", - "description": "The predicted Sentiment for the sentence.", - "enum": [ - "positive", - "neutral", - "negative" - ], - "x-ms-enum": { - "name": "SentenceSentimentValue", - "modelAsString": false - } - }, - "confidenceScores": { - "description": "The sentiment confidence score between 0 and 1 for the sentence for all classes.", - "$ref": "#/definitions/SentimentConfidenceScorePerLabel" - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "The sentence offset from the start of the document." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "The length of the sentence." - }, - "aspects": { - "type": "array", - "description": "The array of aspect object for the sentence.", - "items": { - "$ref": "#/definitions/SentenceAspect" - } - }, - "opinions": { - "type": "array", - "description": "The array of opinion object for the sentence.", - "items": { - "$ref": "#/definitions/SentenceOpinion" - } - } - } - }, - "SentenceAspect": { - "type": "object", - "required": [ - "confidenceScores", - "length", - "offset", - "relations", - "sentiment", - "text" - ], - "properties": { - "sentiment": { - "type": "string", - "enum": [ - "positive", - "mixed", - "negative" - ], - "x-ms-enum": { - "name": "TokenSentimentValue", - "modelAsString": false - }, - "description": "Aspect level sentiment for the aspect in the sentence." - }, - "confidenceScores": { - "description": "Aspect level sentiment confidence scores for the aspect in the sentence.", - "$ref": "#/definitions/AspectConfidenceScoreLabel" - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "The aspect offset from the start of the sentence." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "The length of the aspect." - }, - "text": { - "type": "string", - "description": "The aspect text detected." - }, - "relations": { - "type": "array", - "description": "The array of either opinion or aspect object which is related to the aspect.", - "items": { - "$ref": "#/definitions/AspectRelation" - } - } - } - }, - "SentenceOpinion": { - "type": "object", - "required": [ - "confidenceScores", - "isNegated", - "length", - "offset", - "sentiment", - "text" - ], - "properties": { - "sentiment": { - "type": "string", - "enum": [ - "positive", - "mixed", - "negative" - ], - "x-ms-enum": { - "name": "TokenSentimentValue", - "modelAsString": false - }, - "description": "Opinion level sentiment for the aspect in the sentence." - }, - "confidenceScores": { - "description": "Opinion level sentiment confidence scores for the aspect in the sentence.", - "$ref": "#/definitions/AspectConfidenceScoreLabel" - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "The opinion offset from the start of the sentence." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "The length of the opinion." - }, - "text": { - "type": "string", - "description": "The aspect text detected." - }, - "isNegated": { - "type": "boolean", - "description": "The indicator representing if the opinion is negated." - } - } - }, - "AspectRelation": { - "type": "object", - "required": [ - "ref", - "relationType" - ], - "properties": { - "relationType": { - "type": "string", - "enum": [ - "opinion", - "aspect" - ], - "x-ms-enum": { - "name": "AspectRelationType", - "modelAsString": false - }, - "description": "The type related to the aspect." - }, - "ref": { - "type": "string", - "description": "The JSON pointer indicating the linked object." - } - } - }, - "AspectConfidenceScoreLabel": { - "type": "object", - "required": [ - "negative", - "positive" - ], - "properties": { - "positive": { - "type": "number", - "format": "double" - }, - "negative": { - "type": "number", - "format": "double" - } + "KeyPhraseResult":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Response by document", + "items":{ + "$ref":"#/definitions/DocumentKeyPhrases" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." + } + } }, - "description": "Represents the confidence scores across all sentiment classes: positive, neutral, negative." - }, - "PiiResult" : { - "allOf" : [ { - "$ref" : "#/definitions/EntitiesResult" - }, { - "type" : "object", - "required" : [ "redactedText" ], - "properties" : { - "redactedText" : { - "type" : "string" - } - } - } ] - }, - "EntitiesResult": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Response by document", - "items": { - "$ref": "#/definitions/DocumentEntities" - } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." - } - } - }, - "DocumentEntities": { - "type": "object", - "required": [ - "id", - "entities", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "entities": { - "type": "array", - "description": "Recognized entities in the document.", - "items": { - "$ref": "#/definitions/Entity" - } - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" - } - }, - "statistics": { - "description": "if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref": "#/definitions/DocumentStatistics" - } - } - }, - "Entity": { - "type": "object", - "required": [ - "text", - "category", - "offset", - "length", - "confidenceScore" - ], - "properties": { - "text": { - "type": "string", - "description": "Entity text as appears in the request." - }, - "category": { - "type": "string", - "description": "Entity type, such as Person/Location/Org/SSN etc" - }, - "subcategory": { - "type": "string", - "description": "Entity sub type, such as Age/Year/TimeRange etc" - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "Start position for the entity text." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "Length for the entity text." - }, - "confidenceScore": { - "type": "number", - "format": "double", - "description": "Confidence score between 0 and 1 of the extracted entity." - } - } - }, - "EntityLinkingResult": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Response by document", - "items": { - "$ref": "#/definitions/DocumentLinkedEntities" - } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." - } - } - }, - "DocumentLinkedEntities": { - "type": "object", - "required": [ - "id", - "entities", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "entities": { - "type": "array", - "description": "Recognized well-known entities in the document.", - "items": { - "$ref": "#/definitions/LinkedEntity" - } - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" - } - }, - "statistics": { - "description": "if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref": "#/definitions/DocumentStatistics" - } - } - }, - "LinkedEntity": { - "type": "object", - "required": [ - "name", - "matches", - "language", - "url", - "dataSource" - ], - "properties": { - "name": { - "type": "string", - "description": "Entity Linking formal name." - }, - "matches": { - "type": "array", - "description": "List of instances this entity appears in the text.", - "items": { - "$ref": "#/definitions/Match" - } - }, - "language": { - "type": "string", - "description": "Language used in the data source." - }, - "id": { - "type": "string", - "description": "Unique identifier of the recognized entity from the data source." - }, - "url": { - "type": "string", - "description": "URL for the entity's page from the data source." - }, - "dataSource": { - "type": "string", - "description": "Data source used to extract entity linking, such as Wiki/Bing etc." - }, - "bingId": { - "type": "string", - "description": "Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information." - } - } - }, - "Match": { - "type": "object", - "required": [ - "confidenceScore", - "text", - "offset", - "length" - ], - "properties": { - "confidenceScore": { - "type": "number", - "format": "double", - "description": "If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned." - }, - "text": { - "type": "string", - "description": "Entity text as appears in the request." - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "Start position for the entity match text." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "Length for the entity match text." - } - } - }, - "KeyPhraseResult": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Response by document", - "items": { - "$ref": "#/definitions/DocumentKeyPhrases" - } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." - } - } - }, - "DocumentKeyPhrases": { - "type": "object", - "required": [ - "id", - "keyPhrases", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "keyPhrases": { - "type": "array", - "description": "A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.", - "items": { - "type": "string" - } - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" - } - }, - "statistics": { - "description": "if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref": "#/definitions/DocumentStatistics" - } - } - }, - "LanguageBatchInput": { - "type": "object", - "required": [ - "documents" - ], - "properties": { - "documents": { - "type": "array", - "items": { - "$ref": "#/definitions/LanguageInput" - } - } - } - }, - "LanguageInput": { - "type": "object", - "required": [ - "id", - "text" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "text": { - "type": "string" - }, - "countryHint": { - "type": "string" - } - } - }, - "LanguageResult": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Response by document", - "items": { - "$ref": "#/definitions/DocumentLanguage" - } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." - } - } - }, - "DocumentLanguage": { - "type": "object", - "required": [ - "id", - "detectedLanguage", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "detectedLanguage": { - "description": "Detected Language.", - "$ref": "#/definitions/DetectedLanguage" - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" - } - }, - "statistics": { - "description": "if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref": "#/definitions/DocumentStatistics" - } - } - }, - "DetectedLanguage": { - "type": "object", - "required": [ - "name", - "iso6391Name", - "confidenceScore" - ], - "properties": { - "name": { - "type": "string", - "description": "Long name of a detected language (e.g. English, French)." - }, - "iso6391Name": { - "type": "string", - "description": "A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr)." - }, - "confidenceScore": { - "type": "number", - "format": "double", - "description": "A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." - } + "DocumentKeyPhrases":{ + "type":"object", + "required":[ + "id", + "keyPhrases", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "keyPhrases":{ + "type":"array", + "description":"A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.", + "items":{ + "type":"string" + } + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + }, + "statistics":{ + "description":"if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref":"#/definitions/DocumentStatistics" + } + } + }, + "LanguageBatchInput":{ + "type":"object", + "required":[ + "documents" + ], + "properties":{ + "documents":{ + "type":"array", + "items":{ + "$ref":"#/definitions/LanguageInput" + } + } + } + }, + "LanguageInput":{ + "type":"object", + "required":[ + "id", + "text" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "text":{ + "type":"string" + }, + "countryHint":{ + "type":"string" + } + } + }, + "LanguageResult":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Response by document", + "items":{ + "$ref":"#/definitions/DocumentLanguage" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." + } + } + }, + "DocumentLanguage":{ + "type":"object", + "required":[ + "id", + "detectedLanguage", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "detectedLanguage":{ + "description":"Detected Language.", + "$ref":"#/definitions/DetectedLanguage" + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + }, + "statistics":{ + "description":"if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref":"#/definitions/DocumentStatistics" + } + } + }, + "DetectedLanguage":{ + "type":"object", + "required":[ + "name", + "iso6391Name", + "confidenceScore" + ], + "properties":{ + "name":{ + "type":"string", + "description":"Long name of a detected language (e.g. English, French)." + }, + "iso6391Name":{ + "type":"string", + "description":"A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr)." + }, + "confidenceScore":{ + "type":"number", + "format":"double", + "description":"A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." + } + } } - } - }, - "parameters": { - "Endpoint": { - "name": "Endpoint", - "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", - "x-ms-parameter-location": "client", - "required": true, - "type": "string", - "in": "path", - "x-ms-skip-url-encoding": true - }, - "StringIndexType": { - "name": "stringIndexType", - "in": "query", - "type": "string", - "description": "(Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets", - "default": "TextElements_v8", - "enum": [ - "TextElements_v8", - "UnicodeCodePoint", - "Utf16CodeUnit" - ], - "x-ms-enum": { - "name": "StringIndexType", - "modelAsString": false, - "values": [ - { - "value": "TextElements_v8", - "description": "Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." - }, - { - "value": "UnicodeCodePoint", - "description": "Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." - }, - { - "value": "Utf16CodeUnit", - "description": "Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." - } - ] + }, + "parameters":{ + "Endpoint":{ + "name":"Endpoint", + "description":"Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", + "x-ms-parameter-location":"client", + "required":true, + "type":"string", + "in":"path", + "x-ms-skip-url-encoding":true }, - "x-ms-parameter-location": "client" - }, - "ShowStats": { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain request and document level statistics.", - "type": "boolean", - "required": false, - "x-ms-parameter-location": "method" - }, - "ModelVersion": { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string", - "required": false, - "x-ms-parameter-location": "method" - }, - "MultiLanguageInput": { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" + "StringIndexType":{ + "name":"stringIndexType", + "in":"query", + "type":"string", + "description":"(Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets", + "default":"TextElements_v8", + "enum":[ + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" + ], + "x-ms-enum":{ + "name":"StringIndexType", + "modelAsString":false, + "values":[ + { + "value":"TextElements_v8", + "description":"Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." + }, + { + "value":"UnicodeCodePoint", + "description":"Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." + }, + { + "value":"Utf16CodeUnit", + "description":"Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." + } + ] + }, + "x-ms-parameter-location":"client" }, - "x-ms-parameter-location": "method" - }, - "LanguageInput": { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze for language endpoint.", - "required": true, - "schema": { - "$ref": "#/definitions/LanguageBatchInput" + "ShowStats":{ + "name":"showStats", + "in":"query", + "description":"(Optional) if set to true, response will contain request and document level statistics.", + "type":"boolean", + "required":false, + "x-ms-parameter-location":"method" }, - "x-ms-parameter-location": "method" - } - } -} + "ModelVersion":{ + "name":"model-version", + "in":"query", + "description":"(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type":"string", + "required":false, + "x-ms-parameter-location":"method" + }, + "MultiLanguageInput":{ + "in":"body", + "name":"input", + "description":"Collection of documents to analyze.", + "required":true, + "schema":{ + "$ref":"#/definitions/MultiLanguageBatchInput" + }, + "x-ms-parameter-location":"method" + }, + "LanguageInput":{ + "in":"body", + "name":"input", + "description":"Collection of documents to analyze for language endpoint.", + "required":true, + "schema":{ + "$ref":"#/definitions/LanguageBatchInput" + }, + "x-ms-parameter-location":"method" + } + } +} \ No newline at end of file From 3c1e812fed76b9b461b237600bcfcd30a1a19803 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Wed, 12 Aug 2020 18:14:40 -0700 Subject: [PATCH 10/20] fix build issues --- .../examples/SuccessfulEntitiesRequest.json | 4 +- .../SuccessfulEntityLinkingRequest.json | 4 +- .../examples/SuccessfulEntityPIIRequest.json | 4 +- .../examples/SuccessfulKeyPhrasesRequest.json | 4 +- .../examples/SuccessfulLanguagesRequest.json | 4 +- .../examples/SuccessfulSentimentRequest.json | 4 +- .../preview/v3.1-preview.2/TextAnalytics.json | 121 +++++++++++++++--- 7 files changed, 117 insertions(+), 28 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json index 97d1a8aaec0d..1f9fb229d8e7 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json @@ -88,7 +88,7 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { "code": "MissingInputRecords", @@ -101,7 +101,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json index 9709a41c600f..74e80074edf4 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -96,7 +96,7 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { "code": "MissingInputRecords", @@ -109,7 +109,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json index 46eb4004b367..10c8b63290d5 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -75,7 +75,7 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { "code": "MissingInputRecords", @@ -88,7 +88,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json index 61f275a5d872..71a707665a0c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -57,7 +57,7 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { "code": "MissingInputRecords", @@ -70,7 +70,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json index 5cd93699e05f..f27b22c01369 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json @@ -64,7 +64,7 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { "code": "MissingInputRecords", @@ -77,7 +77,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json index 501baf123e18..e8505d90f44d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json @@ -119,7 +119,7 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { "code": "MissingInputRecords", @@ -132,7 +132,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index f361e9a76d7f..627aac3d09db 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -916,23 +916,36 @@ "description":"Represents the confidence scores across all sentiment classes: positive, neutral, negative." }, "PiiResult":{ - "allOf":[ - { - "$ref":"#/definitions/EntitiesResult" - }, - { - "type":"object", - "required":[ - "redactedText" - ], - "properties":{ - "redactedText":{ - "type":"string" + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Response by document", + "items":{ + "$ref":"#/definitions/PiiDocumentEntities" } - } - } - ] - }, + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." + } + } + }, "EntitiesResult":{ "type":"object", "required":[ @@ -964,6 +977,38 @@ } } }, + "PiiDocumentEntities":{ + "type":"object", + "required":[ + "id", + "entities", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "entities":{ + "type":"array", + "description":"Recognized entities in the document.", + "items":{ + "$ref":"#/definitions/PiiEntity" + } + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + }, + "statistics":{ + "description":"if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref":"#/definitions/DocumentStatistics" + } + } + }, "DocumentEntities":{ "type":"object", "required":[ @@ -1035,6 +1080,50 @@ } } }, + "PiiEntity":{ + "type":"object", + "required":[ + "text", + "category", + "offset", + "length", + "confidenceScore", + "redactedText" + ], + "properties":{ + "text":{ + "type":"string", + "description":"Entity text as appears in the request." + }, + "category":{ + "type":"string", + "description":"Entity type, such as Person/Location/Org/SSN etc" + }, + "subcategory":{ + "type":"string", + "description":"Entity sub type, such as Age/Year/TimeRange etc" + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"Start position for the entity text." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"Length for the entity text." + }, + "confidenceScore":{ + "type":"number", + "format":"double", + "description":"Confidence score between 0 and 1 of the extracted entity." + }, + "redactedText":{ + "type":"string", + "description":"This field contains the redacted text." + } + } + }, "EntityLinkingResult":{ "type":"object", "required":[ From 7a6b91863e974f0745ec3dde0d0ade7ea71e7700 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Thu, 13 Aug 2020 11:18:48 -0700 Subject: [PATCH 11/20] fix build issues --- .../examples/SuccessfulEntitiesRequest.json | 2 +- .../SuccessfulEntityLinkingRequest.json | 2 +- .../examples/SuccessfulEntityPIIRequest.json | 2 +- .../examples/SuccessfulKeyPhrasesRequest.json | 2 +- .../examples/SuccessfulLanguagesRequest.json | 2 +- .../examples/SuccessfulSentimentRequest.json | 2 +- .../preview/v3.1-preview.2/TextAnalytics.json | 2931 ++++++++--------- .../examples/SuccessfulEntityPIIRequest.json | 6 +- 8 files changed, 1474 insertions(+), 1475 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json index 1f9fb229d8e7..93f2e090ce72 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json @@ -90,7 +90,7 @@ "error": { "code": "invalidRequest", "message": "Invalid Request.", - "innererror": { + "innerError": { "code": "MissingInputRecords", "message": "Missing input records." } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json index 74e80074edf4..5a863150d574 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -98,7 +98,7 @@ "error": { "code": "invalidRequest", "message": "Invalid Request.", - "innererror": { + "innerError": { "code": "MissingInputRecords", "message": "Missing input records." } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json index 10c8b63290d5..b0059c25145f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -77,7 +77,7 @@ "error": { "code": "invalidRequest", "message": "Invalid Request.", - "innererror": { + "innerError": { "code": "MissingInputRecords", "message": "Missing input records." } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json index 71a707665a0c..b45f1ff4339a 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -59,7 +59,7 @@ "error": { "code": "invalidRequest", "message": "Invalid Request.", - "innererror": { + "innerError": { "code": "MissingInputRecords", "message": "Missing input records." } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json index f27b22c01369..454f51b83fb5 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json @@ -66,7 +66,7 @@ "error": { "code": "invalidRequest", "message": "Invalid Request.", - "innererror": { + "innerError": { "code": "MissingInputRecords", "message": "Missing input records." } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json index e8505d90f44d..495ad8b74be0 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json @@ -121,7 +121,7 @@ "error": { "code": "invalidRequest", "message": "Invalid Request.", - "innererror": { + "innerError": { "code": "MissingInputRecords", "message": "Missing input records." } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index 627aac3d09db..b4e8887c1aca 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -1,1521 +1,1520 @@ { - "swagger":"2.0", - "info":{ - "version":"v3.1-preview.2", - "contact":{ - "name":"Microsoft Cognitive Services", - "url":"https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", - "email":"mlapi@microsoft.com" - }, - "title":"Text Analytics Client", - "description":"The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" + "swagger": "2.0", + "info": { + "version": "v3.1-preview.2", + "contact": { + "name": "Microsoft Cognitive Services", + "url": "https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", + "email": "mlapi@microsoft.com" + }, + "title": "Text Analytics Client", + "description": "The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" }, - "securityDefinitions":{ - "apim_key":{ - "type":"apiKey", - "name":"Ocp-Apim-Subscription-Key", - "in":"header" - } + "securityDefinitions": { + "apim_key": { + "type": "apiKey", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" + } }, - "security":[ - { - "apim_key":[ - - ] - } + "security": [ + { + "apim_key": [] + } ], - "x-ms-parameterized-host":{ - "hostTemplate":"{Endpoint}/text/analytics/v3.1-preview.1", - "useSchemePrefix":false, - "parameters":[ - { - "$ref":"#/parameters/Endpoint" - } - ] - }, - "paths":{ - "/entities/recognition/general":{ - "post":{ - "summary":"Named Entity Recognition", - "description":"The API returns a list of general named entities in a given document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId":"EntitiesRecognitionGeneral", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "$ref":"#/parameters/MultiLanguageInput" - }, - { - "$ref":"#/parameters/StringIndexType" - } - ], - "responses":{ - "200":{ - "description":"A successful call results in a list of recognized entities returned for each valid document.", - "schema":{ - "$ref":"#/definitions/EntitiesResult" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Entities request":{ - "$ref":".//examples//SuccessfulEntitiesRequest.json" - } - }, - "deprecated":false - } - }, - "/entities/recognition/pii":{ - "post":{ - "summary":"Named Entity Recognition (NER) and Redaction of Personal Identifiable Information (PII)", - "description":"The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.\n", - "operationId":"EntitiesRecognitionPii", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "name":"domain", - "in":"query", - "description":"(Optional) if set to 'PHI', response will contain only PHI entities.", - "type":"string" - }, - { - "$ref":"#/parameters/MultiLanguageInput" - }, - { - "$ref":"#/parameters/StringIndexType" - } - ], - "responses":{ - "200":{ - "description":"A successful call results in a list of entities containing personal information returned for each valid document", - "schema":{ - "$ref":"#/definitions/PiiResult" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Entity PII request":{ - "$ref":".//examples//SuccessfulEntityPIIRequest.json" - } - }, - "deprecated":false - } - }, - "/entities/linking":{ - "post":{ - "summary":"Linked entities from a well-known knowledge base", - "description":"The API returns a list of recognized entities with links to a well-known knowledge base. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId":"EntitiesLinking", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "$ref":"#/parameters/MultiLanguageInput" - }, - { - "$ref":"#/parameters/StringIndexType" - } - ], - "responses":{ - "200":{ - "description":"A successful call results in a list of recognized entities with links to a well-known knowledge base returned for each valid document", - "schema":{ - "$ref":"#/definitions/EntityLinkingResult" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Entity Linking request":{ - "$ref":".//examples//SuccessfulEntityLinkingRequest.json" - } - }, - "deprecated":false - } - }, - "/keyPhrases":{ - "post":{ - "summary":"Key Phrases", - "description":"The API returns a list of strings denoting the key phrases in the input text. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId":"KeyPhrases", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "$ref":"#/parameters/MultiLanguageInput" - } - ], - "responses":{ - "200":{ - "description":"A successful response results in 0 or more key phrases identified in each valid document", - "schema":{ - "$ref":"#/definitions/KeyPhraseResult" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Key Phrase request":{ - "$ref":".//examples//SuccessfulKeyPhrasesRequest.json" - } - }, - "deprecated":false - } - }, - "/languages":{ - "post":{ - "summary":"Detect Language", - "description":"The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId":"Languages", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "$ref":"#/parameters/LanguageInput" - } - ], - "responses":{ - "200":{ - "description":"A successful call results in the detected language with the highest probability for each valid document", - "schema":{ - "$ref":"#/definitions/LanguageResult" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Detect Language request":{ - "$ref":".//examples//SuccessfulLanguagesRequest.json" - } - }, - "deprecated":false - } - }, - "/sentiment":{ - "post":{ - "summary":"Sentiment", - "description":"The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple levels of granularity, start from the a document level, down to sentence and key terms (aspects) and opinions.", - "operationId":"Sentiment", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "name":"opinionMining", - "in":"query", - "description":"(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", - "type":"boolean" - }, - { - "$ref":"#/parameters/MultiLanguageInput" - }, - { - "$ref":"#/parameters/StringIndexType" - } - ], - "responses":{ - "200":{ - "description":"A successful call results in a document sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral)", - "schema":{ - "$ref":"#/definitions/SentimentResponse" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Sentiment request":{ - "$ref":".//examples//SuccessfulSentimentRequest.json" - } - }, - "deprecated":false - } - } + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}/text/analytics/v3.1-preview.1", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] }, - "definitions":{ - "MultiLanguageBatchInput":{ - "type":"object", - "required":[ - "documents" + "paths": { + "/entities/recognition/general": { + "post": { + "summary": "Named Entity Recognition", + "description": "The API returns a list of general named entities in a given document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "EntitiesRecognitionGeneral", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "documents":{ - "type":"array", - "description":"The set of documents to process as part of this batch.", - "items":{ - "$ref":"#/definitions/MultiLanguageInput" - } - } - }, - "description":"Contains a set of input documents to be analyzed by the service." - }, - "MultiLanguageInput":{ - "type":"object", - "required":[ - "id", - "text" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "id":{ - "type":"string", - "description":"A unique, non-empty document identifier." - }, - "text":{ - "type":"string", - "description":"The input text to process." - }, - "language":{ - "type":"string", - "description":"(Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default." - } - }, - "description":"Contains an input document to be analyzed by the service." - }, - "DocumentError":{ - "type":"object", - "required":[ - "id", - "error" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" + } ], - "properties":{ - "id":{ - "type":"string", - "description":"Document Id." - }, - "error":{ - "type":"object", - "description":"Document Error.", - "$ref":"#/definitions/TextAnalyticsError" - } - } - }, - "ErrorResponse":{ - "type":"object", - "required":[ - "error" + "responses": { + "200": { + "description": "A successful call results in a list of recognized entities returned for each valid document.", + "schema": { + "$ref": "#/definitions/EntitiesResult" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Entities request": { + "$ref": ".//examples//SuccessfulEntitiesRequest.json" + } + }, + "deprecated": false + } + }, + "/entities/recognition/pii": { + "post": { + "summary": "Entities containing personal information", + "description": "The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.\n", + "operationId": "EntitiesRecognitionPii", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "error":{ - "type":"object", - "description":"Document Error.", - "$ref":"#/definitions/TextAnalyticsError" - } - } - }, - "TextAnalyticsError":{ - "type":"object", - "required":[ - "code", - "message" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "code":{ - "type":"string", - "enum":[ - "InvalidRequest", - "InvalidArgument", - "InternalServerError", - "ServiceUnavailable" - ], - "x-ms-enum":{ - "name":"ErrorCodeValue", - "modelAsString":false - }, - "description":"Error code." - }, - "message":{ - "type":"string", - "description":"Error message." - }, - "target":{ - "type":"string", - "description":"Error target." - }, - "innererror":{ - "$ref":"#/definitions/InnerError", - "description":"Inner error contains more specific information." - }, - "details":{ - "type":"array", - "description":"Details about specific errors that led to this reported error.", - "items":{ - "$ref":"#/definitions/TextAnalyticsError" - } - } - } - }, - "TextAnalyticsWarning":{ - "type":"object", - "required":[ - "code", - "message" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "name": "domain", + "in": "query", + "description": "(Optional) if set to 'PHI', response will contain only PHI entities.", + "type": "string" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" + } ], - "properties":{ - "code":{ - "type":"string", - "enum":[ - "LongWordsInDocument", - "DocumentTruncated" - ], - "x-ms-enum":{ - "name":"WarningCodeValue", - "modelAsString":true - }, - "description":"Error code." - }, - "message":{ - "type":"string", - "description":"Warning message." - }, - "targetRef":{ - "type":"string", - "description":"A JSON pointer reference indicating the target object." - } - } - }, - "InnerError":{ - "type":"object", - "required":[ - "code", - "message" + "responses": { + "200": { + "description": "A successful call results in a list of entities containing personal information returned for each valid document", + "schema": { + "$ref": "#/definitions/PiiEntitiesResult" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Entity PII request": { + "$ref": ".//examples//SuccessfulEntityPIIRequest.json" + } + }, + "deprecated": false + } + }, + "/entities/linking": { + "post": { + "summary": "Linked entities from a well-known knowledge base", + "description": "The API returns a list of recognized entities with links to a well-known knowledge base. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "EntitiesLinking", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "code":{ - "type":"string", - "enum":[ - "InvalidParameterValue", - "InvalidRequestBodyFormat", - "EmptyRequest", - "MissingInputRecords", - "InvalidDocument", - "ModelVersionIncorrect", - "InvalidDocumentBatch", - "UnsupportedLanguageCode", - "InvalidCountryHint" - ], - "x-ms-enum":{ - "name":"InnerErrorCodeValue", - "modelAsString":true - }, - "description":"Error code." - }, - "message":{ - "type":"string", - "description":"Error message." - }, - "details":{ - "type":"object", - "additionalProperties":{ - "type":"string" - }, - "description":"Error details." - }, - "target":{ - "type":"string", - "description":"Error target." - }, - "innererror":{ - "$ref":"#/definitions/InnerError", - "description":"Inner error contains more specific information." - } - } - }, - "SentimentResponse":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "documents":{ - "type":"array", - "description":"Sentiment analysis per document.", - "items":{ - "$ref":"#/definitions/DocumentSentiment" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } - } - }, - "DocumentSentiment":{ - "type":"object", - "required":[ - "id", - "sentiment", - "confidenceScores", - "sentences", - "warnings" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" + } ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "sentiment":{ - "type":"string", - "description":"Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).", - "enum":[ - "positive", - "neutral", - "negative", - "mixed" - ], - "x-ms-enum":{ - "name":"DocumentSentimentValue", - "modelAsString":false - } - }, - "statistics":{ - "$ref":"#/definitions/DocumentStatistics" - }, - "confidenceScores":{ - "description":"Document level sentiment confidence scores between 0 and 1 for each sentiment class.", - "$ref":"#/definitions/SentimentConfidenceScorePerLabel" - }, - "sentences":{ - "type":"array", - "description":"Sentence level sentiment analysis.", - "items":{ - "$ref":"#/definitions/SentenceSentiment" - } - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - } - } - }, - "RequestStatistics":{ - "type":"object", - "required":[ - "documentsCount", - "validDocumentsCount", - "erroneousDocumentsCount", - "transactionsCount" + "responses": { + "200": { + "description": "A successful call results in a list of recognized entities with links to a well-known knowledge base returned for each valid document", + "schema": { + "$ref": "#/definitions/EntityLinkingResult" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Entity Linking request": { + "$ref": ".//examples//SuccessfulEntityLinkingRequest.json" + } + }, + "deprecated": false + } + }, + "/keyPhrases": { + "post": { + "summary": "Key Phrases", + "description": "The API returns a list of strings denoting the key phrases in the input text. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "KeyPhrases", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "documentsCount":{ - "type":"integer", - "format":"int32", - "description":"Number of documents submitted in the request." - }, - "validDocumentsCount":{ - "type":"integer", - "format":"int32", - "description":"Number of valid documents. This excludes empty, over-size limit or non-supported languages documents." - }, - "erroneousDocumentsCount":{ - "type":"integer", - "format":"int32", - "description":"Number of invalid documents. This includes empty, over-size limit or non-supported languages documents." - }, - "transactionsCount":{ - "type":"integer", - "format":"int64", - "description":"Number of transactions for the request." - } - }, - "description":"if showStats=true was specified in the request this field will contain information about the request payload." - }, - "DocumentStatistics":{ - "type":"object", - "required":[ - "charactersCount", - "transactionsCount" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "charactersCount":{ - "type":"integer", - "format":"int32", - "description":"Number of text elements recognized in the document." - }, - "transactionsCount":{ - "type":"integer", - "format":"int32", - "description":"Number of transactions for the document." - } - }, - "description":"if showStats=true was specified in the request this field will contain information about the document payload." - }, - "SentimentConfidenceScorePerLabel":{ - "type":"object", - "required":[ - "positive", - "neutral", - "negative" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + } ], - "properties":{ - "positive":{ - "type":"number", - "format":"double" - }, - "neutral":{ - "type":"number", - "format":"double" - }, - "negative":{ - "type":"number", - "format":"double" - } - }, - "description":"Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative." - }, - "SentenceSentiment":{ - "type":"object", - "required":[ - "text", - "sentiment", - "confidenceScores", - "offset", - "length" + "responses": { + "200": { + "description": "A successful response results in 0 or more key phrases identified in each valid document", + "schema": { + "$ref": "#/definitions/KeyPhraseResult" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Key Phrase request": { + "$ref": ".//examples//SuccessfulKeyPhrasesRequest.json" + } + }, + "deprecated": false + } + }, + "/languages": { + "post": { + "summary": "Detect Language", + "description": "The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "Languages", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "text":{ - "type":"string", - "description":"The sentence text." - }, - "sentiment":{ - "type":"string", - "description":"The predicted Sentiment for the sentence.", - "enum":[ - "positive", - "neutral", - "negative" - ], - "x-ms-enum":{ - "name":"SentenceSentimentValue", - "modelAsString":false - } - }, - "confidenceScores":{ - "description":"The sentiment confidence score between 0 and 1 for the sentence for all classes.", - "$ref":"#/definitions/SentimentConfidenceScorePerLabel" - }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"The sentence offset from the start of the document." - }, - "length":{ - "type":"integer", - "format":"int32", - "description":"The length of the sentence." - }, - "aspects":{ - "type":"array", - "description":"The array of aspect object for the sentence.", - "items":{ - "$ref":"#/definitions/SentenceAspect" - } - }, - "opinions":{ - "type":"array", - "description":"The array of opinion object for the sentence.", - "items":{ - "$ref":"#/definitions/SentenceOpinion" - } - } - } - }, - "SentenceAspect":{ - "type":"object", - "required":[ - "confidenceScores", - "length", - "offset", - "relations", - "sentiment", - "text" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "sentiment":{ - "type":"string", - "enum":[ - "positive", - "mixed", - "negative" - ], - "x-ms-enum":{ - "name":"TokenSentimentValue", - "modelAsString":false - }, - "description":"Aspect level sentiment for the aspect in the sentence." - }, - "confidenceScores":{ - "description":"Aspect level sentiment confidence scores for the aspect in the sentence.", - "$ref":"#/definitions/AspectConfidenceScoreLabel" - }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"The aspect offset from the start of the sentence." - }, - "length":{ - "type":"integer", - "format":"int32", - "description":"The length of the aspect." - }, - "text":{ - "type":"string", - "description":"The aspect text detected." - }, - "relations":{ - "type":"array", - "description":"The array of either opinion or aspect object which is related to the aspect.", - "items":{ - "$ref":"#/definitions/AspectRelation" - } - } - } - }, - "SentenceOpinion":{ - "type":"object", - "required":[ - "confidenceScores", - "isNegated", - "length", - "offset", - "sentiment", - "text" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "$ref": "#/parameters/LanguageInput" + } ], - "properties":{ - "sentiment":{ - "type":"string", - "enum":[ - "positive", - "mixed", - "negative" - ], - "x-ms-enum":{ - "name":"TokenSentimentValue", - "modelAsString":false - }, - "description":"Opinion level sentiment for the aspect in the sentence." - }, - "confidenceScores":{ - "description":"Opinion level sentiment confidence scores for the aspect in the sentence.", - "$ref":"#/definitions/AspectConfidenceScoreLabel" - }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"The opinion offset from the start of the sentence." - }, - "length":{ - "type":"integer", - "format":"int32", - "description":"The length of the opinion." - }, - "text":{ - "type":"string", - "description":"The aspect text detected." - }, - "isNegated":{ - "type":"boolean", - "description":"The indicator representing if the opinion is negated." - } - } - }, - "AspectRelation":{ - "type":"object", - "required":[ - "ref", - "relationType" + "responses": { + "200": { + "description": "A successful call results in the detected language with the highest probability for each valid document", + "schema": { + "$ref": "#/definitions/LanguageResult" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Detect Language request": { + "$ref": ".//examples//SuccessfulLanguagesRequest.json" + } + }, + "deprecated": false + } + }, + "/sentiment": { + "post": { + "summary": "Sentiment", + "description": "The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple levels of granularity, start from the a document level, down to sentence and key terms (aspects) and opinions.", + "operationId": "Sentiment", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "relationType":{ - "type":"string", - "enum":[ - "opinion", - "aspect" - ], - "x-ms-enum":{ - "name":"AspectRelationType", - "modelAsString":false - }, - "description":"The type related to the aspect." - }, - "ref":{ - "type":"string", - "description":"The JSON pointer indicating the linked object." - } - } - }, - "AspectConfidenceScoreLabel":{ - "type":"object", - "required":[ - "negative", - "positive" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "positive":{ - "type":"number", - "format":"double" - }, - "negative":{ - "type":"number", - "format":"double" - } - }, - "description":"Represents the confidence scores across all sentiment classes: positive, neutral, negative." - }, - "PiiResult":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" - ], - "properties":{ - "documents":{ - "type":"array", - "description":"Response by document", - "items":{ - "$ref":"#/definitions/PiiDocumentEntities" - } + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } + { + "name": "opinionMining", + "in": "query", + "description": "(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", + "type": "boolean" }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" + { + "$ref": "#/parameters/MultiLanguageInput" }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." + { + "$ref": "#/parameters/StringIndexType" } - } - }, - "EntitiesResult":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" ], - "properties":{ - "documents":{ - "type":"array", - "description":"Response by document", - "items":{ - "$ref":"#/definitions/DocumentEntities" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } - } - }, - "PiiDocumentEntities":{ - "type":"object", - "required":[ - "id", - "entities", - "warnings" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." + "responses": { + "200": { + "description": "A successful call results in a document sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral)", + "schema": { + "$ref": "#/definitions/SentimentResponse" + } }, - "entities":{ - "type":"array", - "description":"Recognized entities in the document.", - "items":{ - "$ref":"#/definitions/PiiEntity" - } + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - }, - "statistics":{ - "description":"if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref":"#/definitions/DocumentStatistics" + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } - } + }, + "x-ms-examples": { + "Successful Sentiment request": { + "$ref": ".//examples//SuccessfulSentimentRequest.json" + } + }, + "deprecated": false + } + } + }, + "definitions": { + "MultiLanguageBatchInput": { + "type": "object", + "required": [ + "documents" + ], + "properties": { + "documents": { + "type": "array", + "description": "The set of documents to process as part of this batch.", + "items": { + "$ref": "#/definitions/MultiLanguageInput" + } + } + }, + "description": "Contains a set of input documents to be analyzed by the service." }, - "DocumentEntities":{ - "type":"object", - "required":[ - "id", - "entities", - "warnings" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "entities":{ - "type":"array", - "description":"Recognized entities in the document.", - "items":{ - "$ref":"#/definitions/Entity" - } - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - }, - "statistics":{ - "description":"if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref":"#/definitions/DocumentStatistics" - } + "MultiLanguageInput": { + "type": "object", + "required": [ + "id", + "text" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique, non-empty document identifier." + }, + "text": { + "type": "string", + "description": "The input text to process." + }, + "language": { + "type": "string", + "description": "(Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default." } - }, - "Entity":{ - "type":"object", - "required":[ - "text", - "category", - "offset", - "length", - "confidenceScore" - ], - "properties":{ - "text":{ - "type":"string", - "description":"Entity text as appears in the request." - }, - "category":{ - "type":"string", - "description":"Entity type, such as Person/Location/Org/SSN etc" - }, - "subcategory":{ - "type":"string", - "description":"Entity sub type, such as Age/Year/TimeRange etc" - }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"Start position for the entity text." - }, - "length":{ - "type":"integer", - "format":"int32", - "description":"Length for the entity text." - }, - "confidenceScore":{ - "type":"number", - "format":"double", - "description":"Confidence score between 0 and 1 of the extracted entity." - } + }, + "description": "Contains an input document to be analyzed by the service." + }, + "DocumentError": { + "type": "object", + "required": [ + "id", + "error" + ], + "properties": { + "id": { + "type": "string", + "description": "Document Id." + }, + "error": { + "type": "object", + "description": "Document Error.", + "$ref": "#/definitions/TextAnalyticsError" } - }, - "PiiEntity":{ - "type":"object", - "required":[ - "text", - "category", - "offset", - "length", - "confidenceScore", - "redactedText" - ], - "properties":{ - "text":{ - "type":"string", - "description":"Entity text as appears in the request." + } + }, + "ErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "description": "Document Error.", + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "TextAnalyticsError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable" + ], + "x-ms-enum": { + "name": "ErrorCodeValue", + "modelAsString": false }, - "category":{ - "type":"string", - "description":"Entity type, such as Person/Location/Org/SSN etc" + "description": "Error code." + }, + "message": { + "type": "string", + "description": "Error message." + }, + "target": { + "type": "string", + "description": "Error target." + }, + "innererror": { + "$ref": "#/definitions/InnerError", + "description": "Inner error contains more specific information." + }, + "details": { + "type": "array", + "description": "Details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + } + }, + "TextAnalyticsWarning": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "LongWordsInDocument", + "DocumentTruncated" + ], + "x-ms-enum": { + "name": "WarningCodeValue", + "modelAsString": true }, - "subcategory":{ - "type":"string", - "description":"Entity sub type, such as Age/Year/TimeRange etc" + "description": "Error code." + }, + "message": { + "type": "string", + "description": "Warning message." + }, + "targetRef": { + "type": "string", + "description": "A JSON pointer reference indicating the target object." + } + } + }, + "InnerError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "InvalidParameterValue", + "InvalidRequestBodyFormat", + "EmptyRequest", + "MissingInputRecords", + "InvalidDocument", + "ModelVersionIncorrect", + "InvalidDocumentBatch", + "UnsupportedLanguageCode", + "InvalidCountryHint" + ], + "x-ms-enum": { + "name": "InnerErrorCodeValue", + "modelAsString": true }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"Start position for the entity text." + "description": "Error code." + }, + "message": { + "type": "string", + "description": "Error message." + }, + "details": { + "type": "object", + "additionalProperties": { + "type": "string" }, - "length":{ - "type":"integer", - "format":"int32", - "description":"Length for the entity text." + "description": "Error details." + }, + "target": { + "type": "string", + "description": "Error target." + }, + "innererror": { + "$ref": "#/definitions/InnerError", + "description": "Inner error contains more specific information." + } + } + }, + "SentimentResponse": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Sentiment analysis per document.", + "items": { + "$ref": "#/definitions/DocumentSentiment" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "DocumentSentiment": { + "type": "object", + "required": [ + "id", + "sentiment", + "confidenceScores", + "sentences", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "sentiment": { + "type": "string", + "description": "Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).", + "enum": [ + "positive", + "neutral", + "negative", + "mixed" + ], + "x-ms-enum": { + "name": "DocumentSentimentValue", + "modelAsString": false + } + }, + "statistics": { + "$ref": "#/definitions/DocumentStatistics" + }, + "confidenceScores": { + "description": "Document level sentiment confidence scores between 0 and 1 for each sentiment class.", + "$ref": "#/definitions/SentimentConfidenceScorePerLabel" + }, + "sentences": { + "type": "array", + "description": "Sentence level sentiment analysis.", + "items": { + "$ref": "#/definitions/SentenceSentiment" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + } + } + }, + "RequestStatistics": { + "type": "object", + "required": [ + "documentsCount", + "validDocumentsCount", + "erroneousDocumentsCount", + "transactionsCount" + ], + "properties": { + "documentsCount": { + "type": "integer", + "format": "int32", + "description": "Number of documents submitted in the request." + }, + "validDocumentsCount": { + "type": "integer", + "format": "int32", + "description": "Number of valid documents. This excludes empty, over-size limit or non-supported languages documents." + }, + "erroneousDocumentsCount": { + "type": "integer", + "format": "int32", + "description": "Number of invalid documents. This includes empty, over-size limit or non-supported languages documents." + }, + "transactionsCount": { + "type": "integer", + "format": "int64", + "description": "Number of transactions for the request." + } + }, + "description": "if showStats=true was specified in the request this field will contain information about the request payload." + }, + "DocumentStatistics": { + "type": "object", + "required": [ + "charactersCount", + "transactionsCount" + ], + "properties": { + "charactersCount": { + "type": "integer", + "format": "int32", + "description": "Number of text elements recognized in the document." + }, + "transactionsCount": { + "type": "integer", + "format": "int32", + "description": "Number of transactions for the document." + } + }, + "description": "if showStats=true was specified in the request this field will contain information about the document payload." + }, + "SentimentConfidenceScorePerLabel": { + "type": "object", + "required": [ + "positive", + "neutral", + "negative" + ], + "properties": { + "positive": { + "type": "number", + "format": "double" + }, + "neutral": { + "type": "number", + "format": "double" + }, + "negative": { + "type": "number", + "format": "double" + } + }, + "description": "Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative." + }, + "SentenceSentiment": { + "type": "object", + "required": [ + "text", + "sentiment", + "confidenceScores", + "offset", + "length" + ], + "properties": { + "text": { + "type": "string", + "description": "The sentence text." + }, + "sentiment": { + "type": "string", + "description": "The predicted Sentiment for the sentence.", + "enum": [ + "positive", + "neutral", + "negative" + ], + "x-ms-enum": { + "name": "SentenceSentimentValue", + "modelAsString": false + } + }, + "confidenceScores": { + "description": "The sentiment confidence score between 0 and 1 for the sentence for all classes.", + "$ref": "#/definitions/SentimentConfidenceScorePerLabel" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The sentence offset from the start of the document." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "The length of the sentence." + }, + "aspects": { + "type": "array", + "description": "The array of aspect object for the sentence.", + "items": { + "$ref": "#/definitions/SentenceAspect" + } + }, + "opinions": { + "type": "array", + "description": "The array of opinion object for the sentence.", + "items": { + "$ref": "#/definitions/SentenceOpinion" + } + } + } + }, + "SentenceAspect": { + "type": "object", + "required": [ + "confidenceScores", + "length", + "offset", + "relations", + "sentiment", + "text" + ], + "properties": { + "sentiment": { + "type": "string", + "enum": [ + "positive", + "mixed", + "negative" + ], + "x-ms-enum": { + "name": "TokenSentimentValue", + "modelAsString": false }, - "confidenceScore":{ - "type":"number", - "format":"double", - "description":"Confidence score between 0 and 1 of the extracted entity." + "description": "Aspect level sentiment for the aspect in the sentence." + }, + "confidenceScores": { + "description": "Aspect level sentiment confidence scores for the aspect in the sentence.", + "$ref": "#/definitions/AspectConfidenceScoreLabel" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The aspect offset from the start of the sentence." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "The length of the aspect." + }, + "text": { + "type": "string", + "description": "The aspect text detected." + }, + "relations": { + "type": "array", + "description": "The array of either opinion or aspect object which is related to the aspect.", + "items": { + "$ref": "#/definitions/AspectRelation" + } + } + } + }, + "SentenceOpinion": { + "type": "object", + "required": [ + "confidenceScores", + "isNegated", + "length", + "offset", + "sentiment", + "text" + ], + "properties": { + "sentiment": { + "type": "string", + "enum": [ + "positive", + "mixed", + "negative" + ], + "x-ms-enum": { + "name": "TokenSentimentValue", + "modelAsString": false }, - "redactedText":{ - "type":"string", - "description":"This field contains the redacted text." + "description": "Opinion level sentiment for the aspect in the sentence." + }, + "confidenceScores": { + "description": "Opinion level sentiment confidence scores for the aspect in the sentence.", + "$ref": "#/definitions/AspectConfidenceScoreLabel" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The opinion offset from the start of the sentence." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "The length of the opinion." + }, + "text": { + "type": "string", + "description": "The aspect text detected." + }, + "isNegated": { + "type": "boolean", + "description": "The indicator representing if the opinion is negated." + } + } + }, + "AspectRelation": { + "type": "object", + "required": [ + "ref", + "relationType" + ], + "properties": { + "relationType": { + "type": "string", + "enum": [ + "opinion", + "aspect" + ], + "x-ms-enum": { + "name": "AspectRelationType", + "modelAsString": false + }, + "description": "The type related to the aspect." + }, + "ref": { + "type": "string", + "description": "The JSON pointer indicating the linked object." + } + } + }, + "AspectConfidenceScoreLabel": { + "type": "object", + "required": [ + "negative", + "positive" + ], + "properties": { + "positive": { + "type": "number", + "format": "double" + }, + "negative": { + "type": "number", + "format": "double" + } + }, + "description": "Represents the confidence scores across all sentiment classes: positive, neutral, negative." + }, + "EntitiesResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentEntities" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "PiiEntitiesResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/PiiDocumentEntities" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." } + } + }, + "DocumentEntities": { + "type": "object", + "required": [ + "id", + "entities", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "type": "array", + "description": "Recognized entities in the document.", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + } + } }, - "EntityLinkingResult":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" - ], - "properties":{ - "documents":{ - "type":"array", - "description":"Response by document", - "items":{ - "$ref":"#/definitions/DocumentLinkedEntities" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } + "PiiDocumentEntities": { + "type": "object", + "required": [ + "id", + "entities", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "type": "array", + "description": "Recognized entities in the document.", + "items": { + "$ref": "#/definitions/PiiEntity" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + } + } + }, + "Entity": { + "type": "object", + "required": [ + "text", + "category", + "offset", + "length", + "confidenceScore" + ], + "properties": { + "text": { + "type": "string", + "description": "Entity text as appears in the request." + }, + "category": { + "type": "string", + "description": "Entity type, such as Person/Location/Org/SSN etc" + }, + "subcategory": { + "type": "string", + "description": "Entity sub type, such as Age/Year/TimeRange etc" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "Start position for the entity text." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length for the entity text." + }, + "confidenceScore": { + "type": "number", + "format": "double", + "description": "Confidence score between 0 and 1 of the extracted entity." } - }, - "DocumentLinkedEntities":{ - "type":"object", - "required":[ - "id", - "entities", - "warnings" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "entities":{ - "type":"array", - "description":"Recognized well-known entities in the document.", - "items":{ - "$ref":"#/definitions/LinkedEntity" - } - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - }, - "statistics":{ - "description":"if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref":"#/definitions/DocumentStatistics" - } + } + }, + "PiiEntity": { + "type": "object", + "required": [ + "text", + "category", + "offset", + "length", + "confidenceScore" + ], + "properties": { + "text": { + "type": "string", + "description": "Entity text as appears in the request." + }, + "category": { + "type": "string", + "description": "Entity type, such as Person/Location/Org/SSN etc" + }, + "subcategory": { + "type": "string", + "description": "Entity sub type, such as Age/Year/TimeRange etc" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "Start position for the entity text." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length for the entity text." + }, + "confidenceScore": { + "type": "number", + "format": "double", + "description": "Confidence score between 0 and 1 of the extracted entity." + }, + "redactedText": { + "type": "number", + "format": "double", + "description": "Returns redacted text." + } + } + }, + "EntityLinkingResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentLinkedEntities" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." } - }, - "LinkedEntity":{ - "type":"object", - "required":[ - "name", - "matches", - "language", - "url", - "dataSource" - ], - "properties":{ - "name":{ - "type":"string", - "description":"Entity Linking formal name." - }, - "matches":{ - "type":"array", - "description":"List of instances this entity appears in the text.", - "items":{ - "$ref":"#/definitions/Match" - } - }, - "language":{ - "type":"string", - "description":"Language used in the data source." - }, - "id":{ - "type":"string", - "description":"Unique identifier of the recognized entity from the data source." - }, - "url":{ - "type":"string", - "description":"URL for the entity's page from the data source." - }, - "dataSource":{ - "type":"string", - "description":"Data source used to extract entity linking, such as Wiki/Bing etc." - }, - "bingId":{ - "type":"string", - "description":"Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information." - } + } + }, + "DocumentLinkedEntities": { + "type": "object", + "required": [ + "id", + "entities", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "type": "array", + "description": "Recognized well-known entities in the document.", + "items": { + "$ref": "#/definitions/LinkedEntity" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" } - }, - "Match":{ - "type":"object", - "required":[ - "confidenceScore", - "text", - "offset", - "length" - ], - "properties":{ - "confidenceScore":{ - "type":"number", - "format":"double", - "description":"If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned." - }, - "text":{ - "type":"string", - "description":"Entity text as appears in the request." - }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"Start position for the entity match text." - }, - "length":{ - "type":"integer", - "format":"int32", - "description":"Length for the entity match text." - } + } + }, + "LinkedEntity": { + "type": "object", + "required": [ + "name", + "matches", + "language", + "url", + "dataSource" + ], + "properties": { + "name": { + "type": "string", + "description": "Entity Linking formal name." + }, + "matches": { + "type": "array", + "description": "List of instances this entity appears in the text.", + "items": { + "$ref": "#/definitions/Match" + } + }, + "language": { + "type": "string", + "description": "Language used in the data source." + }, + "id": { + "type": "string", + "description": "Unique identifier of the recognized entity from the data source." + }, + "url": { + "type": "string", + "description": "URL for the entity's page from the data source." + }, + "dataSource": { + "type": "string", + "description": "Data source used to extract entity linking, such as Wiki/Bing etc." + }, + "bingId": { + "type": "string", + "description": "Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information." } - }, - "KeyPhraseResult":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" - ], - "properties":{ - "documents":{ - "type":"array", - "description":"Response by document", - "items":{ - "$ref":"#/definitions/DocumentKeyPhrases" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } + } + }, + "Match": { + "type": "object", + "required": [ + "confidenceScore", + "text", + "offset", + "length" + ], + "properties": { + "confidenceScore": { + "type": "number", + "format": "double", + "description": "If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned." + }, + "text": { + "type": "string", + "description": "Entity text as appears in the request." + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "Start position for the entity match text." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length for the entity match text." } - }, - "DocumentKeyPhrases":{ - "type":"object", - "required":[ - "id", - "keyPhrases", - "warnings" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "keyPhrases":{ - "type":"array", - "description":"A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.", - "items":{ - "type":"string" - } - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - }, - "statistics":{ - "description":"if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref":"#/definitions/DocumentStatistics" - } + } + }, + "KeyPhraseResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentKeyPhrases" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." } - }, - "LanguageBatchInput":{ - "type":"object", - "required":[ - "documents" - ], - "properties":{ - "documents":{ - "type":"array", - "items":{ - "$ref":"#/definitions/LanguageInput" - } - } + } + }, + "DocumentKeyPhrases": { + "type": "object", + "required": [ + "id", + "keyPhrases", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "keyPhrases": { + "type": "array", + "description": "A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.", + "items": { + "type": "string" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" } - }, - "LanguageInput":{ - "type":"object", - "required":[ - "id", - "text" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "text":{ - "type":"string" - }, - "countryHint":{ - "type":"string" - } + } + }, + "LanguageBatchInput": { + "type": "object", + "required": [ + "documents" + ], + "properties": { + "documents": { + "type": "array", + "items": { + "$ref": "#/definitions/LanguageInput" + } } - }, - "LanguageResult":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" - ], - "properties":{ - "documents":{ - "type":"array", - "description":"Response by document", - "items":{ - "$ref":"#/definitions/DocumentLanguage" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } + } + }, + "LanguageInput": { + "type": "object", + "required": [ + "id", + "text" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "text": { + "type": "string" + }, + "countryHint": { + "type": "string" } - }, - "DocumentLanguage":{ - "type":"object", - "required":[ - "id", - "detectedLanguage", - "warnings" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "detectedLanguage":{ - "description":"Detected Language.", - "$ref":"#/definitions/DetectedLanguage" - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - }, - "statistics":{ - "description":"if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref":"#/definitions/DocumentStatistics" - } + } + }, + "LanguageResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentLanguage" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." } - }, - "DetectedLanguage":{ - "type":"object", - "required":[ - "name", - "iso6391Name", - "confidenceScore" - ], - "properties":{ - "name":{ - "type":"string", - "description":"Long name of a detected language (e.g. English, French)." - }, - "iso6391Name":{ - "type":"string", - "description":"A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr)." - }, - "confidenceScore":{ - "type":"number", - "format":"double", - "description":"A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." - } + } + }, + "DocumentLanguage": { + "type": "object", + "required": [ + "id", + "detectedLanguage", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "detectedLanguage": { + "description": "Detected Language.", + "$ref": "#/definitions/DetectedLanguage" + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" } - } + } + }, + "DetectedLanguage": { + "type": "object", + "required": [ + "name", + "iso6391Name", + "confidenceScore" + ], + "properties": { + "name": { + "type": "string", + "description": "Long name of a detected language (e.g. English, French)." + }, + "iso6391Name": { + "type": "string", + "description": "A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr)." + }, + "confidenceScore": { + "type": "number", + "format": "double", + "description": "A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." + } + } + } }, - "parameters":{ - "Endpoint":{ - "name":"Endpoint", - "description":"Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", - "x-ms-parameter-location":"client", - "required":true, - "type":"string", - "in":"path", - "x-ms-skip-url-encoding":true - }, - "StringIndexType":{ - "name":"stringIndexType", - "in":"query", - "type":"string", - "description":"(Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets", - "default":"TextElements_v8", - "enum":[ - "TextElements_v8", - "UnicodeCodePoint", - "Utf16CodeUnit" - ], - "x-ms-enum":{ - "name":"StringIndexType", - "modelAsString":false, - "values":[ - { - "value":"TextElements_v8", - "description":"Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." - }, - { - "value":"UnicodeCodePoint", - "description":"Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." - }, - { - "value":"Utf16CodeUnit", - "description":"Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." - } - ] - }, - "x-ms-parameter-location":"client" - }, - "ShowStats":{ - "name":"showStats", - "in":"query", - "description":"(Optional) if set to true, response will contain request and document level statistics.", - "type":"boolean", - "required":false, - "x-ms-parameter-location":"method" - }, - "ModelVersion":{ - "name":"model-version", - "in":"query", - "description":"(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type":"string", - "required":false, - "x-ms-parameter-location":"method" - }, - "MultiLanguageInput":{ - "in":"body", - "name":"input", - "description":"Collection of documents to analyze.", - "required":true, - "schema":{ - "$ref":"#/definitions/MultiLanguageBatchInput" - }, - "x-ms-parameter-location":"method" - }, - "LanguageInput":{ - "in":"body", - "name":"input", - "description":"Collection of documents to analyze for language endpoint.", - "required":true, - "schema":{ - "$ref":"#/definitions/LanguageBatchInput" - }, - "x-ms-parameter-location":"method" - } + "parameters": { + "Endpoint": { + "name": "Endpoint", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "StringIndexType": { + "name": "stringIndexType", + "in": "query", + "type": "string", + "description": "(Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets", + "default": "TextElements_v8", + "enum": [ + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" + ], + "x-ms-enum": { + "name": "StringIndexType", + "modelAsString": false, + "values": [ + { + "value": "TextElements_v8", + "description": "Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." + }, + { + "value": "UnicodeCodePoint", + "description": "Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." + }, + { + "value": "Utf16CodeUnit", + "description": "Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." + } + ] + }, + "x-ms-parameter-location": "client" + }, + "ShowStats": { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain request and document level statistics.", + "type": "boolean", + "required": false, + "x-ms-parameter-location": "method" + }, + "ModelVersion": { + "name": "model-version", + "in": "query", + "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type": "string", + "required": false, + "x-ms-parameter-location": "method" + }, + "MultiLanguageInput": { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + }, + "x-ms-parameter-location": "method" + }, + "LanguageInput": { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze for language endpoint.", + "required": true, + "schema": { + "$ref": "#/definitions/LanguageBatchInput" + }, + "x-ms-parameter-location": "method" + } } -} \ No newline at end of file + } + \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json index cc858cbbe146..8a2a78251426 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json @@ -37,7 +37,7 @@ "offset": 28, "length": 11, "confidenceScore": 0.65, - "redactedText" : "Microsoft employee with ssn *********** is using our awesome API's." + "redactedText" : "Microsoft employee with ssn is using our awesome API's." } ], "warnings": [] @@ -52,7 +52,7 @@ "offset": 18, "length": 9, "confidenceScore": 0.75, - "redactedText": "Your ABA number - ********* - is the first 9 digits in the lower left hand corner of your personal check." + "redactedText": "Your ABA number - - is the first 9 digits in the lower left hand corner of your personal check." } ], "warnings": [] @@ -67,7 +67,7 @@ "offset": 3, "length": 14, "confidenceScore": 0.85, - "redactedText": "Is ************** your Brazilian CPF number?" + "redactedText": "Is your Brazilian CPF number?" } ], "warnings": [] From c8562cb01ac4443a5ea7cb2be0b8de6c2a7b5778 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Thu, 13 Aug 2020 11:25:34 -0700 Subject: [PATCH 12/20] fix build issues --- .../preview/v3.1-preview.2/TextAnalytics.json | 50 ++----------------- .../examples/SuccessfulEntityPIIRequest.json | 12 ++--- 2 files changed, 11 insertions(+), 51 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index b4e8887c1aca..7a93f1785b97 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -1023,7 +1023,7 @@ "type": "array", "description": "Recognized entities in the document.", "items": { - "$ref": "#/definitions/PiiEntity" + "$ref": "#/definitions/Entity" } }, "warnings": { @@ -1036,6 +1036,10 @@ "statistics": { "description": "if showStats=true was specified in the request this field will contain information about the document payload.", "$ref": "#/definitions/DocumentStatistics" + }, + "redactedText": { + "type": "string", + "description": "Returns redacted text." } } }, @@ -1078,50 +1082,6 @@ } } }, - "PiiEntity": { - "type": "object", - "required": [ - "text", - "category", - "offset", - "length", - "confidenceScore" - ], - "properties": { - "text": { - "type": "string", - "description": "Entity text as appears in the request." - }, - "category": { - "type": "string", - "description": "Entity type, such as Person/Location/Org/SSN etc" - }, - "subcategory": { - "type": "string", - "description": "Entity sub type, such as Age/Year/TimeRange etc" - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "Start position for the entity text." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "Length for the entity text." - }, - "confidenceScore": { - "type": "number", - "format": "double", - "description": "Confidence score between 0 and 1 of the extracted entity." - }, - "redactedText": { - "type": "number", - "format": "double", - "description": "Returns redacted text." - } - } - }, "EntityLinkingResult": { "type": "object", "required": [ diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json index 8a2a78251426..b9c2e219c906 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json @@ -36,10 +36,10 @@ "subcategory": "", "offset": 28, "length": 11, - "confidenceScore": 0.65, - "redactedText" : "Microsoft employee with ssn is using our awesome API's." + "confidenceScore": 0.65 } ], + "redactedText" : "Microsoft employee with ssn is using our awesome API's.", "warnings": [] }, { @@ -51,10 +51,10 @@ "subcategory": "", "offset": 18, "length": 9, - "confidenceScore": 0.75, - "redactedText": "Your ABA number - - is the first 9 digits in the lower left hand corner of your personal check." + "confidenceScore": 0.75 } ], + "redactedText": "Your ABA number - - is the first 9 digits in the lower left hand corner of your personal check.", "warnings": [] }, { @@ -66,10 +66,10 @@ "subcategory": "", "offset": 3, "length": 14, - "confidenceScore": 0.85, - "redactedText": "Is your Brazilian CPF number?" + "confidenceScore": 0.85 } ], + "redactedText": "Is your Brazilian CPF number?", "warnings": [] } ], From 14c9a526be3911a4c5998b493adc75b64d6bf491 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Thu, 13 Aug 2020 11:37:03 -0700 Subject: [PATCH 13/20] fix build issues --- .../preview/v3.1-preview.2/TextAnalytics.json | 2825 +++++++++-------- .../examples/SuccessfulEntitiesRequest.json | 22 + .../SuccessfulEntityLinkingRequest.json | 22 + .../examples/SuccessfulKeyPhrasesRequest.json | 22 + .../examples/SuccessfulLanguagesRequest.json | 22 + .../examples/SuccessfulSentimentRequest.json | 22 + 6 files changed, 1523 insertions(+), 1412 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index 7a93f1785b97..045393e76420 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -1,1480 +1,1481 @@ { - "swagger": "2.0", - "info": { - "version": "v3.1-preview.2", - "contact": { - "name": "Microsoft Cognitive Services", - "url": "https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", - "email": "mlapi@microsoft.com" + "swagger":"2.0", + "info":{ + "version":"v3.1-preview.2", + "contact":{ + "name":"Microsoft Cognitive Services", + "url":"https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", + "email":"mlapi@microsoft.com" }, - "title": "Text Analytics Client", - "description": "The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" - }, - "securityDefinitions": { - "apim_key": { - "type": "apiKey", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "title":"Text Analytics Client", + "description":"The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" + }, + "securityDefinitions":{ + "apim_key":{ + "type":"apiKey", + "name":"Ocp-Apim-Subscription-Key", + "in":"header" } - }, - "security": [ + }, + "security":[ { - "apim_key": [] + "apim_key":[ + + ] } - ], - "x-ms-parameterized-host": { - "hostTemplate": "{Endpoint}/text/analytics/v3.1-preview.1", - "useSchemePrefix": false, - "parameters": [ - { - "$ref": "#/parameters/Endpoint" - } + ], + "x-ms-parameterized-host":{ + "hostTemplate":"{Endpoint}/text/analytics/v3.1-preview.1", + "useSchemePrefix":false, + "parameters":[ + { + "$ref":"#/parameters/Endpoint" + } ] - }, - "paths": { - "/entities/recognition/general": { - "post": { - "summary": "Named Entity Recognition", - "description": "The API returns a list of general named entities in a given document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId": "EntitiesRecognitionGeneral", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "$ref": "#/parameters/MultiLanguageInput" - }, - { - "$ref": "#/parameters/StringIndexType" - } - ], - "responses": { - "200": { - "description": "A successful call results in a list of recognized entities returned for each valid document.", - "schema": { - "$ref": "#/definitions/EntitiesResult" - } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Successful Entities request": { - "$ref": ".//examples//SuccessfulEntitiesRequest.json" - } - }, - "deprecated": false - } - }, - "/entities/recognition/pii": { - "post": { - "summary": "Entities containing personal information", - "description": "The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.\n", - "operationId": "EntitiesRecognitionPii", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "name": "domain", - "in": "query", - "description": "(Optional) if set to 'PHI', response will contain only PHI entities.", - "type": "string" - }, - { - "$ref": "#/parameters/MultiLanguageInput" - }, - { - "$ref": "#/parameters/StringIndexType" - } - ], - "responses": { - "200": { - "description": "A successful call results in a list of entities containing personal information returned for each valid document", - "schema": { - "$ref": "#/definitions/PiiEntitiesResult" - } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Successful Entity PII request": { - "$ref": ".//examples//SuccessfulEntityPIIRequest.json" - } - }, - "deprecated": false - } - }, - "/entities/linking": { - "post": { - "summary": "Linked entities from a well-known knowledge base", - "description": "The API returns a list of recognized entities with links to a well-known knowledge base. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId": "EntitiesLinking", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "$ref": "#/parameters/MultiLanguageInput" - }, - { - "$ref": "#/parameters/StringIndexType" - } - ], - "responses": { - "200": { - "description": "A successful call results in a list of recognized entities with links to a well-known knowledge base returned for each valid document", - "schema": { - "$ref": "#/definitions/EntityLinkingResult" - } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Successful Entity Linking request": { - "$ref": ".//examples//SuccessfulEntityLinkingRequest.json" - } - }, - "deprecated": false - } - }, - "/keyPhrases": { - "post": { - "summary": "Key Phrases", - "description": "The API returns a list of strings denoting the key phrases in the input text. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId": "KeyPhrases", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "$ref": "#/parameters/MultiLanguageInput" - } - ], - "responses": { - "200": { - "description": "A successful response results in 0 or more key phrases identified in each valid document", - "schema": { - "$ref": "#/definitions/KeyPhraseResult" - } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Successful Key Phrase request": { - "$ref": ".//examples//SuccessfulKeyPhrasesRequest.json" - } - }, - "deprecated": false - } - }, - "/languages": { - "post": { - "summary": "Detect Language", - "description": "The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId": "Languages", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "$ref": "#/parameters/LanguageInput" - } - ], - "responses": { - "200": { - "description": "A successful call results in the detected language with the highest probability for each valid document", - "schema": { - "$ref": "#/definitions/LanguageResult" - } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Successful Detect Language request": { - "$ref": ".//examples//SuccessfulLanguagesRequest.json" - } - }, - "deprecated": false - } - }, - "/sentiment": { - "post": { - "summary": "Sentiment", - "description": "The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple levels of granularity, start from the a document level, down to sentence and key terms (aspects) and opinions.", - "operationId": "Sentiment", - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ModelVersion" - }, - { - "$ref": "#/parameters/ShowStats" - }, - { - "name": "opinionMining", - "in": "query", - "description": "(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", - "type": "boolean" - }, - { - "$ref": "#/parameters/MultiLanguageInput" - }, - { - "$ref": "#/parameters/StringIndexType" - } - ], - "responses": { - "200": { - "description": "A successful call results in a document sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral)", - "schema": { - "$ref": "#/definitions/SentimentResponse" - } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Successful Sentiment request": { - "$ref": ".//examples//SuccessfulSentimentRequest.json" - } - }, - "deprecated": false - } - } - }, - "definitions": { - "MultiLanguageBatchInput": { - "type": "object", - "required": [ - "documents" - ], - "properties": { - "documents": { - "type": "array", - "description": "The set of documents to process as part of this batch.", - "items": { - "$ref": "#/definitions/MultiLanguageInput" - } - } - }, - "description": "Contains a set of input documents to be analyzed by the service." - }, - "MultiLanguageInput": { - "type": "object", - "required": [ - "id", - "text" - ], - "properties": { - "id": { - "type": "string", - "description": "A unique, non-empty document identifier." - }, - "text": { - "type": "string", - "description": "The input text to process." - }, - "language": { - "type": "string", - "description": "(Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default." - } - }, - "description": "Contains an input document to be analyzed by the service." - }, - "DocumentError": { - "type": "object", - "required": [ - "id", - "error" - ], - "properties": { - "id": { - "type": "string", - "description": "Document Id." - }, - "error": { - "type": "object", - "description": "Document Error.", - "$ref": "#/definitions/TextAnalyticsError" - } - } - }, - "ErrorResponse": { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "description": "Document Error.", - "$ref": "#/definitions/TextAnalyticsError" - } - } + }, + "paths":{ + "/entities/recognition/general":{ + "post":{ + "summary":"Named Entity Recognition", + "description":"The API returns a list of general named entities in a given document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId":"EntitiesRecognitionGeneral", + "consumes":[ + "application/json", + "text/json" + ], + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "$ref":"#/parameters/MultiLanguageInput" + }, + { + "$ref":"#/parameters/StringIndexType" + } + ], + "responses":{ + "200":{ + "description":"A successful call results in a list of recognized entities returned for each valid document.", + "schema":{ + "$ref":"#/definitions/EntitiesResult" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Entities request":{ + "$ref":".//examples//SuccessfulEntitiesRequest.json" + } + }, + "deprecated":false + } }, - "TextAnalyticsError": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "InvalidRequest", - "InvalidArgument", - "InternalServerError", - "ServiceUnavailable" + "/entities/recognition/pii":{ + "post":{ + "summary":"Entities containing personal information", + "description":"The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.\n", + "operationId":"EntitiesRecognitionPii", + "consumes":[ + "application/json", + "text/json" ], - "x-ms-enum": { - "name": "ErrorCodeValue", - "modelAsString": false - }, - "description": "Error code." - }, - "message": { - "type": "string", - "description": "Error message." - }, - "target": { - "type": "string", - "description": "Error target." - }, - "innererror": { - "$ref": "#/definitions/InnerError", - "description": "Inner error contains more specific information." - }, - "details": { - "type": "array", - "description": "Details about specific errors that led to this reported error.", - "items": { - "$ref": "#/definitions/TextAnalyticsError" - } - } - } + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "name":"domain", + "in":"query", + "description":"(Optional) if set to 'PHI', response will contain only PHI entities.", + "type":"string" + }, + { + "$ref":"#/parameters/MultiLanguageInput" + }, + { + "$ref":"#/parameters/StringIndexType" + } + ], + "responses":{ + "200":{ + "description":"A successful call results in a list of entities containing personal information returned for each valid document", + "schema":{ + "$ref":"#/definitions/PiiEntitiesResult" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Entity PII request":{ + "$ref":".//examples//SuccessfulEntityPIIRequest.json" + } + }, + "deprecated":false + } }, - "TextAnalyticsWarning": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "LongWordsInDocument", - "DocumentTruncated" + "/entities/linking":{ + "post":{ + "summary":"Linked entities from a well-known knowledge base", + "description":"The API returns a list of recognized entities with links to a well-known knowledge base. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId":"EntitiesLinking", + "consumes":[ + "application/json", + "text/json" + ], + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "$ref":"#/parameters/MultiLanguageInput" + }, + { + "$ref":"#/parameters/StringIndexType" + } ], - "x-ms-enum": { - "name": "WarningCodeValue", - "modelAsString": true - }, - "description": "Error code." - }, - "message": { - "type": "string", - "description": "Warning message." - }, - "targetRef": { - "type": "string", - "description": "A JSON pointer reference indicating the target object." - } - } + "responses":{ + "200":{ + "description":"A successful call results in a list of recognized entities with links to a well-known knowledge base returned for each valid document", + "schema":{ + "$ref":"#/definitions/EntityLinkingResult" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Entity Linking request":{ + "$ref":".//examples//SuccessfulEntityLinkingRequest.json" + } + }, + "deprecated":false + } }, - "InnerError": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "InvalidParameterValue", - "InvalidRequestBodyFormat", - "EmptyRequest", - "MissingInputRecords", - "InvalidDocument", - "ModelVersionIncorrect", - "InvalidDocumentBatch", - "UnsupportedLanguageCode", - "InvalidCountryHint" + "/keyPhrases":{ + "post":{ + "summary":"Key Phrases", + "description":"The API returns a list of strings denoting the key phrases in the input text. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId":"KeyPhrases", + "consumes":[ + "application/json", + "text/json" + ], + "produces":[ + "application/json", + "text/json" ], - "x-ms-enum": { - "name": "InnerErrorCodeValue", - "modelAsString": true - }, - "description": "Error code." - }, - "message": { - "type": "string", - "description": "Error message." - }, - "details": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Error details." - }, - "target": { - "type": "string", - "description": "Error target." - }, - "innererror": { - "$ref": "#/definitions/InnerError", - "description": "Inner error contains more specific information." - } - } + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "$ref":"#/parameters/MultiLanguageInput" + } + ], + "responses":{ + "200":{ + "description":"A successful response results in 0 or more key phrases identified in each valid document", + "schema":{ + "$ref":"#/definitions/KeyPhraseResult" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Key Phrase request":{ + "$ref":".//examples//SuccessfulKeyPhrasesRequest.json" + } + }, + "deprecated":false + } }, - "SentimentResponse": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Sentiment analysis per document.", - "items": { - "$ref": "#/definitions/DocumentSentiment" - } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." - } - } + "/languages":{ + "post":{ + "summary":"Detect Language", + "description":"The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId":"Languages", + "consumes":[ + "application/json", + "text/json" + ], + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "$ref":"#/parameters/LanguageInput" + } + ], + "responses":{ + "200":{ + "description":"A successful call results in the detected language with the highest probability for each valid document", + "schema":{ + "$ref":"#/definitions/LanguageResult" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Detect Language request":{ + "$ref":".//examples//SuccessfulLanguagesRequest.json" + } + }, + "deprecated":false + } }, - "DocumentSentiment": { - "type": "object", - "required": [ - "id", - "sentiment", - "confidenceScores", - "sentences", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "sentiment": { - "type": "string", - "description": "Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).", - "enum": [ - "positive", - "neutral", - "negative", - "mixed" + "/sentiment":{ + "post":{ + "summary":"Sentiment", + "description":"The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple levels of granularity, start from the a document level, down to sentence and key terms (aspects) and opinions.", + "operationId":"Sentiment", + "consumes":[ + "application/json", + "text/json" ], - "x-ms-enum": { - "name": "DocumentSentimentValue", - "modelAsString": false - } - }, - "statistics": { - "$ref": "#/definitions/DocumentStatistics" - }, - "confidenceScores": { - "description": "Document level sentiment confidence scores between 0 and 1 for each sentiment class.", - "$ref": "#/definitions/SentimentConfidenceScorePerLabel" - }, - "sentences": { - "type": "array", - "description": "Sentence level sentiment analysis.", - "items": { - "$ref": "#/definitions/SentenceSentiment" - } - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" + "produces":[ + "application/json", + "text/json" + ], + "parameters":[ + { + "$ref":"#/parameters/ModelVersion" + }, + { + "$ref":"#/parameters/ShowStats" + }, + { + "name":"opinionMining", + "in":"query", + "description":"(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", + "type":"boolean" + }, + { + "$ref":"#/parameters/MultiLanguageInput" + }, + { + "$ref":"#/parameters/StringIndexType" + } + ], + "responses":{ + "200":{ + "description":"A successful call results in a document sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral)", + "schema":{ + "$ref":"#/definitions/SentimentResponse" + } + }, + "400":{ + "description":"Bad Request.", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + }, + "500":{ + "description":"Internal error response", + "schema":{ + "$ref":"#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples":{ + "Successful Sentiment request":{ + "$ref":".//examples//SuccessfulSentimentRequest.json" + } + }, + "deprecated":false + } + } + }, + "definitions":{ + "MultiLanguageBatchInput":{ + "type":"object", + "required":[ + "documents" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"The set of documents to process as part of this batch.", + "items":{ + "$ref":"#/definitions/MultiLanguageInput" + } } - } - } + }, + "description":"Contains a set of input documents to be analyzed by the service." }, - "RequestStatistics": { - "type": "object", - "required": [ - "documentsCount", - "validDocumentsCount", - "erroneousDocumentsCount", - "transactionsCount" - ], - "properties": { - "documentsCount": { - "type": "integer", - "format": "int32", - "description": "Number of documents submitted in the request." - }, - "validDocumentsCount": { - "type": "integer", - "format": "int32", - "description": "Number of valid documents. This excludes empty, over-size limit or non-supported languages documents." - }, - "erroneousDocumentsCount": { - "type": "integer", - "format": "int32", - "description": "Number of invalid documents. This includes empty, over-size limit or non-supported languages documents." - }, - "transactionsCount": { - "type": "integer", - "format": "int64", - "description": "Number of transactions for the request." - } - }, - "description": "if showStats=true was specified in the request this field will contain information about the request payload." + "MultiLanguageInput":{ + "type":"object", + "required":[ + "id", + "text" + ], + "properties":{ + "id":{ + "type":"string", + "description":"A unique, non-empty document identifier." + }, + "text":{ + "type":"string", + "description":"The input text to process." + }, + "language":{ + "type":"string", + "description":"(Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default." + } + }, + "description":"Contains an input document to be analyzed by the service." }, - "DocumentStatistics": { - "type": "object", - "required": [ - "charactersCount", - "transactionsCount" - ], - "properties": { - "charactersCount": { - "type": "integer", - "format": "int32", - "description": "Number of text elements recognized in the document." - }, - "transactionsCount": { - "type": "integer", - "format": "int32", - "description": "Number of transactions for the document." - } - }, - "description": "if showStats=true was specified in the request this field will contain information about the document payload." + "DocumentError":{ + "type":"object", + "required":[ + "id", + "error" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Document Id." + }, + "error":{ + "type":"object", + "description":"Document Error.", + "$ref":"#/definitions/TextAnalyticsError" + } + } }, - "SentimentConfidenceScorePerLabel": { - "type": "object", - "required": [ - "positive", - "neutral", - "negative" - ], - "properties": { - "positive": { - "type": "number", - "format": "double" - }, - "neutral": { - "type": "number", - "format": "double" - }, - "negative": { - "type": "number", - "format": "double" - } - }, - "description": "Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative." + "ErrorResponse":{ + "type":"object", + "required":[ + "error" + ], + "properties":{ + "error":{ + "type":"object", + "description":"Document Error.", + "$ref":"#/definitions/TextAnalyticsError" + } + } }, - "SentenceSentiment": { - "type": "object", - "required": [ - "text", - "sentiment", - "confidenceScores", - "offset", - "length" - ], - "properties": { - "text": { - "type": "string", - "description": "The sentence text." - }, - "sentiment": { - "type": "string", - "description": "The predicted Sentiment for the sentence.", - "enum": [ - "positive", - "neutral", - "negative" - ], - "x-ms-enum": { - "name": "SentenceSentimentValue", - "modelAsString": false + "TextAnalyticsError":{ + "type":"object", + "required":[ + "code", + "message" + ], + "properties":{ + "code":{ + "type":"string", + "enum":[ + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable" + ], + "x-ms-enum":{ + "name":"ErrorCodeValue", + "modelAsString":false + }, + "description":"Error code." + }, + "message":{ + "type":"string", + "description":"Error message." + }, + "target":{ + "type":"string", + "description":"Error target." + }, + "innererror":{ + "$ref":"#/definitions/InnerError", + "description":"Inner error contains more specific information." + }, + "details":{ + "type":"array", + "description":"Details about specific errors that led to this reported error.", + "items":{ + "$ref":"#/definitions/TextAnalyticsError" + } } - }, - "confidenceScores": { - "description": "The sentiment confidence score between 0 and 1 for the sentence for all classes.", - "$ref": "#/definitions/SentimentConfidenceScorePerLabel" - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "The sentence offset from the start of the document." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "The length of the sentence." - }, - "aspects": { - "type": "array", - "description": "The array of aspect object for the sentence.", - "items": { - "$ref": "#/definitions/SentenceAspect" + } + }, + "TextAnalyticsWarning":{ + "type":"object", + "required":[ + "code", + "message" + ], + "properties":{ + "code":{ + "type":"string", + "enum":[ + "LongWordsInDocument", + "DocumentTruncated" + ], + "x-ms-enum":{ + "name":"WarningCodeValue", + "modelAsString":true + }, + "description":"Error code." + }, + "message":{ + "type":"string", + "description":"Warning message." + }, + "targetRef":{ + "type":"string", + "description":"A JSON pointer reference indicating the target object." } - }, - "opinions": { - "type": "array", - "description": "The array of opinion object for the sentence.", - "items": { - "$ref": "#/definitions/SentenceOpinion" + } + }, + "InnerError":{ + "type":"object", + "required":[ + "code", + "message" + ], + "properties":{ + "code":{ + "type":"string", + "enum":[ + "InvalidParameterValue", + "InvalidRequestBodyFormat", + "EmptyRequest", + "MissingInputRecords", + "InvalidDocument", + "ModelVersionIncorrect", + "InvalidDocumentBatch", + "UnsupportedLanguageCode", + "InvalidCountryHint" + ], + "x-ms-enum":{ + "name":"InnerErrorCodeValue", + "modelAsString":true + }, + "description":"Error code." + }, + "message":{ + "type":"string", + "description":"Error message." + }, + "details":{ + "type":"object", + "additionalProperties":{ + "type":"string" + }, + "description":"Error details." + }, + "target":{ + "type":"string", + "description":"Error target." + }, + "innererror":{ + "$ref":"#/definitions/InnerError", + "description":"Inner error contains more specific information." } - } - } + } }, - "SentenceAspect": { - "type": "object", - "required": [ - "confidenceScores", - "length", - "offset", - "relations", - "sentiment", - "text" - ], - "properties": { - "sentiment": { - "type": "string", - "enum": [ - "positive", - "mixed", - "negative" - ], - "x-ms-enum": { - "name": "TokenSentimentValue", - "modelAsString": false - }, - "description": "Aspect level sentiment for the aspect in the sentence." - }, - "confidenceScores": { - "description": "Aspect level sentiment confidence scores for the aspect in the sentence.", - "$ref": "#/definitions/AspectConfidenceScoreLabel" - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "The aspect offset from the start of the sentence." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "The length of the aspect." - }, - "text": { - "type": "string", - "description": "The aspect text detected." - }, - "relations": { - "type": "array", - "description": "The array of either opinion or aspect object which is related to the aspect.", - "items": { - "$ref": "#/definitions/AspectRelation" + "SentimentResponse":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Sentiment analysis per document.", + "items":{ + "$ref":"#/definitions/DocumentSentiment" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." } - } - } + } }, - "SentenceOpinion": { - "type": "object", - "required": [ - "confidenceScores", - "isNegated", - "length", - "offset", - "sentiment", - "text" - ], - "properties": { - "sentiment": { - "type": "string", - "enum": [ - "positive", - "mixed", - "negative" - ], - "x-ms-enum": { - "name": "TokenSentimentValue", - "modelAsString": false - }, - "description": "Opinion level sentiment for the aspect in the sentence." - }, - "confidenceScores": { - "description": "Opinion level sentiment confidence scores for the aspect in the sentence.", - "$ref": "#/definitions/AspectConfidenceScoreLabel" - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "The opinion offset from the start of the sentence." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "The length of the opinion." - }, - "text": { - "type": "string", - "description": "The aspect text detected." - }, - "isNegated": { - "type": "boolean", - "description": "The indicator representing if the opinion is negated." - } - } + "DocumentSentiment":{ + "type":"object", + "required":[ + "id", + "sentiment", + "confidenceScores", + "sentences", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "sentiment":{ + "type":"string", + "description":"Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).", + "enum":[ + "positive", + "neutral", + "negative", + "mixed" + ], + "x-ms-enum":{ + "name":"DocumentSentimentValue", + "modelAsString":false + } + }, + "statistics":{ + "$ref":"#/definitions/DocumentStatistics" + }, + "confidenceScores":{ + "description":"Document level sentiment confidence scores between 0 and 1 for each sentiment class.", + "$ref":"#/definitions/SentimentConfidenceScorePerLabel" + }, + "sentences":{ + "type":"array", + "description":"Sentence level sentiment analysis.", + "items":{ + "$ref":"#/definitions/SentenceSentiment" + } + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + } + } }, - "AspectRelation": { - "type": "object", - "required": [ - "ref", - "relationType" - ], - "properties": { - "relationType": { - "type": "string", - "enum": [ - "opinion", - "aspect" - ], - "x-ms-enum": { - "name": "AspectRelationType", - "modelAsString": false - }, - "description": "The type related to the aspect." - }, - "ref": { - "type": "string", - "description": "The JSON pointer indicating the linked object." - } - } + "RequestStatistics":{ + "type":"object", + "required":[ + "documentsCount", + "validDocumentsCount", + "erroneousDocumentsCount", + "transactionsCount" + ], + "properties":{ + "documentsCount":{ + "type":"integer", + "format":"int32", + "description":"Number of documents submitted in the request." + }, + "validDocumentsCount":{ + "type":"integer", + "format":"int32", + "description":"Number of valid documents. This excludes empty, over-size limit or non-supported languages documents." + }, + "erroneousDocumentsCount":{ + "type":"integer", + "format":"int32", + "description":"Number of invalid documents. This includes empty, over-size limit or non-supported languages documents." + }, + "transactionsCount":{ + "type":"integer", + "format":"int64", + "description":"Number of transactions for the request." + } + }, + "description":"if showStats=true was specified in the request this field will contain information about the request payload." }, - "AspectConfidenceScoreLabel": { - "type": "object", - "required": [ - "negative", - "positive" - ], - "properties": { - "positive": { - "type": "number", - "format": "double" - }, - "negative": { - "type": "number", - "format": "double" - } - }, - "description": "Represents the confidence scores across all sentiment classes: positive, neutral, negative." + "DocumentStatistics":{ + "type":"object", + "required":[ + "charactersCount", + "transactionsCount" + ], + "properties":{ + "charactersCount":{ + "type":"integer", + "format":"int32", + "description":"Number of text elements recognized in the document." + }, + "transactionsCount":{ + "type":"integer", + "format":"int32", + "description":"Number of transactions for the document." + } + }, + "description":"if showStats=true was specified in the request this field will contain information about the document payload." }, - "EntitiesResult": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Response by document", - "items": { - "$ref": "#/definitions/DocumentEntities" + "SentimentConfidenceScorePerLabel":{ + "type":"object", + "required":[ + "positive", + "neutral", + "negative" + ], + "properties":{ + "positive":{ + "type":"number", + "format":"double" + }, + "neutral":{ + "type":"number", + "format":"double" + }, + "negative":{ + "type":"number", + "format":"double" } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" + }, + "description":"Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative." + }, + "SentenceSentiment":{ + "type":"object", + "required":[ + "text", + "sentiment", + "confidenceScores", + "offset", + "length" + ], + "properties":{ + "text":{ + "type":"string", + "description":"The sentence text." + }, + "sentiment":{ + "type":"string", + "description":"The predicted Sentiment for the sentence.", + "enum":[ + "positive", + "neutral", + "negative" + ], + "x-ms-enum":{ + "name":"SentenceSentimentValue", + "modelAsString":false + } + }, + "confidenceScores":{ + "description":"The sentiment confidence score between 0 and 1 for the sentence for all classes.", + "$ref":"#/definitions/SentimentConfidenceScorePerLabel" + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"The sentence offset from the start of the document." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"The length of the sentence." + }, + "aspects":{ + "type":"array", + "description":"The array of aspect object for the sentence.", + "items":{ + "$ref":"#/definitions/SentenceAspect" + } + }, + "opinions":{ + "type":"array", + "description":"The array of opinion object for the sentence.", + "items":{ + "$ref":"#/definitions/SentenceOpinion" + } } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." - } - } + } }, - "PiiEntitiesResult": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Response by document", - "items": { - "$ref": "#/definitions/PiiDocumentEntities" - } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." + "SentenceAspect":{ + "type":"object", + "required":[ + "confidenceScores", + "length", + "offset", + "relations", + "sentiment", + "text" + ], + "properties":{ + "sentiment":{ + "type":"string", + "enum":[ + "positive", + "mixed", + "negative" + ], + "x-ms-enum":{ + "name":"TokenSentimentValue", + "modelAsString":false + }, + "description":"Aspect level sentiment for the aspect in the sentence." + }, + "confidenceScores":{ + "description":"Aspect level sentiment confidence scores for the aspect in the sentence.", + "$ref":"#/definitions/AspectConfidenceScoreLabel" + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"The aspect offset from the start of the sentence." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"The length of the aspect." + }, + "text":{ + "type":"string", + "description":"The aspect text detected." + }, + "relations":{ + "type":"array", + "description":"The array of either opinion or aspect object which is related to the aspect.", + "items":{ + "$ref":"#/definitions/AspectRelation" + } + } } - } - }, - "DocumentEntities": { - "type": "object", - "required": [ - "id", - "entities", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "entities": { - "type": "array", - "description": "Recognized entities in the document.", - "items": { - "$ref": "#/definitions/Entity" + }, + "SentenceOpinion":{ + "type":"object", + "required":[ + "confidenceScores", + "isNegated", + "length", + "offset", + "sentiment", + "text" + ], + "properties":{ + "sentiment":{ + "type":"string", + "enum":[ + "positive", + "mixed", + "negative" + ], + "x-ms-enum":{ + "name":"TokenSentimentValue", + "modelAsString":false + }, + "description":"Opinion level sentiment for the aspect in the sentence." + }, + "confidenceScores":{ + "description":"Opinion level sentiment confidence scores for the aspect in the sentence.", + "$ref":"#/definitions/AspectConfidenceScoreLabel" + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"The opinion offset from the start of the sentence." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"The length of the opinion." + }, + "text":{ + "type":"string", + "description":"The aspect text detected." + }, + "isNegated":{ + "type":"boolean", + "description":"The indicator representing if the opinion is negated." } - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "AspectRelation":{ + "type":"object", + "required":[ + "ref", + "relationType" + ], + "properties":{ + "relationType":{ + "type":"string", + "enum":[ + "opinion", + "aspect" + ], + "x-ms-enum":{ + "name":"AspectRelationType", + "modelAsString":false + }, + "description":"The type related to the aspect." + }, + "ref":{ + "type":"string", + "description":"The JSON pointer indicating the linked object." } - }, - "statistics": { - "description": "if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref": "#/definitions/DocumentStatistics" - } - } + } }, - "PiiDocumentEntities": { - "type": "object", - "required": [ - "id", - "entities", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "entities": { - "type": "array", - "description": "Recognized entities in the document.", - "items": { - "$ref": "#/definitions/Entity" - } - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" - } - }, - "statistics": { - "description": "if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref": "#/definitions/DocumentStatistics" + "AspectConfidenceScoreLabel":{ + "type":"object", + "required":[ + "negative", + "positive" + ], + "properties":{ + "positive":{ + "type":"number", + "format":"double" + }, + "negative":{ + "type":"number", + "format":"double" + } }, - "redactedText": { - "type": "string", - "description": "Returns redacted text." - } - } - }, - "Entity": { - "type": "object", - "required": [ - "text", - "category", - "offset", - "length", - "confidenceScore" - ], - "properties": { - "text": { - "type": "string", - "description": "Entity text as appears in the request." - }, - "category": { - "type": "string", - "description": "Entity type, such as Person/Location/Org/SSN etc" - }, - "subcategory": { - "type": "string", - "description": "Entity sub type, such as Age/Year/TimeRange etc" - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "Start position for the entity text." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "Length for the entity text." - }, - "confidenceScore": { - "type": "number", - "format": "double", - "description": "Confidence score between 0 and 1 of the extracted entity." - } - } + "description":"Represents the confidence scores across all sentiment classes: positive, neutral, negative." }, - "EntityLinkingResult": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Response by document", - "items": { - "$ref": "#/definitions/DocumentLinkedEntities" + "EntitiesResult":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Response by document", + "items":{ + "$ref":"#/definitions/DocumentEntities" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" + } + }, + "PiiEntitiesResult":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Response by document", + "items":{ + "$ref":"#/definitions/PiiDocumentEntities" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." - } - } + } }, - "DocumentLinkedEntities": { - "type": "object", - "required": [ - "id", - "entities", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "entities": { - "type": "array", - "description": "Recognized well-known entities in the document.", - "items": { - "$ref": "#/definitions/LinkedEntity" + "DocumentEntities":{ + "type":"object", + "required":[ + "id", + "entities", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "entities":{ + "type":"array", + "description":"Recognized entities in the document.", + "items":{ + "$ref":"#/definitions/Entity" + } + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + }, + "statistics":{ + "description":"if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref":"#/definitions/DocumentStatistics" } - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "PiiDocumentEntities":{ + "type":"object", + "required":[ + "id", + "entities", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "entities":{ + "type":"array", + "description":"Recognized entities in the document.", + "items":{ + "$ref":"#/definitions/Entity" + } + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + }, + "statistics":{ + "description":"if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref":"#/definitions/DocumentStatistics" + }, + "redactedText":{ + "type":"string", + "description":"Returns redacted text." } - }, - "statistics": { - "description": "if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref": "#/definitions/DocumentStatistics" - } - } + } }, - "LinkedEntity": { - "type": "object", - "required": [ - "name", - "matches", - "language", - "url", - "dataSource" - ], - "properties": { - "name": { - "type": "string", - "description": "Entity Linking formal name." - }, - "matches": { - "type": "array", - "description": "List of instances this entity appears in the text.", - "items": { - "$ref": "#/definitions/Match" + "Entity":{ + "type":"object", + "required":[ + "text", + "category", + "offset", + "length", + "confidenceScore" + ], + "properties":{ + "text":{ + "type":"string", + "description":"Entity text as appears in the request." + }, + "category":{ + "type":"string", + "description":"Entity type, such as Person/Location/Org/SSN etc" + }, + "subcategory":{ + "type":"string", + "description":"Entity sub type, such as Age/Year/TimeRange etc" + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"Start position for the entity text." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"Length for the entity text." + }, + "confidenceScore":{ + "type":"number", + "format":"double", + "description":"Confidence score between 0 and 1 of the extracted entity." } - }, - "language": { - "type": "string", - "description": "Language used in the data source." - }, - "id": { - "type": "string", - "description": "Unique identifier of the recognized entity from the data source." - }, - "url": { - "type": "string", - "description": "URL for the entity's page from the data source." - }, - "dataSource": { - "type": "string", - "description": "Data source used to extract entity linking, such as Wiki/Bing etc." - }, - "bingId": { - "type": "string", - "description": "Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information." - } - } + } }, - "Match": { - "type": "object", - "required": [ - "confidenceScore", - "text", - "offset", - "length" - ], - "properties": { - "confidenceScore": { - "type": "number", - "format": "double", - "description": "If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned." - }, - "text": { - "type": "string", - "description": "Entity text as appears in the request." - }, - "offset": { - "type": "integer", - "format": "int32", - "description": "Start position for the entity match text." - }, - "length": { - "type": "integer", - "format": "int32", - "description": "Length for the entity match text." - } - } + "EntityLinkingResult":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Response by document", + "items":{ + "$ref":"#/definitions/DocumentLinkedEntities" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." + } + } }, - "KeyPhraseResult": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Response by document", - "items": { - "$ref": "#/definitions/DocumentKeyPhrases" + "DocumentLinkedEntities":{ + "type":"object", + "required":[ + "id", + "entities", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "entities":{ + "type":"array", + "description":"Recognized well-known entities in the document.", + "items":{ + "$ref":"#/definitions/LinkedEntity" + } + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + }, + "statistics":{ + "description":"if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref":"#/definitions/DocumentStatistics" } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" + } + }, + "LinkedEntity":{ + "type":"object", + "required":[ + "name", + "matches", + "language", + "url", + "dataSource" + ], + "properties":{ + "name":{ + "type":"string", + "description":"Entity Linking formal name." + }, + "matches":{ + "type":"array", + "description":"List of instances this entity appears in the text.", + "items":{ + "$ref":"#/definitions/Match" + } + }, + "language":{ + "type":"string", + "description":"Language used in the data source." + }, + "id":{ + "type":"string", + "description":"Unique identifier of the recognized entity from the data source." + }, + "url":{ + "type":"string", + "description":"URL for the entity's page from the data source." + }, + "dataSource":{ + "type":"string", + "description":"Data source used to extract entity linking, such as Wiki/Bing etc." + }, + "bingId":{ + "type":"string", + "description":"Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information." } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." - } - } + } }, - "DocumentKeyPhrases": { - "type": "object", - "required": [ - "id", - "keyPhrases", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "keyPhrases": { - "type": "array", - "description": "A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.", - "items": { - "type": "string" + "Match":{ + "type":"object", + "required":[ + "confidenceScore", + "text", + "offset", + "length" + ], + "properties":{ + "confidenceScore":{ + "type":"number", + "format":"double", + "description":"If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned." + }, + "text":{ + "type":"string", + "description":"Entity text as appears in the request." + }, + "offset":{ + "type":"integer", + "format":"int32", + "description":"Start position for the entity match text." + }, + "length":{ + "type":"integer", + "format":"int32", + "description":"Length for the entity match text." } - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "KeyPhraseResult":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Response by document", + "items":{ + "$ref":"#/definitions/DocumentKeyPhrases" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." } - }, - "statistics": { - "description": "if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref": "#/definitions/DocumentStatistics" - } - } + } }, - "LanguageBatchInput": { - "type": "object", - "required": [ - "documents" - ], - "properties": { - "documents": { - "type": "array", - "items": { - "$ref": "#/definitions/LanguageInput" + "DocumentKeyPhrases":{ + "type":"object", + "required":[ + "id", + "keyPhrases", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "keyPhrases":{ + "type":"array", + "description":"A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.", + "items":{ + "type":"string" + } + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + }, + "statistics":{ + "description":"if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref":"#/definitions/DocumentStatistics" } - } - } + } }, - "LanguageInput": { - "type": "object", - "required": [ - "id", - "text" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "text": { - "type": "string" - }, - "countryHint": { - "type": "string" - } - } + "LanguageBatchInput":{ + "type":"object", + "required":[ + "documents" + ], + "properties":{ + "documents":{ + "type":"array", + "items":{ + "$ref":"#/definitions/LanguageInput" + } + } + } }, - "LanguageResult": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Response by document", - "items": { - "$ref": "#/definitions/DocumentLanguage" + "LanguageInput":{ + "type":"object", + "required":[ + "id", + "text" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "text":{ + "type":"string" + }, + "countryHint":{ + "type":"string" } - }, - "errors": { - "type": "array", - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" + } + }, + "LanguageResult":{ + "type":"object", + "required":[ + "documents", + "errors", + "modelVersion" + ], + "properties":{ + "documents":{ + "type":"array", + "description":"Response by document", + "items":{ + "$ref":"#/definitions/DocumentLanguage" + } + }, + "errors":{ + "type":"array", + "description":"Errors by document id.", + "items":{ + "$ref":"#/definitions/DocumentError" + } + }, + "statistics":{ + "$ref":"#/definitions/RequestStatistics" + }, + "modelVersion":{ + "type":"string", + "description":"This field indicates which model is used for scoring." } - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - }, - "modelVersion": { - "type": "string", - "description": "This field indicates which model is used for scoring." - } - } + } }, - "DocumentLanguage": { - "type": "object", - "required": [ - "id", - "detectedLanguage", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "detectedLanguage": { - "description": "Detected Language.", - "$ref": "#/definitions/DetectedLanguage" - }, - "warnings": { - "type": "array", - "description": "Warnings encountered while processing document.", - "items": { - "$ref": "#/definitions/TextAnalyticsWarning" + "DocumentLanguage":{ + "type":"object", + "required":[ + "id", + "detectedLanguage", + "warnings" + ], + "properties":{ + "id":{ + "type":"string", + "description":"Unique, non-empty document identifier." + }, + "detectedLanguage":{ + "description":"Detected Language.", + "$ref":"#/definitions/DetectedLanguage" + }, + "warnings":{ + "type":"array", + "description":"Warnings encountered while processing document.", + "items":{ + "$ref":"#/definitions/TextAnalyticsWarning" + } + }, + "statistics":{ + "description":"if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref":"#/definitions/DocumentStatistics" } - }, - "statistics": { - "description": "if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref": "#/definitions/DocumentStatistics" - } - } + } }, - "DetectedLanguage": { - "type": "object", - "required": [ - "name", - "iso6391Name", - "confidenceScore" - ], - "properties": { - "name": { - "type": "string", - "description": "Long name of a detected language (e.g. English, French)." - }, - "iso6391Name": { - "type": "string", - "description": "A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr)." - }, - "confidenceScore": { - "type": "number", - "format": "double", - "description": "A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." - } - } + "DetectedLanguage":{ + "type":"object", + "required":[ + "name", + "iso6391Name", + "confidenceScore" + ], + "properties":{ + "name":{ + "type":"string", + "description":"Long name of a detected language (e.g. English, French)." + }, + "iso6391Name":{ + "type":"string", + "description":"A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr)." + }, + "confidenceScore":{ + "type":"number", + "format":"double", + "description":"A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." + } + } } - }, - "parameters": { - "Endpoint": { - "name": "Endpoint", - "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", - "x-ms-parameter-location": "client", - "required": true, - "type": "string", - "in": "path", - "x-ms-skip-url-encoding": true + }, + "parameters":{ + "Endpoint":{ + "name":"Endpoint", + "description":"Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", + "x-ms-parameter-location":"client", + "required":true, + "type":"string", + "in":"path", + "x-ms-skip-url-encoding":true }, - "StringIndexType": { - "name": "stringIndexType", - "in": "query", - "type": "string", - "description": "(Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets", - "default": "TextElements_v8", - "enum": [ - "TextElements_v8", - "UnicodeCodePoint", - "Utf16CodeUnit" - ], - "x-ms-enum": { - "name": "StringIndexType", - "modelAsString": false, - "values": [ - { - "value": "TextElements_v8", - "description": "Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." - }, - { - "value": "UnicodeCodePoint", - "description": "Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." - }, - { - "value": "Utf16CodeUnit", - "description": "Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." - } - ] - }, - "x-ms-parameter-location": "client" + "StringIndexType":{ + "name":"stringIndexType", + "in":"query", + "type":"string", + "description":"(Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets", + "default":"TextElements_v8", + "enum":[ + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" + ], + "x-ms-enum":{ + "name":"StringIndexType", + "modelAsString":false, + "values":[ + { + "value":"TextElements_v8", + "description":"Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." + }, + { + "value":"UnicodeCodePoint", + "description":"Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." + }, + { + "value":"Utf16CodeUnit", + "description":"Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." + } + ] + }, + "x-ms-parameter-location":"client" }, - "ShowStats": { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain request and document level statistics.", - "type": "boolean", - "required": false, - "x-ms-parameter-location": "method" + "ShowStats":{ + "name":"showStats", + "in":"query", + "description":"(Optional) if set to true, response will contain request and document level statistics.", + "type":"boolean", + "required":false, + "x-ms-parameter-location":"method" }, - "ModelVersion": { - "name": "model-version", - "in": "query", - "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type": "string", - "required": false, - "x-ms-parameter-location": "method" + "ModelVersion":{ + "name":"model-version", + "in":"query", + "description":"(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type":"string", + "required":false, + "x-ms-parameter-location":"method" }, - "MultiLanguageInput": { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - }, - "x-ms-parameter-location": "method" + "MultiLanguageInput":{ + "in":"body", + "name":"input", + "description":"Collection of documents to analyze.", + "required":true, + "schema":{ + "$ref":"#/definitions/MultiLanguageBatchInput" + }, + "x-ms-parameter-location":"method" }, - "LanguageInput": { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze for language endpoint.", - "required": true, - "schema": { - "$ref": "#/definitions/LanguageBatchInput" - }, - "x-ms-parameter-location": "method" + "LanguageInput":{ + "in":"body", + "name":"input", + "description":"Collection of documents to analyze for language endpoint.", + "required":true, + "schema":{ + "$ref":"#/definitions/LanguageBatchInput" + }, + "x-ms-parameter-location":"method" } - } - } - \ No newline at end of file + } +} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json index 4217d33a1c61..fa53233a17ec 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json @@ -86,6 +86,28 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json index ecb5818e578a..ce4a4c198233 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json @@ -94,6 +94,28 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json index 77ea9c553b0e..dcb9358baf64 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json @@ -55,6 +55,28 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json index 3cee2aef5bd1..a89f1450649f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json @@ -56,6 +56,28 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json index 680392d80510..ed7fe430c1ac 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json @@ -122,6 +122,28 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } From 0c50e96cfa6bf8abbddfc494586fd6b50f4276f0 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Thu, 13 Aug 2020 13:40:03 -0700 Subject: [PATCH 14/20] fix build issues --- .../v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json | 6 +++--- .../stable/v3.0/examples/SuccessfulEntitiesRequest.json | 6 +++--- .../v3.0/examples/SuccessfulEntityLinkingRequest.json | 6 +++--- .../stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json | 6 +++--- .../stable/v3.0/examples/SuccessfulLanguagesRequest.json | 6 +++--- .../stable/v3.0/examples/SuccessfulSentimentRequest.json | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json index b9c2e219c906..31db89c5811c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json @@ -39,7 +39,7 @@ "confidenceScore": 0.65 } ], - "redactedText" : "Microsoft employee with ssn is using our awesome API's.", + "redactedText" : "Microsoft employee with ssn ******** is using our awesome API's.", "warnings": [] }, { @@ -54,7 +54,7 @@ "confidenceScore": 0.75 } ], - "redactedText": "Your ABA number - - is the first 9 digits in the lower left hand corner of your personal check.", + "redactedText": "Your ABA number - ******** - is the first 9 digits in the lower left hand corner of your personal check.", "warnings": [] }, { @@ -69,7 +69,7 @@ "confidenceScore": 0.85 } ], - "redactedText": "Is your Brazilian CPF number?", + "redactedText": "Is ******** your Brazilian CPF number?", "warnings": [] } ], diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json index fa53233a17ec..6ae237620605 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json @@ -91,10 +91,10 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { - "code": "MissingInputRecords", + "code": "missingInputRecords", "message": "Missing input records." } } @@ -104,7 +104,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json index ce4a4c198233..b77f8689160f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json @@ -99,10 +99,10 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { - "code": "MissingInputRecords", + "code": "missingInputRecords", "message": "Missing input records." } } @@ -112,7 +112,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json index dcb9358baf64..1bae21a8fe9d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json @@ -60,10 +60,10 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { - "code": "MissingInputRecords", + "code": "missingInputRecords", "message": "Missing input records." } } @@ -73,7 +73,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json index a89f1450649f..04bc8c44390c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json @@ -61,10 +61,10 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { - "code": "MissingInputRecords", + "code": "missingInputRecords", "message": "Missing input records." } } @@ -74,7 +74,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json index ed7fe430c1ac..5c4dc9af0edd 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json @@ -127,10 +127,10 @@ "headers": {}, "body": { "error": { - "code": "InvalidRequest", + "code": "invalidRequest", "message": "Invalid Request.", "innererror": { - "code": "MissingInputRecords", + "code": "missingInputRecords", "message": "Missing input records." } } @@ -140,7 +140,7 @@ "headers": {}, "body": { "error": { - "code": "InternalServerError", + "code": "internalServerError", "message": "Internal Server Error" } } From 449997b7f42db7dae70e689b61fca23b1bf1e1a9 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Thu, 20 Aug 2020 17:20:39 -0700 Subject: [PATCH 15/20] resolve PR comments --- .../preview/v3.0-preview.1/TextAnalytics.json | 36 ++++++++++++++++++ .../preview/v3.1-preview.1/TextAnalytics.json | 36 ++++++++++++++++++ .../preview/v3.1-preview.2/TextAnalytics.json | 38 ++++++++++++++++++- .../stable/v3.0/TextAnalytics.json | 30 +++++++++++++++ 4 files changed, 139 insertions(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json index 159a3c92319e..9860884d947f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json @@ -88,6 +88,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -152,6 +158,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -216,6 +228,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -280,6 +298,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -344,6 +368,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -408,6 +438,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json index b4855cbf69ce..4333469127d3 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json @@ -77,6 +77,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -138,6 +144,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -193,6 +205,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -245,6 +263,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -297,6 +321,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -358,6 +388,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index 045393e76420..8ec2810e0d62 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -79,6 +79,12 @@ "schema":{ "$ref":"#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples":{ @@ -140,6 +146,12 @@ "schema":{ "$ref":"#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples":{ @@ -195,6 +207,12 @@ "schema":{ "$ref":"#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples":{ @@ -247,6 +265,12 @@ "schema":{ "$ref":"#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples":{ @@ -299,6 +323,12 @@ "schema":{ "$ref":"#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples":{ @@ -360,6 +390,12 @@ "schema":{ "$ref":"#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples":{ @@ -1439,7 +1475,7 @@ } ] }, - "x-ms-parameter-location":"client" + "x-ms-parameter-location":"method" }, "ShowStats":{ "name":"showStats", diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json index 50a62c8f80bb..1ded16317a63 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json @@ -88,6 +88,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -152,6 +158,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -216,6 +228,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -280,6 +298,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { @@ -344,6 +368,12 @@ "schema": { "$ref": "#/definitions/ErrorResponse" } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "x-ms-examples": { From de5f432fafd0901c26f42a174c396b395d6b3cd4 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Thu, 20 Aug 2020 19:19:44 -0700 Subject: [PATCH 16/20] fix prettier check --- .../preview/v3.1-preview.2/TextAnalytics.json | 2950 ++++++++--------- .../examples/SuccessfulEntityPIIRequest.json | 2 +- 2 files changed, 1475 insertions(+), 1477 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index 8ec2810e0d62..f5b0f0045819 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -1,1517 +1,1515 @@ { - "swagger":"2.0", - "info":{ - "version":"v3.1-preview.2", - "contact":{ - "name":"Microsoft Cognitive Services", - "url":"https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", - "email":"mlapi@microsoft.com" - }, - "title":"Text Analytics Client", - "description":"The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" + "swagger": "2.0", + "info": { + "version": "v3.1-preview.2", + "contact": { + "name": "Microsoft Cognitive Services", + "url": "https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", + "email": "mlapi@microsoft.com" + }, + "title": "Text Analytics Client", + "description": "The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" }, - "securityDefinitions":{ - "apim_key":{ - "type":"apiKey", - "name":"Ocp-Apim-Subscription-Key", - "in":"header" - } + "securityDefinitions": { + "apim_key": { + "type": "apiKey", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" + } }, - "security":[ - { - "apim_key":[ - - ] - } + "security": [ + { + "apim_key": [] + } ], - "x-ms-parameterized-host":{ - "hostTemplate":"{Endpoint}/text/analytics/v3.1-preview.1", - "useSchemePrefix":false, - "parameters":[ - { - "$ref":"#/parameters/Endpoint" - } - ] + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}/text/analytics/v3.1-preview.1", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] }, - "paths":{ - "/entities/recognition/general":{ - "post":{ - "summary":"Named Entity Recognition", - "description":"The API returns a list of general named entities in a given document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId":"EntitiesRecognitionGeneral", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "$ref":"#/parameters/MultiLanguageInput" - }, - { - "$ref":"#/parameters/StringIndexType" - } - ], - "responses":{ - "200":{ - "description":"A successful call results in a list of recognized entities returned for each valid document.", - "schema":{ - "$ref":"#/definitions/EntitiesResult" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "default": { - "description": "Error Response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Entities request":{ - "$ref":".//examples//SuccessfulEntitiesRequest.json" - } - }, - "deprecated":false - } - }, - "/entities/recognition/pii":{ - "post":{ - "summary":"Entities containing personal information", - "description":"The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.\n", - "operationId":"EntitiesRecognitionPii", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "name":"domain", - "in":"query", - "description":"(Optional) if set to 'PHI', response will contain only PHI entities.", - "type":"string" - }, - { - "$ref":"#/parameters/MultiLanguageInput" - }, - { - "$ref":"#/parameters/StringIndexType" - } - ], - "responses":{ - "200":{ - "description":"A successful call results in a list of entities containing personal information returned for each valid document", - "schema":{ - "$ref":"#/definitions/PiiEntitiesResult" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "default": { - "description": "Error Response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Entity PII request":{ - "$ref":".//examples//SuccessfulEntityPIIRequest.json" - } - }, - "deprecated":false - } - }, - "/entities/linking":{ - "post":{ - "summary":"Linked entities from a well-known knowledge base", - "description":"The API returns a list of recognized entities with links to a well-known knowledge base. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId":"EntitiesLinking", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "$ref":"#/parameters/MultiLanguageInput" - }, - { - "$ref":"#/parameters/StringIndexType" - } - ], - "responses":{ - "200":{ - "description":"A successful call results in a list of recognized entities with links to a well-known knowledge base returned for each valid document", - "schema":{ - "$ref":"#/definitions/EntityLinkingResult" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "default": { - "description": "Error Response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Entity Linking request":{ - "$ref":".//examples//SuccessfulEntityLinkingRequest.json" - } - }, - "deprecated":false - } - }, - "/keyPhrases":{ - "post":{ - "summary":"Key Phrases", - "description":"The API returns a list of strings denoting the key phrases in the input text. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId":"KeyPhrases", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "$ref":"#/parameters/MultiLanguageInput" - } - ], - "responses":{ - "200":{ - "description":"A successful response results in 0 or more key phrases identified in each valid document", - "schema":{ - "$ref":"#/definitions/KeyPhraseResult" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "default": { - "description": "Error Response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Key Phrase request":{ - "$ref":".//examples//SuccessfulKeyPhrasesRequest.json" - } - }, - "deprecated":false - } - }, - "/languages":{ - "post":{ - "summary":"Detect Language", - "description":"The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the Supported languages in Text Analytics API for the list of enabled languages.", - "operationId":"Languages", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "$ref":"#/parameters/LanguageInput" - } - ], - "responses":{ - "200":{ - "description":"A successful call results in the detected language with the highest probability for each valid document", - "schema":{ - "$ref":"#/definitions/LanguageResult" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "default": { - "description": "Error Response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Detect Language request":{ - "$ref":".//examples//SuccessfulLanguagesRequest.json" - } - }, - "deprecated":false - } - }, - "/sentiment":{ - "post":{ - "summary":"Sentiment", - "description":"The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple levels of granularity, start from the a document level, down to sentence and key terms (aspects) and opinions.", - "operationId":"Sentiment", - "consumes":[ - "application/json", - "text/json" - ], - "produces":[ - "application/json", - "text/json" - ], - "parameters":[ - { - "$ref":"#/parameters/ModelVersion" - }, - { - "$ref":"#/parameters/ShowStats" - }, - { - "name":"opinionMining", - "in":"query", - "description":"(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", - "type":"boolean" - }, - { - "$ref":"#/parameters/MultiLanguageInput" - }, - { - "$ref":"#/parameters/StringIndexType" - } - ], - "responses":{ - "200":{ - "description":"A successful call results in a document sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral)", - "schema":{ - "$ref":"#/definitions/SentimentResponse" - } - }, - "400":{ - "description":"Bad Request.", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "500":{ - "description":"Internal error response", - "schema":{ - "$ref":"#/definitions/ErrorResponse" - } - }, - "default": { - "description": "Error Response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples":{ - "Successful Sentiment request":{ - "$ref":".//examples//SuccessfulSentimentRequest.json" - } - }, - "deprecated":false - } - } - }, - "definitions":{ - "MultiLanguageBatchInput":{ - "type":"object", - "required":[ - "documents" + "paths": { + "/entities/recognition/general": { + "post": { + "summary": "Named Entity Recognition", + "description": "The API returns a list of general named entities in a given document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "EntitiesRecognitionGeneral", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "documents":{ - "type":"array", - "description":"The set of documents to process as part of this batch.", - "items":{ - "$ref":"#/definitions/MultiLanguageInput" - } - } - }, - "description":"Contains a set of input documents to be analyzed by the service." - }, - "MultiLanguageInput":{ - "type":"object", - "required":[ - "id", - "text" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "id":{ - "type":"string", - "description":"A unique, non-empty document identifier." - }, - "text":{ - "type":"string", - "description":"The input text to process." - }, - "language":{ - "type":"string", - "description":"(Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default." - } - }, - "description":"Contains an input document to be analyzed by the service." - }, - "DocumentError":{ - "type":"object", - "required":[ - "id", - "error" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" + } ], - "properties":{ - "id":{ - "type":"string", - "description":"Document Id." - }, - "error":{ - "type":"object", - "description":"Document Error.", - "$ref":"#/definitions/TextAnalyticsError" - } - } - }, - "ErrorResponse":{ - "type":"object", - "required":[ - "error" + "responses": { + "200": { + "description": "A successful call results in a list of recognized entities returned for each valid document.", + "schema": { + "$ref": "#/definitions/EntitiesResult" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Entities request": { + "$ref": ".//examples//SuccessfulEntitiesRequest.json" + } + }, + "deprecated": false + } + }, + "/entities/recognition/pii": { + "post": { + "summary": "Entities containing personal information", + "description": "The API returns a list of entities with personal information (\\\"SSN\\\", \\\"Bank Account\\\" etc) in the document. For the list of supported entity types, check Supported Entity Types in Text Analytics API. See the Supported languages in Text Analytics API for the list of enabled languages.\n", + "operationId": "EntitiesRecognitionPii", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "error":{ - "type":"object", - "description":"Document Error.", - "$ref":"#/definitions/TextAnalyticsError" - } - } - }, - "TextAnalyticsError":{ - "type":"object", - "required":[ - "code", - "message" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "code":{ - "type":"string", - "enum":[ - "InvalidRequest", - "InvalidArgument", - "InternalServerError", - "ServiceUnavailable" - ], - "x-ms-enum":{ - "name":"ErrorCodeValue", - "modelAsString":false - }, - "description":"Error code." - }, - "message":{ - "type":"string", - "description":"Error message." - }, - "target":{ - "type":"string", - "description":"Error target." - }, - "innererror":{ - "$ref":"#/definitions/InnerError", - "description":"Inner error contains more specific information." - }, - "details":{ - "type":"array", - "description":"Details about specific errors that led to this reported error.", - "items":{ - "$ref":"#/definitions/TextAnalyticsError" - } - } - } - }, - "TextAnalyticsWarning":{ - "type":"object", - "required":[ - "code", - "message" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "name": "domain", + "in": "query", + "description": "(Optional) if set to 'PHI', response will contain only PHI entities.", + "type": "string" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" + } ], - "properties":{ - "code":{ - "type":"string", - "enum":[ - "LongWordsInDocument", - "DocumentTruncated" - ], - "x-ms-enum":{ - "name":"WarningCodeValue", - "modelAsString":true - }, - "description":"Error code." - }, - "message":{ - "type":"string", - "description":"Warning message." - }, - "targetRef":{ - "type":"string", - "description":"A JSON pointer reference indicating the target object." - } - } - }, - "InnerError":{ - "type":"object", - "required":[ - "code", - "message" + "responses": { + "200": { + "description": "A successful call results in a list of entities containing personal information returned for each valid document", + "schema": { + "$ref": "#/definitions/PiiEntitiesResult" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Entity PII request": { + "$ref": ".//examples//SuccessfulEntityPIIRequest.json" + } + }, + "deprecated": false + } + }, + "/entities/linking": { + "post": { + "summary": "Linked entities from a well-known knowledge base", + "description": "The API returns a list of recognized entities with links to a well-known knowledge base. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "EntitiesLinking", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "code":{ - "type":"string", - "enum":[ - "InvalidParameterValue", - "InvalidRequestBodyFormat", - "EmptyRequest", - "MissingInputRecords", - "InvalidDocument", - "ModelVersionIncorrect", - "InvalidDocumentBatch", - "UnsupportedLanguageCode", - "InvalidCountryHint" - ], - "x-ms-enum":{ - "name":"InnerErrorCodeValue", - "modelAsString":true - }, - "description":"Error code." - }, - "message":{ - "type":"string", - "description":"Error message." - }, - "details":{ - "type":"object", - "additionalProperties":{ - "type":"string" - }, - "description":"Error details." - }, - "target":{ - "type":"string", - "description":"Error target." - }, - "innererror":{ - "$ref":"#/definitions/InnerError", - "description":"Inner error contains more specific information." - } - } - }, - "SentimentResponse":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "documents":{ - "type":"array", - "description":"Sentiment analysis per document.", - "items":{ - "$ref":"#/definitions/DocumentSentiment" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } - } - }, - "DocumentSentiment":{ - "type":"object", - "required":[ - "id", - "sentiment", - "confidenceScores", - "sentences", - "warnings" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" + } ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "sentiment":{ - "type":"string", - "description":"Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).", - "enum":[ - "positive", - "neutral", - "negative", - "mixed" - ], - "x-ms-enum":{ - "name":"DocumentSentimentValue", - "modelAsString":false - } - }, - "statistics":{ - "$ref":"#/definitions/DocumentStatistics" - }, - "confidenceScores":{ - "description":"Document level sentiment confidence scores between 0 and 1 for each sentiment class.", - "$ref":"#/definitions/SentimentConfidenceScorePerLabel" - }, - "sentences":{ - "type":"array", - "description":"Sentence level sentiment analysis.", - "items":{ - "$ref":"#/definitions/SentenceSentiment" - } - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - } - } - }, - "RequestStatistics":{ - "type":"object", - "required":[ - "documentsCount", - "validDocumentsCount", - "erroneousDocumentsCount", - "transactionsCount" + "responses": { + "200": { + "description": "A successful call results in a list of recognized entities with links to a well-known knowledge base returned for each valid document", + "schema": { + "$ref": "#/definitions/EntityLinkingResult" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Entity Linking request": { + "$ref": ".//examples//SuccessfulEntityLinkingRequest.json" + } + }, + "deprecated": false + } + }, + "/keyPhrases": { + "post": { + "summary": "Key Phrases", + "description": "The API returns a list of strings denoting the key phrases in the input text. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "KeyPhrases", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "documentsCount":{ - "type":"integer", - "format":"int32", - "description":"Number of documents submitted in the request." - }, - "validDocumentsCount":{ - "type":"integer", - "format":"int32", - "description":"Number of valid documents. This excludes empty, over-size limit or non-supported languages documents." - }, - "erroneousDocumentsCount":{ - "type":"integer", - "format":"int32", - "description":"Number of invalid documents. This includes empty, over-size limit or non-supported languages documents." - }, - "transactionsCount":{ - "type":"integer", - "format":"int64", - "description":"Number of transactions for the request." - } - }, - "description":"if showStats=true was specified in the request this field will contain information about the request payload." - }, - "DocumentStatistics":{ - "type":"object", - "required":[ - "charactersCount", - "transactionsCount" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "charactersCount":{ - "type":"integer", - "format":"int32", - "description":"Number of text elements recognized in the document." - }, - "transactionsCount":{ - "type":"integer", - "format":"int32", - "description":"Number of transactions for the document." - } - }, - "description":"if showStats=true was specified in the request this field will contain information about the document payload." - }, - "SentimentConfidenceScorePerLabel":{ - "type":"object", - "required":[ - "positive", - "neutral", - "negative" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + } ], - "properties":{ - "positive":{ - "type":"number", - "format":"double" - }, - "neutral":{ - "type":"number", - "format":"double" - }, - "negative":{ - "type":"number", - "format":"double" - } - }, - "description":"Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative." - }, - "SentenceSentiment":{ - "type":"object", - "required":[ - "text", - "sentiment", - "confidenceScores", - "offset", - "length" + "responses": { + "200": { + "description": "A successful response results in 0 or more key phrases identified in each valid document", + "schema": { + "$ref": "#/definitions/KeyPhraseResult" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Key Phrase request": { + "$ref": ".//examples//SuccessfulKeyPhrasesRequest.json" + } + }, + "deprecated": false + } + }, + "/languages": { + "post": { + "summary": "Detect Language", + "description": "The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the Supported languages in Text Analytics API for the list of enabled languages.", + "operationId": "Languages", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "text":{ - "type":"string", - "description":"The sentence text." - }, - "sentiment":{ - "type":"string", - "description":"The predicted Sentiment for the sentence.", - "enum":[ - "positive", - "neutral", - "negative" - ], - "x-ms-enum":{ - "name":"SentenceSentimentValue", - "modelAsString":false - } - }, - "confidenceScores":{ - "description":"The sentiment confidence score between 0 and 1 for the sentence for all classes.", - "$ref":"#/definitions/SentimentConfidenceScorePerLabel" - }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"The sentence offset from the start of the document." - }, - "length":{ - "type":"integer", - "format":"int32", - "description":"The length of the sentence." - }, - "aspects":{ - "type":"array", - "description":"The array of aspect object for the sentence.", - "items":{ - "$ref":"#/definitions/SentenceAspect" - } - }, - "opinions":{ - "type":"array", - "description":"The array of opinion object for the sentence.", - "items":{ - "$ref":"#/definitions/SentenceOpinion" - } - } - } - }, - "SentenceAspect":{ - "type":"object", - "required":[ - "confidenceScores", - "length", - "offset", - "relations", - "sentiment", - "text" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "sentiment":{ - "type":"string", - "enum":[ - "positive", - "mixed", - "negative" - ], - "x-ms-enum":{ - "name":"TokenSentimentValue", - "modelAsString":false - }, - "description":"Aspect level sentiment for the aspect in the sentence." - }, - "confidenceScores":{ - "description":"Aspect level sentiment confidence scores for the aspect in the sentence.", - "$ref":"#/definitions/AspectConfidenceScoreLabel" - }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"The aspect offset from the start of the sentence." - }, - "length":{ - "type":"integer", - "format":"int32", - "description":"The length of the aspect." - }, - "text":{ - "type":"string", - "description":"The aspect text detected." - }, - "relations":{ - "type":"array", - "description":"The array of either opinion or aspect object which is related to the aspect.", - "items":{ - "$ref":"#/definitions/AspectRelation" - } - } - } - }, - "SentenceOpinion":{ - "type":"object", - "required":[ - "confidenceScores", - "isNegated", - "length", - "offset", - "sentiment", - "text" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "$ref": "#/parameters/LanguageInput" + } ], - "properties":{ - "sentiment":{ - "type":"string", - "enum":[ - "positive", - "mixed", - "negative" - ], - "x-ms-enum":{ - "name":"TokenSentimentValue", - "modelAsString":false - }, - "description":"Opinion level sentiment for the aspect in the sentence." - }, - "confidenceScores":{ - "description":"Opinion level sentiment confidence scores for the aspect in the sentence.", - "$ref":"#/definitions/AspectConfidenceScoreLabel" - }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"The opinion offset from the start of the sentence." - }, - "length":{ - "type":"integer", - "format":"int32", - "description":"The length of the opinion." - }, - "text":{ - "type":"string", - "description":"The aspect text detected." - }, - "isNegated":{ - "type":"boolean", - "description":"The indicator representing if the opinion is negated." - } - } - }, - "AspectRelation":{ - "type":"object", - "required":[ - "ref", - "relationType" + "responses": { + "200": { + "description": "A successful call results in the detected language with the highest probability for each valid document", + "schema": { + "$ref": "#/definitions/LanguageResult" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Detect Language request": { + "$ref": ".//examples//SuccessfulLanguagesRequest.json" + } + }, + "deprecated": false + } + }, + "/sentiment": { + "post": { + "summary": "Sentiment", + "description": "The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple levels of granularity, start from the a document level, down to sentence and key terms (aspects) and opinions.", + "operationId": "Sentiment", + "consumes": [ + "application/json", + "text/json" ], - "properties":{ - "relationType":{ - "type":"string", - "enum":[ - "opinion", - "aspect" - ], - "x-ms-enum":{ - "name":"AspectRelationType", - "modelAsString":false - }, - "description":"The type related to the aspect." - }, - "ref":{ - "type":"string", - "description":"The JSON pointer indicating the linked object." - } - } - }, - "AspectConfidenceScoreLabel":{ - "type":"object", - "required":[ - "negative", - "positive" + "produces": [ + "application/json", + "text/json" ], - "properties":{ - "positive":{ - "type":"number", - "format":"double" - }, - "negative":{ - "type":"number", - "format":"double" - } - }, - "description":"Represents the confidence scores across all sentiment classes: positive, neutral, negative." - }, - "EntitiesResult":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "name": "opinionMining", + "in": "query", + "description": "(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", + "type": "boolean" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + }, + { + "$ref": "#/parameters/StringIndexType" + } ], - "properties":{ - "documents":{ - "type":"array", - "description":"Response by document", - "items":{ - "$ref":"#/definitions/DocumentEntities" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } + "responses": { + "200": { + "description": "A successful call results in a document sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral)", + "schema": { + "$ref": "#/definitions/SentimentResponse" + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Successful Sentiment request": { + "$ref": ".//examples//SuccessfulSentimentRequest.json" + } + }, + "deprecated": false + } + } + }, + "definitions": { + "MultiLanguageBatchInput": { + "type": "object", + "required": [ + "documents" + ], + "properties": { + "documents": { + "type": "array", + "description": "The set of documents to process as part of this batch.", + "items": { + "$ref": "#/definitions/MultiLanguageInput" + } } - }, - "PiiEntitiesResult":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" - ], - "properties":{ - "documents":{ - "type":"array", - "description":"Response by document", - "items":{ - "$ref":"#/definitions/PiiDocumentEntities" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } + }, + "description": "Contains a set of input documents to be analyzed by the service." + }, + "MultiLanguageInput": { + "type": "object", + "required": [ + "id", + "text" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique, non-empty document identifier." + }, + "text": { + "type": "string", + "description": "The input text to process." + }, + "language": { + "type": "string", + "description": "(Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default." } - }, - "DocumentEntities":{ - "type":"object", - "required":[ - "id", - "entities", - "warnings" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "entities":{ - "type":"array", - "description":"Recognized entities in the document.", - "items":{ - "$ref":"#/definitions/Entity" - } - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - }, - "statistics":{ - "description":"if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref":"#/definitions/DocumentStatistics" - } + }, + "description": "Contains an input document to be analyzed by the service." + }, + "DocumentError": { + "type": "object", + "required": [ + "id", + "error" + ], + "properties": { + "id": { + "type": "string", + "description": "Document Id." + }, + "error": { + "type": "object", + "description": "Document Error.", + "$ref": "#/definitions/TextAnalyticsError" } - }, - "PiiDocumentEntities":{ - "type":"object", - "required":[ - "id", - "entities", - "warnings" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "entities":{ - "type":"array", - "description":"Recognized entities in the document.", - "items":{ - "$ref":"#/definitions/Entity" - } - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - }, - "statistics":{ - "description":"if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref":"#/definitions/DocumentStatistics" - }, - "redactedText":{ - "type":"string", - "description":"Returns redacted text." - } + } + }, + "ErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "description": "Document Error.", + "$ref": "#/definitions/TextAnalyticsError" } - }, - "Entity":{ - "type":"object", - "required":[ - "text", - "category", - "offset", - "length", - "confidenceScore" - ], - "properties":{ - "text":{ - "type":"string", - "description":"Entity text as appears in the request." - }, - "category":{ - "type":"string", - "description":"Entity type, such as Person/Location/Org/SSN etc" - }, - "subcategory":{ - "type":"string", - "description":"Entity sub type, such as Age/Year/TimeRange etc" - }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"Start position for the entity text." - }, - "length":{ - "type":"integer", - "format":"int32", - "description":"Length for the entity text." - }, - "confidenceScore":{ - "type":"number", - "format":"double", - "description":"Confidence score between 0 and 1 of the extracted entity." - } + } + }, + "TextAnalyticsError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable" + ], + "x-ms-enum": { + "name": "ErrorCodeValue", + "modelAsString": false + }, + "description": "Error code." + }, + "message": { + "type": "string", + "description": "Error message." + }, + "target": { + "type": "string", + "description": "Error target." + }, + "innererror": { + "$ref": "#/definitions/InnerError", + "description": "Inner error contains more specific information." + }, + "details": { + "type": "array", + "description": "Details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/TextAnalyticsError" + } } - }, - "EntityLinkingResult":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" - ], - "properties":{ - "documents":{ - "type":"array", - "description":"Response by document", - "items":{ - "$ref":"#/definitions/DocumentLinkedEntities" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } + } + }, + "TextAnalyticsWarning": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "LongWordsInDocument", + "DocumentTruncated" + ], + "x-ms-enum": { + "name": "WarningCodeValue", + "modelAsString": true + }, + "description": "Error code." + }, + "message": { + "type": "string", + "description": "Warning message." + }, + "targetRef": { + "type": "string", + "description": "A JSON pointer reference indicating the target object." } - }, - "DocumentLinkedEntities":{ - "type":"object", - "required":[ - "id", - "entities", - "warnings" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "entities":{ - "type":"array", - "description":"Recognized well-known entities in the document.", - "items":{ - "$ref":"#/definitions/LinkedEntity" - } - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - }, - "statistics":{ - "description":"if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref":"#/definitions/DocumentStatistics" - } + } + }, + "InnerError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "InvalidParameterValue", + "InvalidRequestBodyFormat", + "EmptyRequest", + "MissingInputRecords", + "InvalidDocument", + "ModelVersionIncorrect", + "InvalidDocumentBatch", + "UnsupportedLanguageCode", + "InvalidCountryHint" + ], + "x-ms-enum": { + "name": "InnerErrorCodeValue", + "modelAsString": true + }, + "description": "Error code." + }, + "message": { + "type": "string", + "description": "Error message." + }, + "details": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Error details." + }, + "target": { + "type": "string", + "description": "Error target." + }, + "innererror": { + "$ref": "#/definitions/InnerError", + "description": "Inner error contains more specific information." } - }, - "LinkedEntity":{ - "type":"object", - "required":[ - "name", - "matches", - "language", - "url", - "dataSource" - ], - "properties":{ - "name":{ - "type":"string", - "description":"Entity Linking formal name." - }, - "matches":{ - "type":"array", - "description":"List of instances this entity appears in the text.", - "items":{ - "$ref":"#/definitions/Match" - } - }, - "language":{ - "type":"string", - "description":"Language used in the data source." - }, - "id":{ - "type":"string", - "description":"Unique identifier of the recognized entity from the data source." - }, - "url":{ - "type":"string", - "description":"URL for the entity's page from the data source." - }, - "dataSource":{ - "type":"string", - "description":"Data source used to extract entity linking, such as Wiki/Bing etc." - }, - "bingId":{ - "type":"string", - "description":"Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information." - } + } + }, + "SentimentResponse": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Sentiment analysis per document.", + "items": { + "$ref": "#/definitions/DocumentSentiment" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." } - }, - "Match":{ - "type":"object", - "required":[ - "confidenceScore", - "text", - "offset", - "length" - ], - "properties":{ - "confidenceScore":{ - "type":"number", - "format":"double", - "description":"If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned." - }, - "text":{ - "type":"string", - "description":"Entity text as appears in the request." - }, - "offset":{ - "type":"integer", - "format":"int32", - "description":"Start position for the entity match text." - }, - "length":{ - "type":"integer", - "format":"int32", - "description":"Length for the entity match text." - } + } + }, + "DocumentSentiment": { + "type": "object", + "required": [ + "id", + "sentiment", + "confidenceScores", + "sentences", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "sentiment": { + "type": "string", + "description": "Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).", + "enum": [ + "positive", + "neutral", + "negative", + "mixed" + ], + "x-ms-enum": { + "name": "DocumentSentimentValue", + "modelAsString": false + } + }, + "statistics": { + "$ref": "#/definitions/DocumentStatistics" + }, + "confidenceScores": { + "description": "Document level sentiment confidence scores between 0 and 1 for each sentiment class.", + "$ref": "#/definitions/SentimentConfidenceScorePerLabel" + }, + "sentences": { + "type": "array", + "description": "Sentence level sentiment analysis.", + "items": { + "$ref": "#/definitions/SentenceSentiment" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } } - }, - "KeyPhraseResult":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" - ], - "properties":{ - "documents":{ - "type":"array", - "description":"Response by document", - "items":{ - "$ref":"#/definitions/DocumentKeyPhrases" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } + } + }, + "RequestStatistics": { + "type": "object", + "required": [ + "documentsCount", + "validDocumentsCount", + "erroneousDocumentsCount", + "transactionsCount" + ], + "properties": { + "documentsCount": { + "type": "integer", + "format": "int32", + "description": "Number of documents submitted in the request." + }, + "validDocumentsCount": { + "type": "integer", + "format": "int32", + "description": "Number of valid documents. This excludes empty, over-size limit or non-supported languages documents." + }, + "erroneousDocumentsCount": { + "type": "integer", + "format": "int32", + "description": "Number of invalid documents. This includes empty, over-size limit or non-supported languages documents." + }, + "transactionsCount": { + "type": "integer", + "format": "int64", + "description": "Number of transactions for the request." } - }, - "DocumentKeyPhrases":{ - "type":"object", - "required":[ - "id", - "keyPhrases", - "warnings" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "keyPhrases":{ - "type":"array", - "description":"A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.", - "items":{ - "type":"string" - } - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - }, - "statistics":{ - "description":"if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref":"#/definitions/DocumentStatistics" - } + }, + "description": "if showStats=true was specified in the request this field will contain information about the request payload." + }, + "DocumentStatistics": { + "type": "object", + "required": [ + "charactersCount", + "transactionsCount" + ], + "properties": { + "charactersCount": { + "type": "integer", + "format": "int32", + "description": "Number of text elements recognized in the document." + }, + "transactionsCount": { + "type": "integer", + "format": "int32", + "description": "Number of transactions for the document." } - }, - "LanguageBatchInput":{ - "type":"object", - "required":[ - "documents" - ], - "properties":{ - "documents":{ - "type":"array", - "items":{ - "$ref":"#/definitions/LanguageInput" - } - } + }, + "description": "if showStats=true was specified in the request this field will contain information about the document payload." + }, + "SentimentConfidenceScorePerLabel": { + "type": "object", + "required": [ + "positive", + "neutral", + "negative" + ], + "properties": { + "positive": { + "type": "number", + "format": "double" + }, + "neutral": { + "type": "number", + "format": "double" + }, + "negative": { + "type": "number", + "format": "double" } - }, - "LanguageInput":{ - "type":"object", - "required":[ - "id", - "text" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "text":{ - "type":"string" - }, - "countryHint":{ - "type":"string" - } + }, + "description": "Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative." + }, + "SentenceSentiment": { + "type": "object", + "required": [ + "text", + "sentiment", + "confidenceScores", + "offset", + "length" + ], + "properties": { + "text": { + "type": "string", + "description": "The sentence text." + }, + "sentiment": { + "type": "string", + "description": "The predicted Sentiment for the sentence.", + "enum": [ + "positive", + "neutral", + "negative" + ], + "x-ms-enum": { + "name": "SentenceSentimentValue", + "modelAsString": false + } + }, + "confidenceScores": { + "description": "The sentiment confidence score between 0 and 1 for the sentence for all classes.", + "$ref": "#/definitions/SentimentConfidenceScorePerLabel" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The sentence offset from the start of the document." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "The length of the sentence." + }, + "aspects": { + "type": "array", + "description": "The array of aspect object for the sentence.", + "items": { + "$ref": "#/definitions/SentenceAspect" + } + }, + "opinions": { + "type": "array", + "description": "The array of opinion object for the sentence.", + "items": { + "$ref": "#/definitions/SentenceOpinion" + } } - }, - "LanguageResult":{ - "type":"object", - "required":[ - "documents", - "errors", - "modelVersion" - ], - "properties":{ - "documents":{ - "type":"array", - "description":"Response by document", - "items":{ - "$ref":"#/definitions/DocumentLanguage" - } - }, - "errors":{ - "type":"array", - "description":"Errors by document id.", - "items":{ - "$ref":"#/definitions/DocumentError" - } - }, - "statistics":{ - "$ref":"#/definitions/RequestStatistics" - }, - "modelVersion":{ - "type":"string", - "description":"This field indicates which model is used for scoring." - } + } + }, + "SentenceAspect": { + "type": "object", + "required": [ + "confidenceScores", + "length", + "offset", + "relations", + "sentiment", + "text" + ], + "properties": { + "sentiment": { + "type": "string", + "enum": [ + "positive", + "mixed", + "negative" + ], + "x-ms-enum": { + "name": "TokenSentimentValue", + "modelAsString": false + }, + "description": "Aspect level sentiment for the aspect in the sentence." + }, + "confidenceScores": { + "description": "Aspect level sentiment confidence scores for the aspect in the sentence.", + "$ref": "#/definitions/AspectConfidenceScoreLabel" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The aspect offset from the start of the sentence." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "The length of the aspect." + }, + "text": { + "type": "string", + "description": "The aspect text detected." + }, + "relations": { + "type": "array", + "description": "The array of either opinion or aspect object which is related to the aspect.", + "items": { + "$ref": "#/definitions/AspectRelation" + } } - }, - "DocumentLanguage":{ - "type":"object", - "required":[ - "id", - "detectedLanguage", - "warnings" - ], - "properties":{ - "id":{ - "type":"string", - "description":"Unique, non-empty document identifier." - }, - "detectedLanguage":{ - "description":"Detected Language.", - "$ref":"#/definitions/DetectedLanguage" - }, - "warnings":{ - "type":"array", - "description":"Warnings encountered while processing document.", - "items":{ - "$ref":"#/definitions/TextAnalyticsWarning" - } - }, - "statistics":{ - "description":"if showStats=true was specified in the request this field will contain information about the document payload.", - "$ref":"#/definitions/DocumentStatistics" - } + } + }, + "SentenceOpinion": { + "type": "object", + "required": [ + "confidenceScores", + "isNegated", + "length", + "offset", + "sentiment", + "text" + ], + "properties": { + "sentiment": { + "type": "string", + "enum": [ + "positive", + "mixed", + "negative" + ], + "x-ms-enum": { + "name": "TokenSentimentValue", + "modelAsString": false + }, + "description": "Opinion level sentiment for the aspect in the sentence." + }, + "confidenceScores": { + "description": "Opinion level sentiment confidence scores for the aspect in the sentence.", + "$ref": "#/definitions/AspectConfidenceScoreLabel" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The opinion offset from the start of the sentence." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "The length of the opinion." + }, + "text": { + "type": "string", + "description": "The aspect text detected." + }, + "isNegated": { + "type": "boolean", + "description": "The indicator representing if the opinion is negated." } - }, - "DetectedLanguage":{ - "type":"object", - "required":[ - "name", - "iso6391Name", - "confidenceScore" - ], - "properties":{ - "name":{ - "type":"string", - "description":"Long name of a detected language (e.g. English, French)." - }, - "iso6391Name":{ - "type":"string", - "description":"A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr)." - }, - "confidenceScore":{ - "type":"number", - "format":"double", - "description":"A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." - } + } + }, + "AspectRelation": { + "type": "object", + "required": [ + "ref", + "relationType" + ], + "properties": { + "relationType": { + "type": "string", + "enum": [ + "opinion", + "aspect" + ], + "x-ms-enum": { + "name": "AspectRelationType", + "modelAsString": false + }, + "description": "The type related to the aspect." + }, + "ref": { + "type": "string", + "description": "The JSON pointer indicating the linked object." + } + } + }, + "AspectConfidenceScoreLabel": { + "type": "object", + "required": [ + "negative", + "positive" + ], + "properties": { + "positive": { + "type": "number", + "format": "double" + }, + "negative": { + "type": "number", + "format": "double" + } + }, + "description": "Represents the confidence scores across all sentiment classes: positive, neutral, negative." + }, + "EntitiesResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentEntities" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "PiiEntitiesResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/PiiDocumentEntities" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "DocumentEntities": { + "type": "object", + "required": [ + "id", + "entities", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "type": "array", + "description": "Recognized entities in the document.", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + } + } + }, + "PiiDocumentEntities": { + "type": "object", + "required": [ + "id", + "entities", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "type": "array", + "description": "Recognized entities in the document.", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + }, + "redactedText": { + "type": "string", + "description": "Returns redacted text." + } + } + }, + "Entity": { + "type": "object", + "required": [ + "text", + "category", + "offset", + "length", + "confidenceScore" + ], + "properties": { + "text": { + "type": "string", + "description": "Entity text as appears in the request." + }, + "category": { + "type": "string", + "description": "Entity type, such as Person/Location/Org/SSN etc" + }, + "subcategory": { + "type": "string", + "description": "Entity sub type, such as Age/Year/TimeRange etc" + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "Start position for the entity text." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length for the entity text." + }, + "confidenceScore": { + "type": "number", + "format": "double", + "description": "Confidence score between 0 and 1 of the extracted entity." + } + } + }, + "EntityLinkingResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentLinkedEntities" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." } - } + } + }, + "DocumentLinkedEntities": { + "type": "object", + "required": [ + "id", + "entities", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "type": "array", + "description": "Recognized well-known entities in the document.", + "items": { + "$ref": "#/definitions/LinkedEntity" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + } + } + }, + "LinkedEntity": { + "type": "object", + "required": [ + "name", + "matches", + "language", + "url", + "dataSource" + ], + "properties": { + "name": { + "type": "string", + "description": "Entity Linking formal name." + }, + "matches": { + "type": "array", + "description": "List of instances this entity appears in the text.", + "items": { + "$ref": "#/definitions/Match" + } + }, + "language": { + "type": "string", + "description": "Language used in the data source." + }, + "id": { + "type": "string", + "description": "Unique identifier of the recognized entity from the data source." + }, + "url": { + "type": "string", + "description": "URL for the entity's page from the data source." + }, + "dataSource": { + "type": "string", + "description": "Data source used to extract entity linking, such as Wiki/Bing etc." + }, + "bingId": { + "type": "string", + "description": "Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information." + } + } + }, + "Match": { + "type": "object", + "required": [ + "confidenceScore", + "text", + "offset", + "length" + ], + "properties": { + "confidenceScore": { + "type": "number", + "format": "double", + "description": "If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned." + }, + "text": { + "type": "string", + "description": "Entity text as appears in the request." + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "Start position for the entity match text." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length for the entity match text." + } + } + }, + "KeyPhraseResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentKeyPhrases" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "DocumentKeyPhrases": { + "type": "object", + "required": [ + "id", + "keyPhrases", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "keyPhrases": { + "type": "array", + "description": "A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.", + "items": { + "type": "string" + } + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + } + } + }, + "LanguageBatchInput": { + "type": "object", + "required": [ + "documents" + ], + "properties": { + "documents": { + "type": "array", + "items": { + "$ref": "#/definitions/LanguageInput" + } + } + } + }, + "LanguageInput": { + "type": "object", + "required": [ + "id", + "text" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "text": { + "type": "string" + }, + "countryHint": { + "type": "string" + } + } + }, + "LanguageResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentLanguage" + } + }, + "errors": { + "type": "array", + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + } + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + }, + "modelVersion": { + "type": "string", + "description": "This field indicates which model is used for scoring." + } + } + }, + "DocumentLanguage": { + "type": "object", + "required": [ + "id", + "detectedLanguage", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "detectedLanguage": { + "description": "Detected Language.", + "$ref": "#/definitions/DetectedLanguage" + }, + "warnings": { + "type": "array", + "description": "Warnings encountered while processing document.", + "items": { + "$ref": "#/definitions/TextAnalyticsWarning" + } + }, + "statistics": { + "description": "if showStats=true was specified in the request this field will contain information about the document payload.", + "$ref": "#/definitions/DocumentStatistics" + } + } + }, + "DetectedLanguage": { + "type": "object", + "required": [ + "name", + "iso6391Name", + "confidenceScore" + ], + "properties": { + "name": { + "type": "string", + "description": "Long name of a detected language (e.g. English, French)." + }, + "iso6391Name": { + "type": "string", + "description": "A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr)." + }, + "confidenceScore": { + "type": "number", + "format": "double", + "description": "A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." + } + } + } }, - "parameters":{ - "Endpoint":{ - "name":"Endpoint", - "description":"Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", - "x-ms-parameter-location":"client", - "required":true, - "type":"string", - "in":"path", - "x-ms-skip-url-encoding":true - }, - "StringIndexType":{ - "name":"stringIndexType", - "in":"query", - "type":"string", - "description":"(Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets", - "default":"TextElements_v8", - "enum":[ - "TextElements_v8", - "UnicodeCodePoint", - "Utf16CodeUnit" - ], - "x-ms-enum":{ - "name":"StringIndexType", - "modelAsString":false, - "values":[ - { - "value":"TextElements_v8", - "description":"Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." - }, - { - "value":"UnicodeCodePoint", - "description":"Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." - }, - { - "value":"Utf16CodeUnit", - "description":"Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." - } - ] - }, - "x-ms-parameter-location":"method" - }, - "ShowStats":{ - "name":"showStats", - "in":"query", - "description":"(Optional) if set to true, response will contain request and document level statistics.", - "type":"boolean", - "required":false, - "x-ms-parameter-location":"method" - }, - "ModelVersion":{ - "name":"model-version", - "in":"query", - "description":"(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", - "type":"string", - "required":false, - "x-ms-parameter-location":"method" - }, - "MultiLanguageInput":{ - "in":"body", - "name":"input", - "description":"Collection of documents to analyze.", - "required":true, - "schema":{ - "$ref":"#/definitions/MultiLanguageBatchInput" - }, - "x-ms-parameter-location":"method" - }, - "LanguageInput":{ - "in":"body", - "name":"input", - "description":"Collection of documents to analyze for language endpoint.", - "required":true, - "schema":{ - "$ref":"#/definitions/LanguageBatchInput" - }, - "x-ms-parameter-location":"method" - } + "parameters": { + "Endpoint": { + "name": "Endpoint", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "StringIndexType": { + "name": "stringIndexType", + "in": "query", + "type": "string", + "description": "(Optional) Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets", + "default": "TextElements_v8", + "enum": [ + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" + ], + "x-ms-enum": { + "name": "StringIndexType", + "modelAsString": false, + "values": [ + { + "value": "TextElements_v8", + "description": "Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." + }, + { + "value": "UnicodeCodePoint", + "description": "Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." + }, + { + "value": "Utf16CodeUnit", + "description": "Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." + } + ] + }, + "x-ms-parameter-location": "method" + }, + "ShowStats": { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain request and document level statistics.", + "type": "boolean", + "required": false, + "x-ms-parameter-location": "method" + }, + "ModelVersion": { + "name": "model-version", + "in": "query", + "description": "(Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. ", + "type": "string", + "required": false, + "x-ms-parameter-location": "method" + }, + "MultiLanguageInput": { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + }, + "x-ms-parameter-location": "method" + }, + "LanguageInput": { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze for language endpoint.", + "required": true, + "schema": { + "$ref": "#/definitions/LanguageBatchInput" + }, + "x-ms-parameter-location": "method" + } } -} \ No newline at end of file +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json index 31db89c5811c..ba8237313640 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json @@ -39,7 +39,7 @@ "confidenceScore": 0.65 } ], - "redactedText" : "Microsoft employee with ssn ******** is using our awesome API's.", + "redactedText": "Microsoft employee with ssn ******** is using our awesome API's.", "warnings": [] }, { From 89ff1fe1c88cdc34628f4b0d6e689b414d43e589 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Thu, 20 Aug 2020 19:27:44 -0700 Subject: [PATCH 17/20] fix prettier check in v2.1 --- .../data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json index 34c7948655ea..b5b5b3c7b662 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json @@ -595,4 +595,4 @@ "x-ms-skip-url-encoding": true } } -} \ No newline at end of file +} From 76fd1cbe9fbe53c06aefb5d15f1c55d7608ada68 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Mon, 24 Aug 2020 12:11:46 -0700 Subject: [PATCH 18/20] resolve PR comments --- .../examples/SuccessfulEntitiesRequest.json | 22 ------ .../SuccessfulEntityLinkingRequest.json | 22 ------ .../examples/SuccessfulEntityPIIRequest.json | 22 ------ .../examples/SuccessfulKeyPhrasesRequest.json | 22 ------ .../examples/SuccessfulLanguagesRequest.json | 22 ------ .../examples/SuccessfulSentimentRequest.json | 22 ------ .../preview/v3.1-preview.1/TextAnalytics.json | 74 +------------------ .../examples/SuccessfulEntitiesRequest.json | 22 ------ .../SuccessfulEntityLinkingRequest.json | 22 ------ .../examples/SuccessfulEntityPIIRequest.json | 22 ------ .../examples/SuccessfulKeyPhrasesRequest.json | 22 ------ .../examples/SuccessfulLanguagesRequest.json | 22 ------ .../examples/SuccessfulSentimentRequest.json | 22 ------ .../preview/v3.1-preview.2/TextAnalytics.json | 72 ------------------ .../examples/SuccessfulEntitiesRequest.json | 22 ------ .../SuccessfulEntityLinkingRequest.json | 22 ------ .../examples/SuccessfulEntityPIIRequest.json | 22 ------ .../examples/SuccessfulKeyPhrasesRequest.json | 22 ------ .../examples/SuccessfulLanguagesRequest.json | 22 ------ .../examples/SuccessfulSentimentRequest.json | 22 ------ .../stable/v3.0/TextAnalytics.json | 60 --------------- .../examples/SuccessfulEntitiesRequest.json | 22 ------ .../SuccessfulEntityLinkingRequest.json | 22 ------ .../examples/SuccessfulKeyPhrasesRequest.json | 22 ------ .../examples/SuccessfulLanguagesRequest.json | 22 ------ .../examples/SuccessfulSentimentRequest.json | 22 ------ 26 files changed, 1 insertion(+), 711 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json index 93f2e090ce72..babd6e22d296 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json @@ -83,28 +83,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innerError": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json index 5a863150d574..c58af39167b9 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -91,28 +91,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innerError": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json index b0059c25145f..29cba30d10b6 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -70,28 +70,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innerError": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json index b45f1ff4339a..4a61dd56c123 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -52,28 +52,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innerError": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json index 454f51b83fb5..071bf51ea8c9 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json @@ -59,28 +59,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innerError": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json index 495ad8b74be0..a61d236644d0 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json @@ -114,28 +114,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innerError": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json index 4333469127d3..5c41eeb3dddb 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json @@ -66,18 +66,6 @@ "$ref": "#/definitions/EntitiesResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -133,18 +121,6 @@ "$ref": "#/definitions/EntitiesResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -194,18 +170,6 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -252,18 +216,6 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -310,18 +262,6 @@ "$ref": "#/definitions/LanguageResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -377,18 +317,6 @@ "$ref": "#/definitions/SentimentResponse" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -1402,7 +1330,7 @@ } ] }, - "x-ms-parameter-location": "client" + "x-ms-parameter-location": "method" }, "ShowStats": { "name": "showStats", diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json index 38f75c3f16b9..75b4489dcb2d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json @@ -86,28 +86,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityLinkingRequest.json index 09cb2c7a9495..caf12d36bc11 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -94,28 +94,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json index cc07cabf32ba..70d30744fd02 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -73,28 +73,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json index 6de512d13179..12ff0ccce583 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -55,28 +55,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulLanguagesRequest.json index f5e67806fac5..a74d7155c8e0 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulLanguagesRequest.json @@ -56,28 +56,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulSentimentRequest.json index e01a3f42a372..ad3fc48d2cae 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulSentimentRequest.json @@ -318,28 +318,6 @@ "errors": [], "modelVersion": "2020-04-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index f5b0f0045819..907fc7cb4bad 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -66,18 +66,6 @@ "$ref": "#/definitions/EntitiesResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -133,18 +121,6 @@ "$ref": "#/definitions/PiiEntitiesResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -194,18 +170,6 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -252,18 +216,6 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -310,18 +262,6 @@ "$ref": "#/definitions/LanguageResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -377,18 +317,6 @@ "$ref": "#/definitions/SentimentResponse" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json index 38f75c3f16b9..75b4489dcb2d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntitiesRequest.json @@ -86,28 +86,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json index fa894d4df480..2ad23b9ad32c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityLinkingRequest.json @@ -96,28 +96,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json index ba8237313640..90d2ea58bd29 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulEntityPIIRequest.json @@ -76,28 +76,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json index 6de512d13179..12ff0ccce583 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulKeyPhrasesRequest.json @@ -55,28 +55,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json index f5e67806fac5..a74d7155c8e0 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulLanguagesRequest.json @@ -56,28 +56,6 @@ "errors": [], "modelVersion": "2019-10-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json index e01a3f42a372..ad3fc48d2cae 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/examples/SuccessfulSentimentRequest.json @@ -318,28 +318,6 @@ "errors": [], "modelVersion": "2020-04-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json index 1ded16317a63..7cb1299f0de4 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json @@ -77,18 +77,6 @@ "$ref": "#/definitions/EntitiesResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -147,18 +135,6 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -217,18 +193,6 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -287,18 +251,6 @@ "$ref": "#/definitions/LanguageResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -357,18 +309,6 @@ "$ref": "#/definitions/SentimentResponse" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json index 6ae237620605..4217d33a1c61 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntitiesRequest.json @@ -86,28 +86,6 @@ "errors": [], "modelVersion": "2020-04-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "missingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json index b77f8689160f..ecb5818e578a 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulEntityLinkingRequest.json @@ -94,28 +94,6 @@ "errors": [], "modelVersion": "2020-04-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "missingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json index 1bae21a8fe9d..77ea9c553b0e 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulKeyPhrasesRequest.json @@ -55,28 +55,6 @@ "errors": [], "modelVersion": "2020-04-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "missingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json index 04bc8c44390c..3cee2aef5bd1 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulLanguagesRequest.json @@ -56,28 +56,6 @@ "errors": [], "modelVersion": "2020-04-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "missingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json index 5c4dc9af0edd..680392d80510 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/examples/SuccessfulSentimentRequest.json @@ -122,28 +122,6 @@ "errors": [], "modelVersion": "2020-04-01" } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "invalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "missingInputRecords", - "message": "Missing input records." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "internalServerError", - "message": "Internal Server Error" - } - } } } } From a64c2bde9739024c6da7436d85068d4dc0589ca5 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Mon, 24 Aug 2020 14:43:01 -0700 Subject: [PATCH 19/20] resolve PR comments --- .../preview/v3.0-preview.1/TextAnalytics.json | 72 ------------------- .../preview/v3.1-preview.2/TextAnalytics.json | 2 +- 2 files changed, 1 insertion(+), 73 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json index 9860884d947f..8b30ef934161 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json @@ -77,18 +77,6 @@ "$ref": "#/definitions/EntitiesResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -147,18 +135,6 @@ "$ref": "#/definitions/EntitiesResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -217,18 +193,6 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -287,18 +251,6 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -357,18 +309,6 @@ "$ref": "#/definitions/LanguageResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { @@ -427,18 +367,6 @@ "$ref": "#/definitions/SentimentResponse" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, "default": { "description": "Error Response", "schema": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index 907fc7cb4bad..de9788868777 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -1385,7 +1385,7 @@ ], "x-ms-enum": { "name": "StringIndexType", - "modelAsString": false, + "modelAsString": true, "values": [ { "value": "TextElements_v8", From 877b90a020f243923b7eebe8e3bc75450347dee2 Mon Sep 17 00:00:00 2001 From: Lakshmanan Ramu Meenal Date: Tue, 25 Aug 2020 08:51:41 -0700 Subject: [PATCH 20/20] resolve PR comments --- .../TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json | 4 ++-- .../TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json index 5c41eeb3dddb..d60fb072603e 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json @@ -420,7 +420,7 @@ ], "x-ms-enum": { "name": "ErrorCodeValue", - "modelAsString": false + "modelAsString": true }, "description": "Error code." }, @@ -1314,7 +1314,7 @@ ], "x-ms-enum": { "name": "StringIndexType", - "modelAsString": false, + "modelAsString": true, "values": [ { "value": "TextElements_v8", diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json index de9788868777..4aec8e79c37b 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.2/TextAnalytics.json @@ -420,7 +420,7 @@ ], "x-ms-enum": { "name": "ErrorCodeValue", - "modelAsString": false + "modelAsString": true }, "description": "Error code." },