From c9f6209f22522d5fd801bdca8d0278a63785552b Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 17 Jul 2020 16:15:18 -0700 Subject: [PATCH 01/54] Adds base for updating TextAnalytics from version preview/v3.1-preview.1 to version 2018-05-01-privatepreview --- .../TextAnalytics.json | 1345 +++++++++++++++++ .../examples/SuccessfulEntitiesRequest.json | 91 ++ .../SuccessfulEntityLinkingRequest.json | 99 ++ .../examples/SuccessfulEntityPIIRequest.json | 78 + .../examples/SuccessfulKeyPhrasesRequest.json | 60 + .../examples/SuccessfulLanguagesRequest.json | 67 + .../examples/SuccessfulSentimentRequest.json | 323 ++++ 7 files changed, 2063 insertions(+) create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntitiesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityLinkingRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityPIIRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulKeyPhrasesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulLanguagesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulSentimentRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json new file mode 100644 index 000000000000..0ff15eff3ba9 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json @@ -0,0 +1,1345 @@ +{ + "swagger": "2.0", + "info": { + "version": "v3.1-preview.1", + "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 + }, + { + "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": "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" + }, + { + "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": "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." + } + } + }, + "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", + "detectedLanguages", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "detectedLanguages": { + "type": "array", + "description": "A list of extracted languages.", + "items": { + "$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/2018-05-01-privatepreview/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntitiesRequest.json new file mode 100644 index 000000000000..75b4489dcb2d --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/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/2018-05-01-privatepreview/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityLinkingRequest.json new file mode 100644 index 000000000000..caf12d36bc11 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityLinkingRequest.json @@ -0,0 +1,99 @@ +{ + "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" + } + ], + "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" + } + ], + "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/2018-05-01-privatepreview/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityPIIRequest.json new file mode 100644 index 000000000000..70d30744fd02 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/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/2018-05-01-privatepreview/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulKeyPhrasesRequest.json new file mode 100644 index 000000000000..12ff0ccce583 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/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/2018-05-01-privatepreview/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulLanguagesRequest.json new file mode 100644 index 000000000000..fad894b10669 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulLanguagesRequest.json @@ -0,0 +1,67 @@ +{ + "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", + "detectedLanguages": [ + { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 1 + } + ], + "warnings": [] + }, + { + "id": "2", + "detectedLanguages": [ + { + "name": "French", + "iso6391Name": "fr", + "confidenceScore": 1 + } + ], + "warnings": [] + }, + { + "id": "3", + "detectedLanguages": [ + { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 1 + } + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2019-10-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulSentimentRequest.json new file mode 100644 index 000000000000..ad3fc48d2cae --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/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 95aa0dc49c8bcb0de0d5bd21e0c58413244b6aa1 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 17 Jul 2020 16:15:34 -0700 Subject: [PATCH 02/54] Updates readme --- .../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..894fff1f8c0b 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -279,3 +279,12 @@ uncomment the `exclude-file` section below and add the file paths. # - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json ``` +### Tag: package-preview-2018-05 + +These settings apply only when `--tag=package-preview-2018-05` is specified on the command line. + +```yaml $(tag) == 'package-preview-2018-05' +input-file: + - preview/2018-05-01-privatepreview/TextAnalytics.json +``` + From 6bc92e606c980740da96d116f6be0042cb0719f2 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 17 Jul 2020 16:15:36 -0700 Subject: [PATCH 03/54] Updates API version in new specs and examples --- .../preview/2018-05-01-privatepreview/TextAnalytics.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json index 0ff15eff3ba9..e2dd7cf1f278 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "v3.1-preview.1", + "version": "2018-05-01-privatepreview", "contact": { "name": "Microsoft Cognitive Services", "url": "https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", @@ -23,7 +23,7 @@ } ], "x-ms-parameterized-host": { - "hostTemplate": "{Endpoint}/text/analytics/v3.1-preview.1", + "hostTemplate": "{Endpoint}/text/analytics/2018-05-01-privatepreview", "useSchemePrefix": false, "parameters": [ { From 2a3dabe2fd03d0003cd3cff4e465d96746f3feef Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Thu, 23 Jul 2020 20:07:16 -0700 Subject: [PATCH 04/54] v3.2-preview.1 /analyze + examples --- .../TextAnalytics.json | 1345 ----------------- .../examples/SuccessfulEntitiesRequest.json | 91 -- .../SuccessfulEntityLinkingRequest.json | 99 -- .../examples/SuccessfulEntityPIIRequest.json | 78 - .../examples/SuccessfulKeyPhrasesRequest.json | 60 - .../examples/SuccessfulLanguagesRequest.json | 67 - .../examples/SuccessfulSentimentRequest.json | 323 ---- .../preview/v3.1-preview.1/TextAnalytics.json | 456 +++++- .../examples/SuccessfulAnalyzeRequest.json | 41 + .../SuccessfulAnalyzeStatusRequest.json | 126 ++ .../examples/SuccessfulEntitiesRequest.json | 77 +- .../SuccessfulEntityLinkingRequest.json | 105 +- .../examples/SuccessfulEntityPIIRequest.json | 41 +- .../examples/SuccessfulKeyPhrasesRequest.json | 29 +- .../examples/SuccessfulLanguagesRequest.json | 41 +- .../examples/SuccessfulSentimentRequest.json | 303 +--- 16 files changed, 819 insertions(+), 2463 deletions(-) delete mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json delete mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntitiesRequest.json delete mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityLinkingRequest.json delete mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityPIIRequest.json delete mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulKeyPhrasesRequest.json delete mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulLanguagesRequest.json delete mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulSentimentRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeStatusRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json deleted file mode 100644 index e2dd7cf1f278..000000000000 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/TextAnalytics.json +++ /dev/null @@ -1,1345 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "2018-05-01-privatepreview", - "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/2018-05-01-privatepreview", - "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 - }, - { - "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": "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" - }, - { - "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": "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." - } - } - }, - "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", - "detectedLanguages", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "detectedLanguages": { - "type": "array", - "description": "A list of extracted languages.", - "items": { - "$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/2018-05-01-privatepreview/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntitiesRequest.json deleted file mode 100644 index 75b4489dcb2d..000000000000 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntitiesRequest.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "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/2018-05-01-privatepreview/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityLinkingRequest.json deleted file mode 100644 index caf12d36bc11..000000000000 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityLinkingRequest.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "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" - } - ], - "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" - } - ], - "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/2018-05-01-privatepreview/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityPIIRequest.json deleted file mode 100644 index 70d30744fd02..000000000000 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulEntityPIIRequest.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "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/2018-05-01-privatepreview/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulKeyPhrasesRequest.json deleted file mode 100644 index 12ff0ccce583..000000000000 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulKeyPhrasesRequest.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "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/2018-05-01-privatepreview/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulLanguagesRequest.json deleted file mode 100644 index fad894b10669..000000000000 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulLanguagesRequest.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "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", - "detectedLanguages": [ - { - "name": "English", - "iso6391Name": "en", - "confidenceScore": 1 - } - ], - "warnings": [] - }, - { - "id": "2", - "detectedLanguages": [ - { - "name": "French", - "iso6391Name": "fr", - "confidenceScore": 1 - } - ], - "warnings": [] - }, - { - "id": "3", - "detectedLanguages": [ - { - "name": "Spanish", - "iso6391Name": "es", - "confidenceScore": 1 - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2019-10-01" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulSentimentRequest.json deleted file mode 100644 index ad3fc48d2cae..000000000000 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/2018-05-01-privatepreview/examples/SuccessfulSentimentRequest.json +++ /dev/null @@ -1,323 +0,0 @@ -{ - "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" - } - } - } -} 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 0ff15eff3ba9..b1aa56009097 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 @@ -1,14 +1,14 @@ { "swagger": "2.0", "info": { - "version": "v3.1-preview.1", + "version": "v3.2-preview.1", "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" + "description": "The Text Analytics API is a suite of natural language processing (NLP) 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. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" }, "securityDefinitions": { "apim_key": { @@ -23,7 +23,7 @@ } ], "x-ms-parameterized-host": { - "hostTemplate": "{Endpoint}/text/analytics/v3.1-preview.1", + "hostTemplate": "{Endpoint}/text/analytics/v3.2-preview.1", "useSchemePrefix": false, "parameters": [ { @@ -32,6 +32,129 @@ ] }, "paths": { + "/analyze": { + "post": { + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "description": "Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed.", + "operationId": "Analyze", + "summary": "Submit analysis job", + "parameters": [ + { + "description": "Collection of documents to analyze and tasks to execute.", + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/AnalyzeBatchInput" + } + } + ], + "responses": { + "202": { + "description": "A successful call results with an operation-location header used to check the status of the analysis job.", + "headers": { + "Operation-Location": { + "format": "uri", + "type": "string" + } + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Submit analysis job request": { + "$ref": ".//examples//SuccessfulAnalyzeRequest.json" + } + }, + "deprecated": false + } + }, + "/analyze/jobs/{jobid}": { + "get": { + "produces": [ + "application/json", + "text/json" + ], + "description": "Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are completed, the job will transition to the completed state and results will be available for each task.", + "operationId": "AnalyzeStatus", + "summary": "Get analysis status and results", + "parameters": [ + { + "description": "Job ID", + "format": "uuid", + "in": "path", + "name": "jobid", + "required": true, + "type": "string" + }, + { + "description": "(Optional) if set to true, response will contain input and document level statistics.", + "in": "query", + "name": "showStats", + "type": "boolean" + }, + { + "default": 20, + "description": "(Optional) Set the maximum number of results per task.", + "in": "query", + "maximum": 50, + "minimum": 1, + "name": "$top", + "type": "integer" + }, + { + "description": "(Optional) Set the number of elements to offset in the response.", + "in": "query", + "minimum": 0, + "name": "$skip", + "type": "integer" + } + ], + "responses": { + "200": { + "description": "Analysis job status and metadata.", + "schema": { + "$ref": "#/definitions/AnalyzeJobState" + } + }, + "404": { + "description": "Job ID not found.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Get Analysis job status request": { + "$ref": ".//examples//SuccessfulAnalyzeStatusRequest.json" + } + }, + "deprecated": false + } + }, "/entities/recognition/general": { "post": { "summary": "Named Entity Recognition", @@ -50,15 +173,29 @@ "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 + "type": "boolean" + }, + { + "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": true + } }, { "in": "body", @@ -124,6 +261,22 @@ "description": "(Optional) if set to 'PHI', response will contain only PHI entities.", "type": "string" }, + { + "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": true + } + }, { "in": "body", "name": "input", @@ -182,6 +335,22 @@ "description": "(Optional) if set to true, response will contain input and document level statistics.", "type": "boolean" }, + { + "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": true + } + }, { "in": "body", "name": "input", @@ -362,6 +531,22 @@ "description": "(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", "type": "boolean" }, + { + "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": true + } + }, { "in": "body", "name": "input", @@ -570,6 +755,238 @@ } } }, + "AnalyzeBatchInput": { + "allOf": [ + { + "$ref": "#/definitions/JobDescriptor" + }, + { + "$ref": "#/definitions/MultiLanguageBatchInput" + }, + { + "$ref": "#/definitions/AnalysisTasks" + } + ] + }, + "AnalyzeJobState": { + "allOf": [ + { + "$ref": "#/definitions/JobMetadata" + }, + { + "$ref": "#/definitions/TasksState" + }, + { + "properties": { + "errors": { + "items": { + "$ref": "#/definitions/TextAnalyticsError" + }, + "type": "array" + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + } + }, + "type": "object" + }, + { + "$ref": "#/definitions/Pagination" + } + ] + }, + "CustomClassification": { + "properties": { + "confidenceScore": { + "example": 0.87, + "format": "double", + "type": "number" + }, + "name": { + "example": "hotel booking", + "type": "string" + } + }, + "required": [ + "name", + "confidenceScore" + ], + "type": "object" + }, + "CustomClassificationResult": { + "properties": { + "documents": { + "description": "Response by document", + "items": { + "$ref": "#/definitions/CustomClassifications" + }, + "type": "array" + }, + "errors": { + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + }, + "type": "array" + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + } + }, + "required": [ + "documents", + "errors" + ], + "type": "object" + }, + "CustomClassificationTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "appId": { + "type": "string" + }, + "slotName": { + "type": "string" + } + }, + "required": [ + "appId", + "slotName" + ], + "type": "object" + } + }, + "required": [ + "parameters" + ], + "type": "object" + } + ] + }, + "CustomClassifications": { + "items": { + "$ref": "#/definitions/CustomClassification" + }, + "type": "array" + }, + "CustomEntities": { + "items": { + "$ref": "#/definitions/CustomEntity" + }, + "type": "array" + }, + "CustomEntitiesResult": { + "properties": { + "documents": { + "description": "Response by document", + "items": { + "$ref": "#/definitions/CustomEntities" + }, + "type": "array" + }, + "errors": { + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + }, + "type": "array" + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + } + }, + "required": [ + "documents", + "errors" + ], + "type": "object" + }, + "CustomEntitiesTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "appId": { + "type": "string" + }, + "slotName": { + "type": "string" + }, + "stringIndexType": { + "default": "textelements_v8", + "enum": [ + "textelements_v8", + "unicodecodepoint", + "utf16codeunit" + ], + "type": "string" + } + }, + "required": [ + "appId", + "slotName" + ], + "type": "object" + } + }, + "required": [ + "parameters" + ], + "type": "object" + } + ] + }, + "CustomEntity": { + "properties": { + "category": { + "example": "address", + "type": "string" + }, + "children": { + "example": [ + { + "category": "city", + "confidenceScore": 0.78, + "length": 3, + "offset": 5 + } + ], + "items": { + "$ref": "#/definitions/CustomEntity" + }, + "type": "array" + }, + "confidenceScore": { + "example": 0.96, + "type": "number" + }, + "length": { + "example": 7, + "type": "number" + }, + "offset": { + "example": 3, + "type": "number" + } + }, + "required": [ + "category", + "offset", + "length", + "confidenceScore" + ], + "type": "object" + }, "SentimentResponse": { "type": "object", "required": [ @@ -1244,6 +1661,33 @@ } } }, + "Pagination": { + "properties": { + "@nextLink": { + "format": "uri", + "type": "string" + } + }, + "type": "object" + }, + "PiiResult": { + "allOf": [ + { + "$ref": "#/definitions/EntitiesResult" + }, + { + "properties": { + "redactedText": { + "type": "string" + } + }, + "required": [ + "redactedText" + ], + "type": "object" + } + ] + }, "LanguageResult": { "type": "object", "required": [ diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeRequest.json new file mode 100644 index 000000000000..4cbaed612055 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}", + "input": { + "displayName": "Extracting Location & US Region", + "documents": [ + { + "id": "1", + "language": "en", + "text": "I had a wonderful trip to Seattle last week." + }, + { + "id": "2", + "language": "en", + "text": "I'm flying to NYC tomorrow. See you there." + } + ], + "tasks": [ + { + "type": "EntityRecognitionTask" + }, + { + "parameters": { + "appId": "71baed8c-a832-489d-8f38-e3b44685785f", + "slotName": "USRegionClassifier" + }, + "type": "CustomClassificationTask" + } + ] + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1//analyze/jobs/{jobId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeStatusRequest.json new file mode 100644 index 000000000000..be1d19779141 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -0,0 +1,126 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}", + "input": { + "displayName": "Extracting Location & US Region", + "documents": [ + { + "id": "1", + "language": "en", + "text": "I had a wonderful trip to Seattle last week." + }, + { + "id": "2", + "language": "en", + "text": "I'm flying to NYC tomorrow. See you there." + } + ], + "tasks": [ + { + "type": "EntityRecognitionTask" + }, + { + "parameters": { + "appId": "71baed8c-a832-489d-8f38-e3b44685785f", + "slotName": "USRegionClassifier" + }, + "type": "CustomClassificationTask" + } + ] + } + }, + "responses": { + "200": { + "headers" : {}, + "body": { + "createdUpdateDateTime": "2020-10-01T15-01-03.45Z", + "displayName": "Extracting Location & US Region", + "expirationDateTime": "2020-10-03T15-01-03.55Z", + "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", + "lastUpdateDateTime": "2020-10-01T15-01-03.55Z", + "status": "succeeded", + "tasks": { + "completed": 2, + "details": [ + { + "lastUpdateDateTime": "2020-10-01T15-01-03.53Z", + "name": "Recognize Entities", + "results": { + "documents": [ + { + "entities": [ + { + "category": "Event", + "confidenceScore": 0.61, + "length": 4, + "offset": 18, + "text": "trip" + }, + { + "category": "Location", + "confidenceScore": 0.82, + "length": 7, + "offset": 26, + "subcategory": "GPE", + "text": "Seattle" + }, + { + "category": "DateTime", + "confidenceScore": 0.8, + "length": 9, + "offset": 34, + "subcategory": "DateRange", + "text": "last week" + } + ], + "id": "1", + "warnings": [] + }, + { + "entities": [ + { + "category": "Location", + "confidenceScore": 0.52, + "length": 3, + "offset": 14, + "subcategory": "GPE", + "text": "NYC" + }, + { + "category": "DateTime", + "confidenceScore": 0.8, + "length": 8, + "offset": 18, + "subcategory": "Date", + "text": "tomorrow" + } + ], + "id": "2", + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-04-01", + "result_type": "EntitiesResult" + }, + "status": "succeeded", + "type": "Recognize Entities" + }, + { + "lastUpdateDateTime": "2020-10-01T15-01-03.55Z", + "name": "Custom Classification 71baed8c-a832-489d-8f38-e3b44685785f/USRegionClassifier", + "results": null, + "status": "succeeded", + "type": "Custom Classification" + } + ], + "failed": 0, + "inProgress": 0, + "total": 2 + } + } + } + } +} 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..6aa19c223700 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 @@ -5,86 +5,67 @@ "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." + "text": "Microsoft was founded by Bill Gates and Paul Allen." }, { + "id": "2", "language": "en", - "id": "3", - "text": "I visited Space Needle 2 times." + "text": "Pike place market is my favorite Seattle attraction." } ] } }, "responses": { "200": { - "headers": {}, + "headers" : {}, "body": { "documents": [ { - "id": "1", "entities": [ { - "text": "Seattle", - "category": "Location", - "offset": 26, - "length": 7, - "confidenceScore": 0.80 + "category": "Organization", + "confidenceScore": 0.84, + "length": 9, + "offset": 0, + "text": "Microsoft" }, { - "text": "last week", - "category": "DateTime", - "subcategory": "DateRange", - "offset": 34, - "length": 9, - "confidenceScore": 0.8 - } - ], - "warnings": [] - }, - { - "id": "2", - "entities": [ + "category": "Person", + "confidenceScore": 0.85, + "length": 10, + "offset": 25, + "text": "Bill Gates" + }, { - "text": "Microsoft", - "category": "Organization", - "offset": 10, - "length": 9, - "confidenceScore": 0.99 + "category": "Person", + "confidenceScore": 0.9, + "length": 10, + "offset": 40, + "text": "Paul Allen" } ], + "id": "1", "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 + "category": "Location", + "confidenceScore": 0.55, + "length": 7, + "offset": 33, + "subcategory": "GPE", + "text": "Seattle" } ], + "id": "2", "warnings": [] } ], "errors": [], - "modelVersion": "2019-10-01" + "modelVersion": "2020-04-01" } } } 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..294eb8e0f951 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 @@ -5,19 +5,14 @@ "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." + "text": "Microsoft was founded by Bill Gates and Paul Allen." }, { + "id": "2", "language": "en", - "id": "3", - "text": "I visited Space Needle 2 times." + "text": "Pike place market is my favorite Seattle attraction." } ] } @@ -28,71 +23,93 @@ "body": { "documents": [ { - "id": "1", "entities": [ { - "name": "Seattle", + "dataSource": "Wikipedia", + "id": "Bill Gates", + "language": "en", "matches": [ { - "text": "Seattle", - "offset": 26, - "length": 7, - "confidenceScore": 0.15 + "confidenceScore": 0.52, + "length": 10, + "offset": 25, + "text": "Bill Gates" } ], + "name": "Bill Gates", + "url": "https://en.wikipedia.org/wiki/Bill_Gates" + }, + { + "dataSource": "Wikipedia", + "id": "Paul Allen", "language": "en", - "id": "Seattle", - "url": "https://en.wikipedia.org/wiki/Seattle", - "dataSource": "Wikipedia" - } - ], - "warnings": [] - }, - { - "id": "2", - "entities": [ + "matches": [ + { + "confidenceScore": 0.54, + "length": 10, + "offset": 40, + "text": "Paul Allen" + } + ], + "name": "Paul Allen", + "url": "https://en.wikipedia.org/wiki/Paul_Allen" + }, { - "name": "Microsoft", + "dataSource": "Wikipedia", + "id": "Microsoft", + "language": "en", "matches": [ { - "text": "Microsoft", - "offset": 10, + "confidenceScore": 0.49, "length": 9, - "confidenceScore": 0.18 + "offset": 0, + "text": "Microsoft" } ], - "language": "en", - "id": "Microsoft", - "url": "https://en.wikipedia.org/wiki/Microsoft", - "dataSource": "Wikipedia" + "name": "Microsoft", + "url": "https://en.wikipedia.org/wiki/Microsoft" } ], + "id": "1", "warnings": [] }, { - "id": "3", "entities": [ { - "name": "Space Needle", + "dataSource": "Wikipedia", + "id": "Pike Place Market", + "language": "en", "matches": [ { - "text": "Space Needle", - "offset": 10, - "length": 12, - "confidenceScore": 0.15 + "confidenceScore": 0.86, + "length": 17, + "offset": 0, + "text": "Pike place market" } ], + "name": "Pike Place Market", + "url": "https://en.wikipedia.org/wiki/Pike_Place_Market" + }, + { + "dataSource": "Wikipedia", + "id": "Seattle", "language": "en", - "id": "Space Needle", - "url": "https://en.wikipedia.org/wiki/Space_Needle", - "dataSource": "Wikipedia" + "matches": [ + { + "confidenceScore": 0.27, + "length": 7, + "offset": 33, + "text": "Seattle" + } + ], + "name": "Seattle", + "url": "https://en.wikipedia.org/wiki/Seattle" } ], + "id": "2", "warnings": [] } - ], - "errors": [], - "modelVersion": "2019-10-01" + ] } } } 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..cff4b63dd916 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 @@ -5,18 +5,18 @@ "input": { "documents": [ { + "id": "1", "language": "en", - "id": "0", - "text": "Microsoft employee with ssn 859-98-0987 is using our awesome API's." + "text": "My SSN is 859-98-0987" }, { + "id": "2", "language": "en", - "id": "1", "text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check." }, { + "id": "3", "language": "en", - "id": "2", "text": "Is 998.214.865-68 your Brazilian CPF number?" } ] @@ -28,45 +28,48 @@ "body": { "documents": [ { - "id": "0", "entities": [ { - "text": "859-98-0987", "category": "U.S. Social Security Number (SSN)", - "subcategory": "", - "offset": 28, + "confidenceScore": 0.65, "length": 11, - "confidenceScore": 0.65 + "offset": 28, + "redactedText": "My SSN is ***********", + "subcategory": "", + "text": "859-98-0987" } ], + "id": "1", "warnings": [] }, { - "id": "1", "entities": [ { - "text": "111000025", "category": "ABA Routing Number", - "subcategory": "", - "offset": 18, + "confidenceScore": 0.75, "length": 9, - "confidenceScore": 0.75 + "offset": 18, + "redactedText": "Your ABA number - ********* - is the first 9 digits in the lower left hand corner of your personal check.", + "subcategory": "", + "text": "111000025" } ], + "id": "2", "warnings": [] }, { - "id": "2", "entities": [ { - "text": "998.214.865-68", "category": "Brazil CPF Number", - "subcategory": "", - "offset": 3, + "confidenceScore": 0.85, "length": 14, - "confidenceScore": 0.85 + "offset": 3, + "redactedText": "Is ************** your Brazilian CPF number?", + "subcategory": "", + "text": "998.214.865-68" } ], + "id": "3", "warnings": [] } ], 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..4f86d597673a 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 @@ -5,19 +5,19 @@ "input": { "documents": [ { - "language": "en", "id": "1", - "text": "Hello world. This is some input text that I love." + "language": "en", + "text": "Microsoft was founded by Bill Gates and Paul Allen." }, { - "language": "fr", "id": "2", - "text": "Bonjour tout le monde" + "language": "en", + "text": "Text Analytics is one of the Azure Cognitive Services." }, { - "language": "es", "id": "3", - "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer." + "language": "en", + "text": "My cat might need to see a veterinarian." } ] } @@ -30,30 +30,29 @@ { "id": "1", "keyPhrases": [ - "world", - "input text" + "Bill Gates", + "Paul Allen", + "Microsoft" ], "warnings": [] }, { "id": "2", "keyPhrases": [ - "monde" + "Azure Cognitive Services", + "Text Analytics" ], "warnings": [] }, { "id": "3", "keyPhrases": [ - "carretera", - "tráfico", - "día" + "cat", + "veterinarian" ], "warnings": [] } - ], - "errors": [], - "modelVersion": "2019-10-01" + ] } } } 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 fad894b10669..16714e4ca2ac 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 @@ -5,7 +5,6 @@ "input": { "documents": [ { - "countryHint": "US", "id": "1", "text": "Hello world" }, @@ -15,7 +14,7 @@ }, { "id": "3", - "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer." + "text": "Hola mundo" } ] } @@ -26,41 +25,35 @@ "body": { "documents": [ { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "en", + "name": "English" + }, "id": "1", - "detectedLanguages": [ - { - "name": "English", - "iso6391Name": "en", - "confidenceScore": 1 - } - ], "warnings": [] }, { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "fr", + "name": "French" + }, "id": "2", - "detectedLanguages": [ - { - "name": "French", - "iso6391Name": "fr", - "confidenceScore": 1 - } - ], "warnings": [] }, { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "es", + "name": "Spanish" + }, "id": "3", - "detectedLanguages": [ - { - "name": "Spanish", - "iso6391Name": "es", - "confidenceScore": 1 - } - ], "warnings": [] } ], "errors": [], - "modelVersion": "2019-10-01" + "modelVersion": "2020-04-01" } } } 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..1592cc9d8af8 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 @@ -5,14 +5,9 @@ "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." + "text": "Great atmosphere. Close to plenty of restaurants, hotels, and transit! Staff are friendly and helpful." } ] } @@ -23,295 +18,115 @@ "body": { "documents": [ { - "id": "1", - "sentiment": "positive", "confidenceScores": { - "positive": 1.0, - "neutral": 0.0, - "negative": 0.0 + "negative": 0, + "neutral": 0, + "positive": 1 }, + "id": "1", "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 + "negative": 0, + "positive": 1 }, - "offset": 6, "length": 10, - "text": "atmosphere", + "offset": 6, "relations": [ { - "relationType": "opinion", - "ref": "#/documents/0/sentences/0/opinions/0" + "ref": "#/documents/0/sentences/0/opinions/0", + "relationType": "opinion" } - ] + ], + "sentiment": "positive", + "text": "atmosphere" } ], + "confidenceScores": { + "negative": 0, + "neutral": 0, + "positive": 1 + }, + "length": 17, + "offset": 0, "opinions": [ { - "sentiment": "positive", "confidenceScores": { - "positive": 1.0, - "negative": 0.0 + "negative": 0, + "positive": 1 }, - "offset": 0, + "isNegated": false, "length": 5, - "text": "great", - "isNegated": false + "offset": 0, + "sentiment": "positive", + "text": "great" } - ] + ], + "sentiment": "positive", + "text": "Great atmosphere." }, { - "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 + "negative": 0.01, + "positive": 0.99 }, - "offset": 37, "length": 11, - "text": "restaurants", + "offset": 37, "relations": [ { - "relationType": "opinion", - "ref": "#/documents/0/sentences/1/opinions/0" + "ref": "#/documents/0/sentences/1/opinions/0", + "relationType": "opinion" } - ] + ], + "sentiment": "positive", + "text": "restaurants" }, { - "sentiment": "positive", "confidenceScores": { - "positive": 0.99, - "negative": 0.01 + "negative": 0.01, + "positive": 0.99 }, - "offset": 50, "length": 6, - "text": "hotels", + "offset": 50, "relations": [ { - "relationType": "opinion", - "ref": "#/documents/0/sentences/1/opinions/0" + "ref": "#/documents/0/sentences/1/opinions/0", + "relationType": "opinion" } - ] - } - ], - "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" - } - ] + "text": "hotels" } ], - "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 + "negative": 0.01, + "neutral": 0.86, + "positive": 0.13 }, - "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" - } - ] - } - ], + "length": 52, + "offset": 18, "opinions": [ { - "sentiment": "negative", "confidenceScores": { - "positive": 0.03, - "negative": 0.97 + "negative": 0.01, + "positive": 0.99 }, - "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" - } - ] + "isNegated": false, + "length": 15, + "offset": 18, + "sentiment": "positive", + "text": "Close to plenty" } ], - "opinions": [ - { - "sentiment": "negative", - "confidenceScores": { - "positive": 0.0, - "negative": 1.0 - }, - "offset": 87, - "length": 8, - "text": "friendly", - "isNegated": true - } - ] + "sentiment": "neutral", + "text": "Close to plenty of restaurants, hotels, and transit!" } ], + "sentiment": "positive", "warnings": [] } ], From b25d48ac47639dea8abec3acb15da187e0fe36ca Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Thu, 23 Jul 2020 20:36:55 -0700 Subject: [PATCH 05/54] Adding tasks --- .../preview/v3.1-preview.1/TextAnalytics.json | 407 +++++++++++++++++- .../SuccessfulAnalyzeStatusRequest.json | 2 +- 2 files changed, 407 insertions(+), 2 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 b1aa56009097..4d325bfa271c 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 @@ -291,7 +291,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" } }, "default": { @@ -581,6 +581,21 @@ } }, "definitions": { + "AnalysisTasks": { + "properties": { + "tasks": { + "description": "The set of tasks to execute on the input documents. Cannot specify the same task more than once.", + "items": { + "$ref": "#/definitions/TextAnalyticsTask" + }, + "type": "array" + } + }, + "required": [ + "tasks" + ], + "type": "object" + }, "MultiLanguageBatchInput": { "type": "object", "required": [ @@ -679,6 +694,30 @@ } } }, + "TextAnalyticsResult": { + "discriminator": "resultType", + "properties": { + "resultType": { + "type": "string" + } + }, + "required": [ + "resultType" + ], + "type": "object" + }, + "TextAnalyticsTask": { + "discriminator": "type", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, "TextAnalyticsWarning": { "type": "object", "required": [ @@ -708,6 +747,74 @@ } } }, + "PiiTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "domain": { + "default": "none", + "enum": [ + "phi", + "none" + ], + "type": "string" + }, + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "default": "textelements_v8", + "enum": [ + "textelements_v8", + "unicodecodepoint", + "utf16codeunit" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, + "EntitiesTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "default": "textelements_v8", + "enum": [ + "textelements_v8", + "unicodecodepoint", + "utf16codeunit" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, "InnerError": { "type": "object", "required": [ @@ -1018,6 +1125,131 @@ } } }, + "SentimentTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + }, + "opinionMining": { + "default": false, + "type": "boolean" + }, + "stringIndexType": { + "default": "textelements_v8", + "enum": [ + "textelements_v8", + "unicodecodepoint", + "utf16codeunit" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": false, + "name": "State" + } + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, + "TaskState": { + "properties": { + "lastUpdateDateTime": { + "format": "date-time", + "type": "string" + }, + "name": { + "type": "string" + }, + "results": {}, + "status": { + "enum": [ + "notstarted", + "running", + "succeeded", + "failed" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": false, + "name": "State" + } + }, + "type": { + "enum": [ + "Detect Language", + "Extract Key Phrases", + "Analyze Sentiment", + "Recognize Linked Entities", + "Recognize Entities", + "Recognize PII Entities", + "Custom Classification", + "Custom Entities" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": false, + "name": "State" + } + } + }, + "required": [ + "name", + "type", + "status", + "lastUpdateDateTime" + ], + "type": "object" + }, + "TasksState": { + "properties": { + "tasks": { + "properties": { + "completed": { + "type": "integer" + }, + "details": { + "items": { + "$ref": "#/definitions/TaskState" + }, + "type": "array" + }, + "failed": { + "type": "integer" + }, + "inProgress": { + "type": "integer" + }, + "total": { + "type": "integer" + } + }, + "required": [ + "total", + "completed", + "failed", + "inProgress", + "details" + ], + "type": "object" + } + }, + "required": [ + "tasks" + ], + "type": "object" + }, "DocumentSentiment": { "type": "object", "required": [ @@ -1496,6 +1728,36 @@ } } }, + "EntityLinkingTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "default": "textelements_v8", + "enum": [ + "textelements_v8", + "unicodecodepoint", + "utf16codeunit" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, "LinkedEntity": { "type": "object", "required": [ @@ -1565,6 +1827,58 @@ } } }, + "JobDescriptor": { + "properties": { + "displayName": { + "description": "Optional display name for the analysis job.", + "type": "string" + } + }, + "type": "object" + }, + "JobMetadata": { + "properties": { + "createdDateTime": { + "format": "date-time", + "type": "string" + }, + "displayName": { + "type": "string" + }, + "expirationDateTime": { + "format": "date-time", + "type": "string" + }, + "jobId": { + "format": "uuid", + "type": "string" + }, + "lastUpdateDateTime": { + "format": "date-time", + "type": "string" + }, + "status": { + "enum": [ + "notstarted", + "running", + "succeeded", + "failed" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": false, + "name": "State" + } + } + }, + "required": [ + "jobId", + "lastUpdateDateTime", + "createdDateTime", + "status" + ], + "type": "object" + }, "KeyPhraseResult": { "type": "object", "required": [ @@ -1628,6 +1942,27 @@ } } }, + "KeyPhrasesTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, "LanguageBatchInput": { "type": "object", "required": [ @@ -1773,6 +2108,76 @@ "description": "A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." } } + }, + "TypedCustomClassificationResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/CustomClassificationResult" + } + ] + }, + "TypedCustomEntitiesResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/CustomEntitiesResult" + } + ] + }, + "TypedEntitiesResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/EntitiesResult" + } + ] + }, + "TypedEntityLinkingResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/EntityLinkingResult" + } + ] + }, + "TypedKeyPhraseResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/KeyPhraseResult" + } + ] + }, + "TypedPiiResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/PiiResult" + } + ] + }, + "TypedSentimentResponse": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/SentimentResponse" + } + ] } }, "parameters": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeStatusRequest.json index be1d19779141..bb885d0d6c2a 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -103,7 +103,7 @@ ], "errors": [], "modelVersion": "2020-04-01", - "result_type": "EntitiesResult" + "resultType": "EntitiesResult" }, "status": "succeeded", "type": "Recognize Entities" From ad9bd0fb40e9be97832f0d040522c15afa630e62 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Thu, 23 Jul 2020 22:04:54 -0700 Subject: [PATCH 06/54] Adding Healthcare --- .../preview/v3.1-preview.1/TextAnalytics.json | 284 +++++++++++++++++- 1 file changed, 279 insertions(+), 5 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 4d325bfa271c..4a8012ff4472 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 @@ -155,6 +155,129 @@ "deprecated": false } }, + "/entities/healthcare/jobs/{jobId}": { + "delete": { + "description": "Cancel healthcare prediction job.", + "parameters": [], + "responses": { + "202": { + "description": "Accepted - Cancel Job request has been received.", + "headers": { + "Operation-Location": { + "format": "uri", + "type": "string" + } + } + } + } + }, + "get": { + "description": "Get details of the healthcare prediction job specified by the jobId.", + "parameters": [ + { + "in": "query", + "name": "$skip", + "type": "number", + "description": "Skip the $skip entries in the collection. When both $top and $skip are supplied, $skip is applied first.", + "required": false + }, + { + "in": "query", + "name": "$top", + "type": "number", + "description": "Take the $top entries in the collection. When both $top and $skip are supplied, $skip is applied first.", + "required": false + }, + { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain request and document level statistics.", + "type": "boolean", + "required": false + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/HealthcareJobState" + } + } + } + } + }, + "/entities/healthcare/jobs": { + "post": { + "summary": "Health", + "description": "The API returns a list of recognized healthcare entities and relations for each valid document.", + "operationId": "Health", + "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", + "required": false + }, + { + "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": true + } + }, + { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + } + } + ], + "responses": { + "202": { + "description": "Accepted - call results in a link where the status of the submitted job can be checked via the GET operation.", + "headers": { + "Operation-Location": { + "format": "uri", + "type": "string" + } + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Health request": { + "$ref": ".//examples//SuccessfulHealthRequest.json" + } + }, + "deprecated": false + } + }, "/entities/recognition/general": { "post": { "summary": "Named Entity Recognition", @@ -1172,7 +1295,9 @@ "name": { "type": "string" }, - "results": {}, + "results": { + "$ref": "#/definitions/TextAnalyticsResult" + }, "status": { "enum": [ "notstarted", @@ -1642,21 +1767,21 @@ }, "category": { "type": "string", - "description": "Entity type, such as Person/Location/Org/SSN etc" + "description": "Entity type." }, "subcategory": { "type": "string", - "description": "Entity sub type, such as Age/Year/TimeRange etc" + "description": "(Optional) Entity sub type." }, "offset": { "type": "integer", "format": "int32", - "description": "Start position for the entity text." + "description": "Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned." }, "length": { "type": "integer", "format": "int32", - "description": "Length for the entity text." + "description": "Length for the entity text. Use of different 'stringIndexType' values can affect the length returned." }, "confidenceScore": { "type": "number", @@ -1758,6 +1883,155 @@ } ] }, + "HealthcareJobState": { + "allOf": [ + { + "$ref": "#/definitions/JobMetadata" + }, + { + "properties": { + "results": { + "$ref": "#/definitions/HealthcareResult" + } + }, + "type": "object" + }, + { + "$ref": "#/definitions/Pagination" + } + ] + }, + "HealthcareResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentHealthcareEntities" + } + }, + "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." + } + } + }, + "DocumentHealthcareEntities": { + "type": "object", + "required": [ + "id", + "entities", + "relations", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "description": "Gets or sets the list of recognized health entities in document.", + "type": "array", + "items": { + "$ref": "#/definitions/HealthcareEntity" + } + }, + "relations": { + "type": "array", + "items": { + "$ref": "#/definitions/HealthcareRelation" + } + }, + "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" + } + } + }, + "HealthcareEntity": { + "allOf": [ + { + "$ref": "#/definitions/Entity" + }, + { + "properties": { + "links": { + "description": "Entity references in known data sources.", + "type": "array", + "items": { + "$ref": "#/definitions/HealthcareEntityLink" + } + } + } + } + ] + }, + "HealthcareRelation": { + "type": "object", + "required": [ + "relationType", + "bidirectional", + "source", + "target" + ], + "properties": { + "relationType": { + "type": "string" + }, + "bidirectional": { + "description": "If true the relation between the entities is bidirectional, otherwise directionality is source to target.", + "type": "boolean" + }, + "source": { + "format": "uri", + "type": "string" + }, + "target": { + "format": "uri", + "type": "string" + } + } + }, + "HealthcareEntityLink": { + "type": "object", + "required": [ + "dataSource", + "id" + ], + "properties": { + "dataSource": { + "description": "Entity Catalog. Examples include: UMLS, CHV, MSH, etc.", + "type": "string" + }, + "id": { + "description": "Entity id in the given source catalog. Example: blood pressure - source: umls, concept_id: C1272641.", + "type": "string" + } + } + }, "LinkedEntity": { "type": "object", "required": [ From 270faeb7d41c483e02c3901b1b1ee4a41056e5fe Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Thu, 23 Jul 2020 22:05:23 -0700 Subject: [PATCH 07/54] Healthcare example --- .../examples/SuccessfulHealthRequest.json | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json new file mode 100644 index 000000000000..7ef372ac7be2 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json @@ -0,0 +1,199 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Subject is taking 100mg of ibuprofen twice daily." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "createdUpdateDateTime": "2020-10-01T15-01-03.45Z", + "displayName": "Contoso prescription", + "expirationDateTime": "2020-10-03T15-01-03.55Z", + "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", + "lastUpdateDateTime": "2020-10-01T15-01-03.55Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "1", + "entities": [ + { + "offset": 18, + "length": 5, + "text": "100mg", + "category": "Dosage", + "confidenceScore": 0.99, + "isNegated": false + }, + { + "offset": 27, + "length": 9, + "text": "ibuprofen", + "category": "MedicationName", + "confidenceScore": 1.0, + "isNegated": false, + "links": [ + { + "id": "C0020740", + "dataSource": "UMLS" + }, + { + "id": "0000019879", + "dataSource": "AOD" + }, + { + "id": "M01AE01", + "dataSource": "ATC" + }, + { + "id": "0046165", + "dataSource": "CCPSS" + }, + { + "id": "0000006519", + "dataSource": "CHV" + }, + { + "id": "2270-2077", + "dataSource": "CSP" + }, + { + "id": "DB01050", + "dataSource": "DRUGBANK" + }, + { + "id": "1611", + "dataSource": "GS" + }, + { + "id": "sh97005926", + "dataSource": "LCH_NW" + }, + { + "id": "LP16165-0", + "dataSource": "LNC" + }, + { + "id": "40458", + "dataSource": "MEDCIN" + }, + { + "id": "d00015", + "dataSource": "MMSL" + }, + { + "id": "D007052", + "dataSource": "MSH" + }, + { + "id": "WK2XYI10QM", + "dataSource": "MTHSPL" + }, + { + "id": "C561", + "dataSource": "NCI" + }, + { + "id": "C561", + "dataSource": "NCI_CTRP" + }, + { + "id": "00803", + "dataSource": "NCI_DCP" + }, + { + "id": "NSC0256857", + "dataSource": "NCI_DTP" + }, + { + "id": "WK2XYI10QM", + "dataSource": "NCI_FDA" + }, + { + "id": "CDR0000613511", + "dataSource": "NCI_NCI-GLOSS" + }, + { + "id": "002377", + "dataSource": "NDDF" + }, + { + "id": "CDR0000040475", + "dataSource": "PDQ" + }, + { + "id": "x02MO", + "dataSource": "RCD" + }, + { + "id": "5640", + "dataSource": "RXNORM" + }, + { + "id": "E-7772", + "dataSource": "SNM" + }, + { + "id": "C-603C0", + "dataSource": "SNMI" + }, + { + "id": "387207008", + "dataSource": "SNOMEDCT_US" + }, + { + "id": "m39860", + "dataSource": "USP" + }, + { + "id": "MTHU000060", + "dataSource": "USPMG" + }, + { + "id": "4017840", + "dataSource": "VANDF" + } + ] + }, + { + "offset": 37, + "length": 11, + "text": "twice daily", + "category": "Frequency", + "confidenceScore": 1, + "isNegated": false + } + ], + "relations": [ + { + "relationType": "DosageOfMedication", + "bidirectional": false, + "source": "#/documents/0/entities/0", + "target": "#/documents/0/entities/1" + }, + { + "relationType": "FrequencyOfMedication", + "bidirectional": false, + "source": "#/documents/0/entities/2", + "target": "#/documents/0/entities/1" + } + ] + } + ], + "errors": [], + "modelVersion": "2020-05-08" + } + } + } + } +} From 33e07cd3c8c5c7f97a33fec18592135299529e4c Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Thu, 23 Jul 2020 22:15:41 -0700 Subject: [PATCH 08/54] Removing displayName from healthcare example --- .../preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json index 7ef372ac7be2..eaec5c788e8b 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json @@ -17,7 +17,6 @@ "headers": {}, "body": { "createdUpdateDateTime": "2020-10-01T15-01-03.45Z", - "displayName": "Contoso prescription", "expirationDateTime": "2020-10-03T15-01-03.55Z", "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", "lastUpdateDateTime": "2020-10-01T15-01-03.55Z", From 35184d686f5b044f5770c29766c2f07cb27abf2d Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Thu, 23 Jul 2020 23:00:07 -0700 Subject: [PATCH 09/54] Restore v3.1-preview.1 and new v3.2-preview.1 folder --- .../preview/v3.1-preview.1/TextAnalytics.json | 23 +- .../examples/SuccessfulEntitiesRequest.json | 77 +- .../SuccessfulEntityLinkingRequest.json | 105 +- .../examples/SuccessfulEntityPIIRequest.json | 41 +- .../examples/SuccessfulKeyPhrasesRequest.json | 29 +- .../examples/SuccessfulLanguagesRequest.json | 41 +- .../examples/SuccessfulSentimentRequest.json | 303 +- .../preview/v3.2-preview.1/TextAnalytics.json | 2485 +++++++++++++++++ .../examples/SuccessfulAnalyzeRequest.json | 0 .../SuccessfulAnalyzeStatusRequest.json | 0 .../examples/SuccessfulEntitiesRequest.json | 72 + .../SuccessfulEntityLinkingRequest.json | 116 + .../examples/SuccessfulEntityPIIRequest.json | 81 + .../examples/SuccessfulHealthRequest.json | 0 .../examples/SuccessfulKeyPhrasesRequest.json | 59 + .../examples/SuccessfulLanguagesRequest.json | 60 + .../examples/SuccessfulSentimentRequest.json | 138 + .../data-plane/TextAnalytics/readme.md | 106 +- 18 files changed, 3437 insertions(+), 299 deletions(-) create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.1-preview.1 => v3.2-preview.1}/examples/SuccessfulAnalyzeRequest.json (100%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.1-preview.1 => v3.2-preview.1}/examples/SuccessfulAnalyzeStatusRequest.json (100%) create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.1-preview.1 => v3.2-preview.1}/examples/SuccessfulHealthRequest.json (100%) create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/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 4a8012ff4472..dc1c984ea4c5 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 @@ -86,7 +86,7 @@ "deprecated": false } }, - "/analyze/jobs/{jobid}": { + "/analyze/jobs/{jobId}": { "get": { "produces": [ "application/json", @@ -100,7 +100,7 @@ "description": "Job ID", "format": "uuid", "in": "path", - "name": "jobid", + "name": "jobId", "required": true, "type": "string" }, @@ -158,7 +158,16 @@ "/entities/healthcare/jobs/{jobId}": { "delete": { "description": "Cancel healthcare prediction job.", - "parameters": [], + "parameters": [ + { + "description": "Job ID", + "format": "uuid", + "in": "path", + "name": "jobId", + "required": true, + "type": "string" + } + ], "responses": { "202": { "description": "Accepted - Cancel Job request has been received.", @@ -174,6 +183,14 @@ "get": { "description": "Get details of the healthcare prediction job specified by the jobId.", "parameters": [ + { + "description": "Job ID", + "format": "uuid", + "in": "path", + "name": "jobId", + "required": true, + "type": "string" + }, { "in": "query", "name": "$skip", 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 6aa19c223700..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 @@ -5,67 +5,86 @@ "input": { "documents": [ { - "id": "1", "language": "en", - "text": "Microsoft was founded by Bill Gates and Paul Allen." + "id": "1", + "text": "I had a wonderful trip to Seattle last week." }, { + "language": "en", "id": "2", + "text": "I work at Microsoft." + }, + { "language": "en", - "text": "Pike place market is my favorite Seattle attraction." + "id": "3", + "text": "I visited Space Needle 2 times." } ] } }, "responses": { "200": { - "headers" : {}, + "headers": {}, "body": { "documents": [ { + "id": "1", "entities": [ { - "category": "Organization", - "confidenceScore": 0.84, - "length": 9, - "offset": 0, - "text": "Microsoft" + "text": "Seattle", + "category": "Location", + "offset": 26, + "length": 7, + "confidenceScore": 0.80 }, { - "category": "Person", - "confidenceScore": 0.85, - "length": 10, - "offset": 25, - "text": "Bill Gates" - }, + "text": "last week", + "category": "DateTime", + "subcategory": "DateRange", + "offset": 34, + "length": 9, + "confidenceScore": 0.8 + } + ], + "warnings": [] + }, + { + "id": "2", + "entities": [ { - "category": "Person", - "confidenceScore": 0.9, - "length": 10, - "offset": 40, - "text": "Paul Allen" + "text": "Microsoft", + "category": "Organization", + "offset": 10, + "length": 9, + "confidenceScore": 0.99 } ], - "id": "1", "warnings": [] }, { + "id": "3", "entities": [ { - "category": "Location", - "confidenceScore": 0.55, - "length": 7, - "offset": 33, - "subcategory": "GPE", - "text": "Seattle" + "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 } ], - "id": "2", "warnings": [] } ], "errors": [], - "modelVersion": "2020-04-01" + "modelVersion": "2019-10-01" } } } 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 294eb8e0f951..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 @@ -5,14 +5,19 @@ "input": { "documents": [ { - "id": "1", "language": "en", - "text": "Microsoft was founded by Bill Gates and Paul Allen." + "id": "1", + "text": "I had a wonderful trip to Seattle last week." }, { + "language": "en", "id": "2", + "text": "I work at Microsoft." + }, + { "language": "en", - "text": "Pike place market is my favorite Seattle attraction." + "id": "3", + "text": "I visited Space Needle 2 times." } ] } @@ -23,93 +28,71 @@ "body": { "documents": [ { + "id": "1", "entities": [ { - "dataSource": "Wikipedia", - "id": "Bill Gates", - "language": "en", + "name": "Seattle", "matches": [ { - "confidenceScore": 0.52, - "length": 10, - "offset": 25, - "text": "Bill Gates" + "text": "Seattle", + "offset": 26, + "length": 7, + "confidenceScore": 0.15 } ], - "name": "Bill Gates", - "url": "https://en.wikipedia.org/wiki/Bill_Gates" - }, - { - "dataSource": "Wikipedia", - "id": "Paul Allen", "language": "en", - "matches": [ - { - "confidenceScore": 0.54, - "length": 10, - "offset": 40, - "text": "Paul Allen" - } - ], - "name": "Paul Allen", - "url": "https://en.wikipedia.org/wiki/Paul_Allen" - }, + "id": "Seattle", + "url": "https://en.wikipedia.org/wiki/Seattle", + "dataSource": "Wikipedia" + } + ], + "warnings": [] + }, + { + "id": "2", + "entities": [ { - "dataSource": "Wikipedia", - "id": "Microsoft", - "language": "en", + "name": "Microsoft", "matches": [ { - "confidenceScore": 0.49, + "text": "Microsoft", + "offset": 10, "length": 9, - "offset": 0, - "text": "Microsoft" + "confidenceScore": 0.18 } ], - "name": "Microsoft", - "url": "https://en.wikipedia.org/wiki/Microsoft" + "language": "en", + "id": "Microsoft", + "url": "https://en.wikipedia.org/wiki/Microsoft", + "dataSource": "Wikipedia" } ], - "id": "1", "warnings": [] }, { + "id": "3", "entities": [ { - "dataSource": "Wikipedia", - "id": "Pike Place Market", - "language": "en", + "name": "Space Needle", "matches": [ { - "confidenceScore": 0.86, - "length": 17, - "offset": 0, - "text": "Pike place market" + "text": "Space Needle", + "offset": 10, + "length": 12, + "confidenceScore": 0.15 } ], - "name": "Pike Place Market", - "url": "https://en.wikipedia.org/wiki/Pike_Place_Market" - }, - { - "dataSource": "Wikipedia", - "id": "Seattle", "language": "en", - "matches": [ - { - "confidenceScore": 0.27, - "length": 7, - "offset": 33, - "text": "Seattle" - } - ], - "name": "Seattle", - "url": "https://en.wikipedia.org/wiki/Seattle" + "id": "Space Needle", + "url": "https://en.wikipedia.org/wiki/Space_Needle", + "dataSource": "Wikipedia" } ], - "id": "2", "warnings": [] } - ] + ], + "errors": [], + "modelVersion": "2019-10-01" } } } 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 cff4b63dd916..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 @@ -5,18 +5,18 @@ "input": { "documents": [ { - "id": "1", "language": "en", - "text": "My SSN is 859-98-0987" + "id": "0", + "text": "Microsoft employee with ssn 859-98-0987 is using our awesome API's." }, { - "id": "2", "language": "en", + "id": "1", "text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check." }, { - "id": "3", "language": "en", + "id": "2", "text": "Is 998.214.865-68 your Brazilian CPF number?" } ] @@ -28,48 +28,45 @@ "body": { "documents": [ { + "id": "0", "entities": [ { + "text": "859-98-0987", "category": "U.S. Social Security Number (SSN)", - "confidenceScore": 0.65, - "length": 11, - "offset": 28, - "redactedText": "My SSN is ***********", "subcategory": "", - "text": "859-98-0987" + "offset": 28, + "length": 11, + "confidenceScore": 0.65 } ], - "id": "1", "warnings": [] }, { + "id": "1", "entities": [ { + "text": "111000025", "category": "ABA Routing Number", - "confidenceScore": 0.75, - "length": 9, - "offset": 18, - "redactedText": "Your ABA number - ********* - is the first 9 digits in the lower left hand corner of your personal check.", "subcategory": "", - "text": "111000025" + "offset": 18, + "length": 9, + "confidenceScore": 0.75 } ], - "id": "2", "warnings": [] }, { + "id": "2", "entities": [ { + "text": "998.214.865-68", "category": "Brazil CPF Number", - "confidenceScore": 0.85, - "length": 14, - "offset": 3, - "redactedText": "Is ************** your Brazilian CPF number?", "subcategory": "", - "text": "998.214.865-68" + "offset": 3, + "length": 14, + "confidenceScore": 0.85 } ], - "id": "3", "warnings": [] } ], 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 4f86d597673a..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 @@ -5,19 +5,19 @@ "input": { "documents": [ { - "id": "1", "language": "en", - "text": "Microsoft was founded by Bill Gates and Paul Allen." + "id": "1", + "text": "Hello world. This is some input text that I love." }, { + "language": "fr", "id": "2", - "language": "en", - "text": "Text Analytics is one of the Azure Cognitive Services." + "text": "Bonjour tout le monde" }, { + "language": "es", "id": "3", - "language": "en", - "text": "My cat might need to see a veterinarian." + "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer." } ] } @@ -30,29 +30,30 @@ { "id": "1", "keyPhrases": [ - "Bill Gates", - "Paul Allen", - "Microsoft" + "world", + "input text" ], "warnings": [] }, { "id": "2", "keyPhrases": [ - "Azure Cognitive Services", - "Text Analytics" + "monde" ], "warnings": [] }, { "id": "3", "keyPhrases": [ - "cat", - "veterinarian" + "carretera", + "tráfico", + "día" ], "warnings": [] } - ] + ], + "errors": [], + "modelVersion": "2019-10-01" } } } 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 16714e4ca2ac..fad894b10669 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 @@ -5,6 +5,7 @@ "input": { "documents": [ { + "countryHint": "US", "id": "1", "text": "Hello world" }, @@ -14,7 +15,7 @@ }, { "id": "3", - "text": "Hola mundo" + "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer." } ] } @@ -25,35 +26,41 @@ "body": { "documents": [ { - "detectedLanguage": { - "confidenceScore": 1, - "iso6391Name": "en", - "name": "English" - }, "id": "1", + "detectedLanguages": [ + { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 1 + } + ], "warnings": [] }, { - "detectedLanguage": { - "confidenceScore": 1, - "iso6391Name": "fr", - "name": "French" - }, "id": "2", + "detectedLanguages": [ + { + "name": "French", + "iso6391Name": "fr", + "confidenceScore": 1 + } + ], "warnings": [] }, { - "detectedLanguage": { - "confidenceScore": 1, - "iso6391Name": "es", - "name": "Spanish" - }, "id": "3", + "detectedLanguages": [ + { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 1 + } + ], "warnings": [] } ], "errors": [], - "modelVersion": "2020-04-01" + "modelVersion": "2019-10-01" } } } 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 1592cc9d8af8..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 @@ -5,9 +5,14 @@ "input": { "documents": [ { - "id": "1", "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." } ] } @@ -18,115 +23,295 @@ "body": { "documents": [ { + "id": "1", + "sentiment": "positive", "confidenceScores": { - "negative": 0, - "neutral": 0, - "positive": 1 + "positive": 1.0, + "neutral": 0.0, + "negative": 0.0 }, - "id": "1", "sentences": [ { + "text": "Great atmosphere.", + "sentiment": "positive", + "confidenceScores": { + "positive": 1.0, + "neutral": 0.0, + "negative": 0.0 + }, + "offset": 0, + "length": 17, "aspects": [ { + "sentiment": "positive", "confidenceScores": { - "negative": 0, - "positive": 1 + "positive": 1.0, + "negative": 0.0 }, - "length": 10, "offset": 6, + "length": 10, + "text": "atmosphere", "relations": [ { - "ref": "#/documents/0/sentences/0/opinions/0", - "relationType": "opinion" + "relationType": "opinion", + "ref": "#/documents/0/sentences/0/opinions/0" } - ], - "sentiment": "positive", - "text": "atmosphere" + ] } ], - "confidenceScores": { - "negative": 0, - "neutral": 0, - "positive": 1 - }, - "length": 17, - "offset": 0, "opinions": [ { + "sentiment": "positive", "confidenceScores": { - "negative": 0, - "positive": 1 + "positive": 1.0, + "negative": 0.0 }, - "isNegated": false, - "length": 5, "offset": 0, - "sentiment": "positive", - "text": "great" + "length": 5, + "text": "great", + "isNegated": false } - ], - "sentiment": "positive", - "text": "Great atmosphere." + ] }, { + "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": { - "negative": 0.01, - "positive": 0.99 + "positive": 0.99, + "negative": 0.01 }, - "length": 11, "offset": 37, + "length": 11, + "text": "restaurants", "relations": [ { - "ref": "#/documents/0/sentences/1/opinions/0", - "relationType": "opinion" + "relationType": "opinion", + "ref": "#/documents/0/sentences/1/opinions/0" } - ], - "sentiment": "positive", - "text": "restaurants" + ] }, { + "sentiment": "positive", "confidenceScores": { - "negative": 0.01, - "positive": 0.99 + "positive": 0.99, + "negative": 0.01 }, - "length": 6, "offset": 50, + "length": 6, + "text": "hotels", "relations": [ { - "ref": "#/documents/0/sentences/1/opinions/0", - "relationType": "opinion" + "relationType": "opinion", + "ref": "#/documents/0/sentences/1/opinions/0" } - ], + ] + } + ], + "opinions": [ + { "sentiment": "positive", - "text": "hotels" + "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": { - "negative": 0.01, - "neutral": 0.86, - "positive": 0.13 + "positive": 0.0, + "neutral": 0.0, + "negative": 1.0 }, - "length": 52, - "offset": 18, + "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": { - "negative": 0.01, - "positive": 0.99 + "positive": 0.01, + "negative": 0.99 }, - "isNegated": false, - "length": 15, - "offset": 18, - "sentiment": "positive", - "text": "Close to plenty" + "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" + } + ] } ], - "sentiment": "neutral", - "text": "Close to plenty of restaurants, hotels, and transit!" + "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 + } + ] } ], - "sentiment": "positive", "warnings": [] } ], diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json new file mode 100644 index 000000000000..dc1c984ea4c5 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -0,0 +1,2485 @@ +{ + "swagger": "2.0", + "info": { + "version": "v3.2-preview.1", + "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 natural language processing (NLP) 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. 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.2-preview.1", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + }, + "paths": { + "/analyze": { + "post": { + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "description": "Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed.", + "operationId": "Analyze", + "summary": "Submit analysis job", + "parameters": [ + { + "description": "Collection of documents to analyze and tasks to execute.", + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/AnalyzeBatchInput" + } + } + ], + "responses": { + "202": { + "description": "A successful call results with an operation-location header used to check the status of the analysis job.", + "headers": { + "Operation-Location": { + "format": "uri", + "type": "string" + } + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Submit analysis job request": { + "$ref": ".//examples//SuccessfulAnalyzeRequest.json" + } + }, + "deprecated": false + } + }, + "/analyze/jobs/{jobId}": { + "get": { + "produces": [ + "application/json", + "text/json" + ], + "description": "Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are completed, the job will transition to the completed state and results will be available for each task.", + "operationId": "AnalyzeStatus", + "summary": "Get analysis status and results", + "parameters": [ + { + "description": "Job ID", + "format": "uuid", + "in": "path", + "name": "jobId", + "required": true, + "type": "string" + }, + { + "description": "(Optional) if set to true, response will contain input and document level statistics.", + "in": "query", + "name": "showStats", + "type": "boolean" + }, + { + "default": 20, + "description": "(Optional) Set the maximum number of results per task.", + "in": "query", + "maximum": 50, + "minimum": 1, + "name": "$top", + "type": "integer" + }, + { + "description": "(Optional) Set the number of elements to offset in the response.", + "in": "query", + "minimum": 0, + "name": "$skip", + "type": "integer" + } + ], + "responses": { + "200": { + "description": "Analysis job status and metadata.", + "schema": { + "$ref": "#/definitions/AnalyzeJobState" + } + }, + "404": { + "description": "Job ID not found.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Get Analysis job status request": { + "$ref": ".//examples//SuccessfulAnalyzeStatusRequest.json" + } + }, + "deprecated": false + } + }, + "/entities/healthcare/jobs/{jobId}": { + "delete": { + "description": "Cancel healthcare prediction job.", + "parameters": [ + { + "description": "Job ID", + "format": "uuid", + "in": "path", + "name": "jobId", + "required": true, + "type": "string" + } + ], + "responses": { + "202": { + "description": "Accepted - Cancel Job request has been received.", + "headers": { + "Operation-Location": { + "format": "uri", + "type": "string" + } + } + } + } + }, + "get": { + "description": "Get details of the healthcare prediction job specified by the jobId.", + "parameters": [ + { + "description": "Job ID", + "format": "uuid", + "in": "path", + "name": "jobId", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "$skip", + "type": "number", + "description": "Skip the $skip entries in the collection. When both $top and $skip are supplied, $skip is applied first.", + "required": false + }, + { + "in": "query", + "name": "$top", + "type": "number", + "description": "Take the $top entries in the collection. When both $top and $skip are supplied, $skip is applied first.", + "required": false + }, + { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain request and document level statistics.", + "type": "boolean", + "required": false + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/HealthcareJobState" + } + } + } + } + }, + "/entities/healthcare/jobs": { + "post": { + "summary": "Health", + "description": "The API returns a list of recognized healthcare entities and relations for each valid document.", + "operationId": "Health", + "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", + "required": false + }, + { + "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": true + } + }, + { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + } + } + ], + "responses": { + "202": { + "description": "Accepted - call results in a link where the status of the submitted job can be checked via the GET operation.", + "headers": { + "Operation-Location": { + "format": "uri", + "type": "string" + } + } + }, + "default": { + "description": "Error Response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, + "x-ms-examples": { + "Successful Health request": { + "$ref": ".//examples//SuccessfulHealthRequest.json" + } + }, + "deprecated": false + } + }, + "/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. ", + "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", + "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": true + } + }, + { + "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": "domain", + "in": "query", + "description": "(Optional) if set to 'PHI', response will contain only PHI entities.", + "type": "string" + }, + { + "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": true + } + }, + { + "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/PiiResult" + } + }, + "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", + "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": true + } + }, + { + "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": "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" + }, + { + "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": true + } + }, + { + "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": { + "AnalysisTasks": { + "properties": { + "tasks": { + "description": "The set of tasks to execute on the input documents. Cannot specify the same task more than once.", + "items": { + "$ref": "#/definitions/TextAnalyticsTask" + }, + "type": "array" + } + }, + "required": [ + "tasks" + ], + "type": "object" + }, + "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" + } + } + } + }, + "TextAnalyticsResult": { + "discriminator": "resultType", + "properties": { + "resultType": { + "type": "string" + } + }, + "required": [ + "resultType" + ], + "type": "object" + }, + "TextAnalyticsTask": { + "discriminator": "type", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "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." + } + } + }, + "PiiTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "domain": { + "default": "none", + "enum": [ + "phi", + "none" + ], + "type": "string" + }, + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "default": "textelements_v8", + "enum": [ + "textelements_v8", + "unicodecodepoint", + "utf16codeunit" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, + "EntitiesTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "default": "textelements_v8", + "enum": [ + "textelements_v8", + "unicodecodepoint", + "utf16codeunit" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "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." + } + } + }, + "AnalyzeBatchInput": { + "allOf": [ + { + "$ref": "#/definitions/JobDescriptor" + }, + { + "$ref": "#/definitions/MultiLanguageBatchInput" + }, + { + "$ref": "#/definitions/AnalysisTasks" + } + ] + }, + "AnalyzeJobState": { + "allOf": [ + { + "$ref": "#/definitions/JobMetadata" + }, + { + "$ref": "#/definitions/TasksState" + }, + { + "properties": { + "errors": { + "items": { + "$ref": "#/definitions/TextAnalyticsError" + }, + "type": "array" + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + } + }, + "type": "object" + }, + { + "$ref": "#/definitions/Pagination" + } + ] + }, + "CustomClassification": { + "properties": { + "confidenceScore": { + "example": 0.87, + "format": "double", + "type": "number" + }, + "name": { + "example": "hotel booking", + "type": "string" + } + }, + "required": [ + "name", + "confidenceScore" + ], + "type": "object" + }, + "CustomClassificationResult": { + "properties": { + "documents": { + "description": "Response by document", + "items": { + "$ref": "#/definitions/CustomClassifications" + }, + "type": "array" + }, + "errors": { + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + }, + "type": "array" + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + } + }, + "required": [ + "documents", + "errors" + ], + "type": "object" + }, + "CustomClassificationTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "appId": { + "type": "string" + }, + "slotName": { + "type": "string" + } + }, + "required": [ + "appId", + "slotName" + ], + "type": "object" + } + }, + "required": [ + "parameters" + ], + "type": "object" + } + ] + }, + "CustomClassifications": { + "items": { + "$ref": "#/definitions/CustomClassification" + }, + "type": "array" + }, + "CustomEntities": { + "items": { + "$ref": "#/definitions/CustomEntity" + }, + "type": "array" + }, + "CustomEntitiesResult": { + "properties": { + "documents": { + "description": "Response by document", + "items": { + "$ref": "#/definitions/CustomEntities" + }, + "type": "array" + }, + "errors": { + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + }, + "type": "array" + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + } + }, + "required": [ + "documents", + "errors" + ], + "type": "object" + }, + "CustomEntitiesTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "appId": { + "type": "string" + }, + "slotName": { + "type": "string" + }, + "stringIndexType": { + "default": "textelements_v8", + "enum": [ + "textelements_v8", + "unicodecodepoint", + "utf16codeunit" + ], + "type": "string" + } + }, + "required": [ + "appId", + "slotName" + ], + "type": "object" + } + }, + "required": [ + "parameters" + ], + "type": "object" + } + ] + }, + "CustomEntity": { + "properties": { + "category": { + "example": "address", + "type": "string" + }, + "children": { + "example": [ + { + "category": "city", + "confidenceScore": 0.78, + "length": 3, + "offset": 5 + } + ], + "items": { + "$ref": "#/definitions/CustomEntity" + }, + "type": "array" + }, + "confidenceScore": { + "example": 0.96, + "type": "number" + }, + "length": { + "example": 7, + "type": "number" + }, + "offset": { + "example": 3, + "type": "number" + } + }, + "required": [ + "category", + "offset", + "length", + "confidenceScore" + ], + "type": "object" + }, + "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." + } + } + }, + "SentimentTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + }, + "opinionMining": { + "default": false, + "type": "boolean" + }, + "stringIndexType": { + "default": "textelements_v8", + "enum": [ + "textelements_v8", + "unicodecodepoint", + "utf16codeunit" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": false, + "name": "State" + } + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, + "TaskState": { + "properties": { + "lastUpdateDateTime": { + "format": "date-time", + "type": "string" + }, + "name": { + "type": "string" + }, + "results": { + "$ref": "#/definitions/TextAnalyticsResult" + }, + "status": { + "enum": [ + "notstarted", + "running", + "succeeded", + "failed" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": false, + "name": "State" + } + }, + "type": { + "enum": [ + "Detect Language", + "Extract Key Phrases", + "Analyze Sentiment", + "Recognize Linked Entities", + "Recognize Entities", + "Recognize PII Entities", + "Custom Classification", + "Custom Entities" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": false, + "name": "State" + } + } + }, + "required": [ + "name", + "type", + "status", + "lastUpdateDateTime" + ], + "type": "object" + }, + "TasksState": { + "properties": { + "tasks": { + "properties": { + "completed": { + "type": "integer" + }, + "details": { + "items": { + "$ref": "#/definitions/TaskState" + }, + "type": "array" + }, + "failed": { + "type": "integer" + }, + "inProgress": { + "type": "integer" + }, + "total": { + "type": "integer" + } + }, + "required": [ + "total", + "completed", + "failed", + "inProgress", + "details" + ], + "type": "object" + } + }, + "required": [ + "tasks" + ], + "type": "object" + }, + "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." + }, + "subcategory": { + "type": "string", + "description": "(Optional) Entity sub type." + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length for the entity text. Use of different 'stringIndexType' values can affect the length returned." + }, + "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" + } + } + }, + "EntityLinkingTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "default": "textelements_v8", + "enum": [ + "textelements_v8", + "unicodecodepoint", + "utf16codeunit" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, + "HealthcareJobState": { + "allOf": [ + { + "$ref": "#/definitions/JobMetadata" + }, + { + "properties": { + "results": { + "$ref": "#/definitions/HealthcareResult" + } + }, + "type": "object" + }, + { + "$ref": "#/definitions/Pagination" + } + ] + }, + "HealthcareResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentHealthcareEntities" + } + }, + "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." + } + } + }, + "DocumentHealthcareEntities": { + "type": "object", + "required": [ + "id", + "entities", + "relations", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "description": "Gets or sets the list of recognized health entities in document.", + "type": "array", + "items": { + "$ref": "#/definitions/HealthcareEntity" + } + }, + "relations": { + "type": "array", + "items": { + "$ref": "#/definitions/HealthcareRelation" + } + }, + "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" + } + } + }, + "HealthcareEntity": { + "allOf": [ + { + "$ref": "#/definitions/Entity" + }, + { + "properties": { + "links": { + "description": "Entity references in known data sources.", + "type": "array", + "items": { + "$ref": "#/definitions/HealthcareEntityLink" + } + } + } + } + ] + }, + "HealthcareRelation": { + "type": "object", + "required": [ + "relationType", + "bidirectional", + "source", + "target" + ], + "properties": { + "relationType": { + "type": "string" + }, + "bidirectional": { + "description": "If true the relation between the entities is bidirectional, otherwise directionality is source to target.", + "type": "boolean" + }, + "source": { + "format": "uri", + "type": "string" + }, + "target": { + "format": "uri", + "type": "string" + } + } + }, + "HealthcareEntityLink": { + "type": "object", + "required": [ + "dataSource", + "id" + ], + "properties": { + "dataSource": { + "description": "Entity Catalog. Examples include: UMLS, CHV, MSH, etc.", + "type": "string" + }, + "id": { + "description": "Entity id in the given source catalog. Example: blood pressure - source: umls, concept_id: C1272641.", + "type": "string" + } + } + }, + "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." + } + } + }, + "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." + } + } + }, + "JobDescriptor": { + "properties": { + "displayName": { + "description": "Optional display name for the analysis job.", + "type": "string" + } + }, + "type": "object" + }, + "JobMetadata": { + "properties": { + "createdDateTime": { + "format": "date-time", + "type": "string" + }, + "displayName": { + "type": "string" + }, + "expirationDateTime": { + "format": "date-time", + "type": "string" + }, + "jobId": { + "format": "uuid", + "type": "string" + }, + "lastUpdateDateTime": { + "format": "date-time", + "type": "string" + }, + "status": { + "enum": [ + "notstarted", + "running", + "succeeded", + "failed" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": false, + "name": "State" + } + } + }, + "required": [ + "jobId", + "lastUpdateDateTime", + "createdDateTime", + "status" + ], + "type": "object" + }, + "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" + } + } + }, + "KeyPhrasesTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, + "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" + } + } + }, + "Pagination": { + "properties": { + "@nextLink": { + "format": "uri", + "type": "string" + } + }, + "type": "object" + }, + "PiiResult": { + "allOf": [ + { + "$ref": "#/definitions/EntitiesResult" + }, + { + "properties": { + "redactedText": { + "type": "string" + } + }, + "required": [ + "redactedText" + ], + "type": "object" + } + ] + }, + "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", + "detectedLanguages", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "detectedLanguages": { + "type": "array", + "description": "A list of extracted languages.", + "items": { + "$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." + } + } + }, + "TypedCustomClassificationResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/CustomClassificationResult" + } + ] + }, + "TypedCustomEntitiesResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/CustomEntitiesResult" + } + ] + }, + "TypedEntitiesResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/EntitiesResult" + } + ] + }, + "TypedEntityLinkingResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/EntityLinkingResult" + } + ] + }, + "TypedKeyPhraseResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/KeyPhraseResult" + } + ] + }, + "TypedPiiResult": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/PiiResult" + } + ] + }, + "TypedSentimentResponse": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsResult" + }, + { + "$ref": "#/definitions/SentimentResponse" + } + ] + } + }, + "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.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulAnalyzeStatusRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json new file mode 100644 index 000000000000..6aa19c223700 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json @@ -0,0 +1,72 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Microsoft was founded by Bill Gates and Paul Allen." + }, + { + "id": "2", + "language": "en", + "text": "Pike place market is my favorite Seattle attraction." + } + ] + } + }, + "responses": { + "200": { + "headers" : {}, + "body": { + "documents": [ + { + "entities": [ + { + "category": "Organization", + "confidenceScore": 0.84, + "length": 9, + "offset": 0, + "text": "Microsoft" + }, + { + "category": "Person", + "confidenceScore": 0.85, + "length": 10, + "offset": 25, + "text": "Bill Gates" + }, + { + "category": "Person", + "confidenceScore": 0.9, + "length": 10, + "offset": 40, + "text": "Paul Allen" + } + ], + "id": "1", + "warnings": [] + }, + { + "entities": [ + { + "category": "Location", + "confidenceScore": 0.55, + "length": 7, + "offset": 33, + "subcategory": "GPE", + "text": "Seattle" + } + ], + "id": "2", + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-04-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json new file mode 100644 index 000000000000..294eb8e0f951 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -0,0 +1,116 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Microsoft was founded by Bill Gates and Paul Allen." + }, + { + "id": "2", + "language": "en", + "text": "Pike place market is my favorite Seattle attraction." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "entities": [ + { + "dataSource": "Wikipedia", + "id": "Bill Gates", + "language": "en", + "matches": [ + { + "confidenceScore": 0.52, + "length": 10, + "offset": 25, + "text": "Bill Gates" + } + ], + "name": "Bill Gates", + "url": "https://en.wikipedia.org/wiki/Bill_Gates" + }, + { + "dataSource": "Wikipedia", + "id": "Paul Allen", + "language": "en", + "matches": [ + { + "confidenceScore": 0.54, + "length": 10, + "offset": 40, + "text": "Paul Allen" + } + ], + "name": "Paul Allen", + "url": "https://en.wikipedia.org/wiki/Paul_Allen" + }, + { + "dataSource": "Wikipedia", + "id": "Microsoft", + "language": "en", + "matches": [ + { + "confidenceScore": 0.49, + "length": 9, + "offset": 0, + "text": "Microsoft" + } + ], + "name": "Microsoft", + "url": "https://en.wikipedia.org/wiki/Microsoft" + } + ], + "id": "1", + "warnings": [] + }, + { + "entities": [ + { + "dataSource": "Wikipedia", + "id": "Pike Place Market", + "language": "en", + "matches": [ + { + "confidenceScore": 0.86, + "length": 17, + "offset": 0, + "text": "Pike place market" + } + ], + "name": "Pike Place Market", + "url": "https://en.wikipedia.org/wiki/Pike_Place_Market" + }, + { + "dataSource": "Wikipedia", + "id": "Seattle", + "language": "en", + "matches": [ + { + "confidenceScore": 0.27, + "length": 7, + "offset": 33, + "text": "Seattle" + } + ], + "name": "Seattle", + "url": "https://en.wikipedia.org/wiki/Seattle" + } + ], + "id": "2", + "warnings": [] + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json new file mode 100644 index 000000000000..cff4b63dd916 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -0,0 +1,81 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "My SSN is 859-98-0987" + }, + { + "id": "2", + "language": "en", + "text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check." + }, + { + "id": "3", + "language": "en", + "text": "Is 998.214.865-68 your Brazilian CPF number?" + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "entities": [ + { + "category": "U.S. Social Security Number (SSN)", + "confidenceScore": 0.65, + "length": 11, + "offset": 28, + "redactedText": "My SSN is ***********", + "subcategory": "", + "text": "859-98-0987" + } + ], + "id": "1", + "warnings": [] + }, + { + "entities": [ + { + "category": "ABA Routing Number", + "confidenceScore": 0.75, + "length": 9, + "offset": 18, + "redactedText": "Your ABA number - ********* - is the first 9 digits in the lower left hand corner of your personal check.", + "subcategory": "", + "text": "111000025" + } + ], + "id": "2", + "warnings": [] + }, + { + "entities": [ + { + "category": "Brazil CPF Number", + "confidenceScore": 0.85, + "length": 14, + "offset": 3, + "redactedText": "Is ************** your Brazilian CPF number?", + "subcategory": "", + "text": "998.214.865-68" + } + ], + "id": "3", + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2019-10-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulHealthRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json new file mode 100644 index 000000000000..4f86d597673a --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Microsoft was founded by Bill Gates and Paul Allen." + }, + { + "id": "2", + "language": "en", + "text": "Text Analytics is one of the Azure Cognitive Services." + }, + { + "id": "3", + "language": "en", + "text": "My cat might need to see a veterinarian." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "1", + "keyPhrases": [ + "Bill Gates", + "Paul Allen", + "Microsoft" + ], + "warnings": [] + }, + { + "id": "2", + "keyPhrases": [ + "Azure Cognitive Services", + "Text Analytics" + ], + "warnings": [] + }, + { + "id": "3", + "keyPhrases": [ + "cat", + "veterinarian" + ], + "warnings": [] + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json new file mode 100644 index 000000000000..16714e4ca2ac --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "text": "Hello world" + }, + { + "id": "2", + "text": "Bonjour tout le monde" + }, + { + "id": "3", + "text": "Hola mundo" + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "en", + "name": "English" + }, + "id": "1", + "warnings": [] + }, + { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "fr", + "name": "French" + }, + "id": "2", + "warnings": [] + }, + { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "es", + "name": "Spanish" + }, + "id": "3", + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-04-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json new file mode 100644 index 000000000000..1592cc9d8af8 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json @@ -0,0 +1,138 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Great atmosphere. Close to plenty of restaurants, hotels, and transit! Staff are friendly and helpful." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "confidenceScores": { + "negative": 0, + "neutral": 0, + "positive": 1 + }, + "id": "1", + "sentences": [ + { + "aspects": [ + { + "confidenceScores": { + "negative": 0, + "positive": 1 + }, + "length": 10, + "offset": 6, + "relations": [ + { + "ref": "#/documents/0/sentences/0/opinions/0", + "relationType": "opinion" + } + ], + "sentiment": "positive", + "text": "atmosphere" + } + ], + "confidenceScores": { + "negative": 0, + "neutral": 0, + "positive": 1 + }, + "length": 17, + "offset": 0, + "opinions": [ + { + "confidenceScores": { + "negative": 0, + "positive": 1 + }, + "isNegated": false, + "length": 5, + "offset": 0, + "sentiment": "positive", + "text": "great" + } + ], + "sentiment": "positive", + "text": "Great atmosphere." + }, + { + "aspects": [ + { + "confidenceScores": { + "negative": 0.01, + "positive": 0.99 + }, + "length": 11, + "offset": 37, + "relations": [ + { + "ref": "#/documents/0/sentences/1/opinions/0", + "relationType": "opinion" + } + ], + "sentiment": "positive", + "text": "restaurants" + }, + { + "confidenceScores": { + "negative": 0.01, + "positive": 0.99 + }, + "length": 6, + "offset": 50, + "relations": [ + { + "ref": "#/documents/0/sentences/1/opinions/0", + "relationType": "opinion" + } + ], + "sentiment": "positive", + "text": "hotels" + } + ], + "confidenceScores": { + "negative": 0.01, + "neutral": 0.86, + "positive": 0.13 + }, + "length": 52, + "offset": 18, + "opinions": [ + { + "confidenceScores": { + "negative": 0.01, + "positive": 0.99 + }, + "isNegated": false, + "length": 15, + "offset": 18, + "sentiment": "positive", + "text": "Close to plenty" + } + ], + "sentiment": "neutral", + "text": "Close to plenty of restaurants, hotels, and transit!" + } + ], + "sentiment": "positive", + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-04-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index 894fff1f8c0b..073499c12d3d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -14,108 +14,18 @@ You must also have the [endpoint and access key](../How-tos/text-analytics-how-t ## Installing the NuGet SDK Package 1. Create a new Console solution in Visual Studio. 1. Right click on the solution and click **Manage NuGet Packages for Solution** -1. Mark the **Include Prerelease** checkbox. -1. Select the **Browse** tab, and Search for **Microsoft.Azure.CognitiveServices.Language** +1. Select the **Browse** tab, and Search for **Microsoft.AI.TextAnalytics** 1. Select the NuGet package and install it. ## Calling the Text Analytics API using the SDK -The following code snippets show to consume the SDK. Note that you will need to replace `client.SubscriptionKey` with the key you received when you signed up and `client.AzureRegion` with the region you signed up for. - -```c# -using System; -using Microsoft.Azure.CognitiveServices.Language.TextAnalytics; -using Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models; -using System.Collections.Generic; - -namespace ConsoleApp1 -{ - class Program - { - static void Main(string[] args) - { - // Create a client. - ITextAnalyticsAPI client = new TextAnalyticsAPI(); - client.AzureRegion = AzureRegions.Westus; - client.SubscriptionKey = "ENTER KEY HERE"; - - Console.OutputEncoding = System.Text.Encoding.UTF8; - - // Extracting language - Console.WriteLine("===== LANGUAGE EXTRACTION ======"); - - LanguageBatchResult result = client.DetectLanguage( - new BatchInput( - new List() - { - new Input("1", "This is a document written in English."), - new Input("2", "Este es un document escrito en Español."), - new Input("3", "这是一个用中文写的文件") - })); - - // Printing language results. - foreach (var document in result.Documents) - { - Console.WriteLine("Document ID: {0} , Language: {1}", document.Id, document.DetectedLanguages[0].Name); - } - - // Getting key-phrases - Console.WriteLine("\n\n===== KEY-PHRASE EXTRACTION ======"); - - KeyPhraseBatchResult result2 = client.KeyPhrases( - new MultiLanguageBatchInput( - new List() - { - new MultiLanguageInput("ja", "1", "猫は幸せ"), - new MultiLanguageInput("de", "2", "Fahrt nach Stuttgart und dann zum Hotel zu Fu."), - new MultiLanguageInput("en", "3", "My cat is stiff as a rock."), - new MultiLanguageInput("es", "4", "A mi me encanta el fútbol!") - })); - - - // Printing keyphrases - foreach (var document in result2.Documents) - { - Console.WriteLine("Document ID: {0} ", document.Id); - - Console.WriteLine("\t Key phrases:"); - - foreach (string keyphrase in document.KeyPhrases) - { - Console.WriteLine("\t\t" + keyphrase); - } - } - - // Extracting sentiment - Console.WriteLine("\n\n===== SENTIMENT ANALYSIS ======"); - - SentimentBatchResult result3 = client.Sentiment( - new MultiLanguageBatchInput( - new List() - { - new MultiLanguageInput("en", "0", "I had the best day of my life."), - new MultiLanguageInput("en", "1", "This was a waste of my time. The speaker put me to sleep."), - new MultiLanguageInput("es", "2", "No tengo dinero ni nada que dar..."), - new MultiLanguageInput("it", "3", "L'hotel veneziano era meraviglioso. È un bellissimo pezzo di architettura."), - })); - - - // Printing sentiment results - foreach (var document in result3.Documents) - { - Console.WriteLine("Document ID: {0} , Sentiment Score: {1:0.00}", document.Id, document.Score); - } - - } - } -} -``` +See Text Analytics [Quickstart guide](https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/quickstarts/text-analytics-sdk?tabs=version-3&pivots=programming-language-csharp) for detailed instructions on how to use the SDK in your application. ## Releases > see https://aka.ms/autorest -The current release is `release_2_0`. -A preview release `release_2_1` is also available. +The current release is `release_3_0`. +A preview release `release_3_2_preview.1` is also available. ``` yaml tag: release_2_1 @@ -170,6 +80,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.2-Preview.1 + +These settings apply only when `--tag=release_3_2_preview.1` is specified on the command line. + +``` yaml $(tag) == 'release_3_2_preview.1' +input-file: preview/v3.2-preview.1/TextAnalytics.json +``` + ## Swagger to SDK This section describes what SDK should be generated by the automatic system. From bbb0cf3b8d701dfef4dae5963a9951db6f162a14 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Thu, 23 Jul 2020 23:17:25 -0700 Subject: [PATCH 10/54] Restoring v3.1-preview.1 swagger --- .../preview/v3.1-preview.1/TextAnalytics.json | 1162 +---------------- 1 file changed, 11 insertions(+), 1151 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 dc1c984ea4c5..0ff15eff3ba9 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 @@ -1,14 +1,14 @@ { "swagger": "2.0", "info": { - "version": "v3.2-preview.1", + "version": "v3.1-preview.1", "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 natural language processing (NLP) 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. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview" + "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": { @@ -23,7 +23,7 @@ } ], "x-ms-parameterized-host": { - "hostTemplate": "{Endpoint}/text/analytics/v3.2-preview.1", + "hostTemplate": "{Endpoint}/text/analytics/v3.1-preview.1", "useSchemePrefix": false, "parameters": [ { @@ -32,269 +32,6 @@ ] }, "paths": { - "/analyze": { - "post": { - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "description": "Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed.", - "operationId": "Analyze", - "summary": "Submit analysis job", - "parameters": [ - { - "description": "Collection of documents to analyze and tasks to execute.", - "in": "body", - "name": "body", - "schema": { - "$ref": "#/definitions/AnalyzeBatchInput" - } - } - ], - "responses": { - "202": { - "description": "A successful call results with an operation-location header used to check the status of the analysis job.", - "headers": { - "Operation-Location": { - "format": "uri", - "type": "string" - } - } - }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/TextAnalyticsError" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/TextAnalyticsError" - } - } - }, - "x-ms-examples": { - "Successful Submit analysis job request": { - "$ref": ".//examples//SuccessfulAnalyzeRequest.json" - } - }, - "deprecated": false - } - }, - "/analyze/jobs/{jobId}": { - "get": { - "produces": [ - "application/json", - "text/json" - ], - "description": "Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are completed, the job will transition to the completed state and results will be available for each task.", - "operationId": "AnalyzeStatus", - "summary": "Get analysis status and results", - "parameters": [ - { - "description": "Job ID", - "format": "uuid", - "in": "path", - "name": "jobId", - "required": true, - "type": "string" - }, - { - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "in": "query", - "name": "showStats", - "type": "boolean" - }, - { - "default": 20, - "description": "(Optional) Set the maximum number of results per task.", - "in": "query", - "maximum": 50, - "minimum": 1, - "name": "$top", - "type": "integer" - }, - { - "description": "(Optional) Set the number of elements to offset in the response.", - "in": "query", - "minimum": 0, - "name": "$skip", - "type": "integer" - } - ], - "responses": { - "200": { - "description": "Analysis job status and metadata.", - "schema": { - "$ref": "#/definitions/AnalyzeJobState" - } - }, - "404": { - "description": "Job ID not found.", - "schema": { - "$ref": "#/definitions/TextAnalyticsError" - } - }, - "500": { - "description": "Internal error response", - "schema": { - "$ref": "#/definitions/TextAnalyticsError" - } - } - }, - "x-ms-examples": { - "Successful Get Analysis job status request": { - "$ref": ".//examples//SuccessfulAnalyzeStatusRequest.json" - } - }, - "deprecated": false - } - }, - "/entities/healthcare/jobs/{jobId}": { - "delete": { - "description": "Cancel healthcare prediction job.", - "parameters": [ - { - "description": "Job ID", - "format": "uuid", - "in": "path", - "name": "jobId", - "required": true, - "type": "string" - } - ], - "responses": { - "202": { - "description": "Accepted - Cancel Job request has been received.", - "headers": { - "Operation-Location": { - "format": "uri", - "type": "string" - } - } - } - } - }, - "get": { - "description": "Get details of the healthcare prediction job specified by the jobId.", - "parameters": [ - { - "description": "Job ID", - "format": "uuid", - "in": "path", - "name": "jobId", - "required": true, - "type": "string" - }, - { - "in": "query", - "name": "$skip", - "type": "number", - "description": "Skip the $skip entries in the collection. When both $top and $skip are supplied, $skip is applied first.", - "required": false - }, - { - "in": "query", - "name": "$top", - "type": "number", - "description": "Take the $top entries in the collection. When both $top and $skip are supplied, $skip is applied first.", - "required": false - }, - { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain request and document level statistics.", - "type": "boolean", - "required": false - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/HealthcareJobState" - } - } - } - } - }, - "/entities/healthcare/jobs": { - "post": { - "summary": "Health", - "description": "The API returns a list of recognized healthcare entities and relations for each valid document.", - "operationId": "Health", - "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", - "required": false - }, - { - "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": true - } - }, - { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } - } - ], - "responses": { - "202": { - "description": "Accepted - call results in a link where the status of the submitted job can be checked via the GET operation.", - "headers": { - "Operation-Location": { - "format": "uri", - "type": "string" - } - } - }, - "default": { - "description": "Error Response", - "schema": { - "$ref": "#/definitions/TextAnalyticsError" - } - } - }, - "x-ms-examples": { - "Successful Health request": { - "$ref": ".//examples//SuccessfulHealthRequest.json" - } - }, - "deprecated": false - } - }, "/entities/recognition/general": { "post": { "summary": "Named Entity Recognition", @@ -313,29 +50,15 @@ "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" - }, - { - "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": true - } + "type": "boolean", + "required": false }, { "in": "body", @@ -401,22 +124,6 @@ "description": "(Optional) if set to 'PHI', response will contain only PHI entities.", "type": "string" }, - { - "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": true - } - }, { "in": "body", "name": "input", @@ -431,7 +138,7 @@ "200": { "description": "A successful call results in a list of entities containing personal information returned for each valid document", "schema": { - "$ref": "#/definitions/PiiResult" + "$ref": "#/definitions/EntitiesResult" } }, "default": { @@ -475,22 +182,6 @@ "description": "(Optional) if set to true, response will contain input and document level statistics.", "type": "boolean" }, - { - "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": true - } - }, { "in": "body", "name": "input", @@ -671,22 +362,6 @@ "description": "(Optional) if set to true, response will contain input and document level statistics including aspect-based sentiment analysis results.", "type": "boolean" }, - { - "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": true - } - }, { "in": "body", "name": "input", @@ -721,21 +396,6 @@ } }, "definitions": { - "AnalysisTasks": { - "properties": { - "tasks": { - "description": "The set of tasks to execute on the input documents. Cannot specify the same task more than once.", - "items": { - "$ref": "#/definitions/TextAnalyticsTask" - }, - "type": "array" - } - }, - "required": [ - "tasks" - ], - "type": "object" - }, "MultiLanguageBatchInput": { "type": "object", "required": [ @@ -834,30 +494,6 @@ } } }, - "TextAnalyticsResult": { - "discriminator": "resultType", - "properties": { - "resultType": { - "type": "string" - } - }, - "required": [ - "resultType" - ], - "type": "object" - }, - "TextAnalyticsTask": { - "discriminator": "type", - "properties": { - "type": { - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object" - }, "TextAnalyticsWarning": { "type": "object", "required": [ @@ -887,74 +523,6 @@ } } }, - "PiiTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { - "properties": { - "parameters": { - "properties": { - "domain": { - "default": "none", - "enum": [ - "phi", - "none" - ], - "type": "string" - }, - "model-version": { - "default": "latest", - "type": "string" - }, - "stringIndexType": { - "default": "textelements_v8", - "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" - ], - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - } - ] - }, - "EntitiesTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { - "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - }, - "stringIndexType": { - "default": "textelements_v8", - "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" - ], - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - } - ] - }, "InnerError": { "type": "object", "required": [ @@ -1002,238 +570,6 @@ } } }, - "AnalyzeBatchInput": { - "allOf": [ - { - "$ref": "#/definitions/JobDescriptor" - }, - { - "$ref": "#/definitions/MultiLanguageBatchInput" - }, - { - "$ref": "#/definitions/AnalysisTasks" - } - ] - }, - "AnalyzeJobState": { - "allOf": [ - { - "$ref": "#/definitions/JobMetadata" - }, - { - "$ref": "#/definitions/TasksState" - }, - { - "properties": { - "errors": { - "items": { - "$ref": "#/definitions/TextAnalyticsError" - }, - "type": "array" - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - } - }, - "type": "object" - }, - { - "$ref": "#/definitions/Pagination" - } - ] - }, - "CustomClassification": { - "properties": { - "confidenceScore": { - "example": 0.87, - "format": "double", - "type": "number" - }, - "name": { - "example": "hotel booking", - "type": "string" - } - }, - "required": [ - "name", - "confidenceScore" - ], - "type": "object" - }, - "CustomClassificationResult": { - "properties": { - "documents": { - "description": "Response by document", - "items": { - "$ref": "#/definitions/CustomClassifications" - }, - "type": "array" - }, - "errors": { - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - }, - "type": "array" - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - } - }, - "required": [ - "documents", - "errors" - ], - "type": "object" - }, - "CustomClassificationTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { - "properties": { - "parameters": { - "properties": { - "appId": { - "type": "string" - }, - "slotName": { - "type": "string" - } - }, - "required": [ - "appId", - "slotName" - ], - "type": "object" - } - }, - "required": [ - "parameters" - ], - "type": "object" - } - ] - }, - "CustomClassifications": { - "items": { - "$ref": "#/definitions/CustomClassification" - }, - "type": "array" - }, - "CustomEntities": { - "items": { - "$ref": "#/definitions/CustomEntity" - }, - "type": "array" - }, - "CustomEntitiesResult": { - "properties": { - "documents": { - "description": "Response by document", - "items": { - "$ref": "#/definitions/CustomEntities" - }, - "type": "array" - }, - "errors": { - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - }, - "type": "array" - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - } - }, - "required": [ - "documents", - "errors" - ], - "type": "object" - }, - "CustomEntitiesTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { - "properties": { - "parameters": { - "properties": { - "appId": { - "type": "string" - }, - "slotName": { - "type": "string" - }, - "stringIndexType": { - "default": "textelements_v8", - "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" - ], - "type": "string" - } - }, - "required": [ - "appId", - "slotName" - ], - "type": "object" - } - }, - "required": [ - "parameters" - ], - "type": "object" - } - ] - }, - "CustomEntity": { - "properties": { - "category": { - "example": "address", - "type": "string" - }, - "children": { - "example": [ - { - "category": "city", - "confidenceScore": 0.78, - "length": 3, - "offset": 5 - } - ], - "items": { - "$ref": "#/definitions/CustomEntity" - }, - "type": "array" - }, - "confidenceScore": { - "example": 0.96, - "type": "number" - }, - "length": { - "example": 7, - "type": "number" - }, - "offset": { - "example": 3, - "type": "number" - } - }, - "required": [ - "category", - "offset", - "length", - "confidenceScore" - ], - "type": "object" - }, "SentimentResponse": { "type": "object", "required": [ @@ -1265,133 +601,6 @@ } } }, - "SentimentTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { - "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - }, - "opinionMining": { - "default": false, - "type": "boolean" - }, - "stringIndexType": { - "default": "textelements_v8", - "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" - ], - "type": "string", - "x-ms-enum": { - "modelAsString": false, - "name": "State" - } - } - }, - "type": "object" - } - }, - "type": "object" - } - ] - }, - "TaskState": { - "properties": { - "lastUpdateDateTime": { - "format": "date-time", - "type": "string" - }, - "name": { - "type": "string" - }, - "results": { - "$ref": "#/definitions/TextAnalyticsResult" - }, - "status": { - "enum": [ - "notstarted", - "running", - "succeeded", - "failed" - ], - "type": "string", - "x-ms-enum": { - "modelAsString": false, - "name": "State" - } - }, - "type": { - "enum": [ - "Detect Language", - "Extract Key Phrases", - "Analyze Sentiment", - "Recognize Linked Entities", - "Recognize Entities", - "Recognize PII Entities", - "Custom Classification", - "Custom Entities" - ], - "type": "string", - "x-ms-enum": { - "modelAsString": false, - "name": "State" - } - } - }, - "required": [ - "name", - "type", - "status", - "lastUpdateDateTime" - ], - "type": "object" - }, - "TasksState": { - "properties": { - "tasks": { - "properties": { - "completed": { - "type": "integer" - }, - "details": { - "items": { - "$ref": "#/definitions/TaskState" - }, - "type": "array" - }, - "failed": { - "type": "integer" - }, - "inProgress": { - "type": "integer" - }, - "total": { - "type": "integer" - } - }, - "required": [ - "total", - "completed", - "failed", - "inProgress", - "details" - ], - "type": "object" - } - }, - "required": [ - "tasks" - ], - "type": "object" - }, "DocumentSentiment": { "type": "object", "required": [ @@ -1784,21 +993,21 @@ }, "category": { "type": "string", - "description": "Entity type." + "description": "Entity type, such as Person/Location/Org/SSN etc" }, "subcategory": { "type": "string", - "description": "(Optional) Entity sub type." + "description": "Entity sub type, such as Age/Year/TimeRange etc" }, "offset": { "type": "integer", "format": "int32", - "description": "Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned." + "description": "Start position for the entity text." }, "length": { "type": "integer", "format": "int32", - "description": "Length for the entity text. Use of different 'stringIndexType' values can affect the length returned." + "description": "Length for the entity text." }, "confidenceScore": { "type": "number", @@ -1870,185 +1079,6 @@ } } }, - "EntityLinkingTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { - "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - }, - "stringIndexType": { - "default": "textelements_v8", - "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" - ], - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - } - ] - }, - "HealthcareJobState": { - "allOf": [ - { - "$ref": "#/definitions/JobMetadata" - }, - { - "properties": { - "results": { - "$ref": "#/definitions/HealthcareResult" - } - }, - "type": "object" - }, - { - "$ref": "#/definitions/Pagination" - } - ] - }, - "HealthcareResult": { - "type": "object", - "required": [ - "documents", - "errors", - "modelVersion" - ], - "properties": { - "documents": { - "type": "array", - "description": "Response by document", - "items": { - "$ref": "#/definitions/DocumentHealthcareEntities" - } - }, - "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." - } - } - }, - "DocumentHealthcareEntities": { - "type": "object", - "required": [ - "id", - "entities", - "relations", - "warnings" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique, non-empty document identifier." - }, - "entities": { - "description": "Gets or sets the list of recognized health entities in document.", - "type": "array", - "items": { - "$ref": "#/definitions/HealthcareEntity" - } - }, - "relations": { - "type": "array", - "items": { - "$ref": "#/definitions/HealthcareRelation" - } - }, - "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" - } - } - }, - "HealthcareEntity": { - "allOf": [ - { - "$ref": "#/definitions/Entity" - }, - { - "properties": { - "links": { - "description": "Entity references in known data sources.", - "type": "array", - "items": { - "$ref": "#/definitions/HealthcareEntityLink" - } - } - } - } - ] - }, - "HealthcareRelation": { - "type": "object", - "required": [ - "relationType", - "bidirectional", - "source", - "target" - ], - "properties": { - "relationType": { - "type": "string" - }, - "bidirectional": { - "description": "If true the relation between the entities is bidirectional, otherwise directionality is source to target.", - "type": "boolean" - }, - "source": { - "format": "uri", - "type": "string" - }, - "target": { - "format": "uri", - "type": "string" - } - } - }, - "HealthcareEntityLink": { - "type": "object", - "required": [ - "dataSource", - "id" - ], - "properties": { - "dataSource": { - "description": "Entity Catalog. Examples include: UMLS, CHV, MSH, etc.", - "type": "string" - }, - "id": { - "description": "Entity id in the given source catalog. Example: blood pressure - source: umls, concept_id: C1272641.", - "type": "string" - } - } - }, "LinkedEntity": { "type": "object", "required": [ @@ -2118,58 +1148,6 @@ } } }, - "JobDescriptor": { - "properties": { - "displayName": { - "description": "Optional display name for the analysis job.", - "type": "string" - } - }, - "type": "object" - }, - "JobMetadata": { - "properties": { - "createdDateTime": { - "format": "date-time", - "type": "string" - }, - "displayName": { - "type": "string" - }, - "expirationDateTime": { - "format": "date-time", - "type": "string" - }, - "jobId": { - "format": "uuid", - "type": "string" - }, - "lastUpdateDateTime": { - "format": "date-time", - "type": "string" - }, - "status": { - "enum": [ - "notstarted", - "running", - "succeeded", - "failed" - ], - "type": "string", - "x-ms-enum": { - "modelAsString": false, - "name": "State" - } - } - }, - "required": [ - "jobId", - "lastUpdateDateTime", - "createdDateTime", - "status" - ], - "type": "object" - }, "KeyPhraseResult": { "type": "object", "required": [ @@ -2233,27 +1211,6 @@ } } }, - "KeyPhrasesTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { - "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - } - ] - }, "LanguageBatchInput": { "type": "object", "required": [ @@ -2287,33 +1244,6 @@ } } }, - "Pagination": { - "properties": { - "@nextLink": { - "format": "uri", - "type": "string" - } - }, - "type": "object" - }, - "PiiResult": { - "allOf": [ - { - "$ref": "#/definitions/EntitiesResult" - }, - { - "properties": { - "redactedText": { - "type": "string" - } - }, - "required": [ - "redactedText" - ], - "type": "object" - } - ] - }, "LanguageResult": { "type": "object", "required": [ @@ -2399,76 +1329,6 @@ "description": "A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true." } } - }, - "TypedCustomClassificationResult": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/CustomClassificationResult" - } - ] - }, - "TypedCustomEntitiesResult": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/CustomEntitiesResult" - } - ] - }, - "TypedEntitiesResult": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/EntitiesResult" - } - ] - }, - "TypedEntityLinkingResult": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/EntityLinkingResult" - } - ] - }, - "TypedKeyPhraseResult": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/KeyPhraseResult" - } - ] - }, - "TypedPiiResult": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/PiiResult" - } - ] - }, - "TypedSentimentResponse": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/SentimentResponse" - } - ] } }, "parameters": { From 7bb9d035148a02782aeaf2399ec47c520c966dfe Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Thu, 23 Jul 2020 23:24:19 -0700 Subject: [PATCH 11/54] Removing some obsolete settings from readme.md --- .../data-plane/TextAnalytics/readme.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index 073499c12d3d..91a2f88d4dc8 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -24,8 +24,8 @@ See Text Analytics [Quickstart guide](https://docs.microsoft.com/en-us/azure/cog > see https://aka.ms/autorest -The current release is `release_3_0`. -A preview release `release_3_2_preview.1` is also available. +The current release is `release_2_1`. +A preview release `release_2_1_preview` is also available. ``` yaml tag: release_2_1 @@ -186,6 +186,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.2-preview.1/TextAnalytics.json ``` @@ -196,13 +197,3 @@ uncomment the `exclude-file` section below and add the file paths. #exclude-file: # - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json ``` - -### Tag: package-preview-2018-05 - -These settings apply only when `--tag=package-preview-2018-05` is specified on the command line. - -```yaml $(tag) == 'package-preview-2018-05' -input-file: - - preview/2018-05-01-privatepreview/TextAnalytics.json -``` - From 471388e35ac875c9e2c6d8eb892a3fa366a53754 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 09:37:24 -0700 Subject: [PATCH 12/54] Adding error examples --- .../examples/SuccessfulEntitiesRequest.json | 16 ++ .../SuccessfulEntityLinkingRequest.json | 16 ++ .../examples/SuccessfulEntityPIIRequest.json | 16 ++ .../examples/SuccessfulKeyPhrasesRequest.json | 16 ++ .../examples/SuccessfulLanguagesRequest.json | 16 ++ .../examples/SuccessfulSentimentRequest.json | 16 ++ .../preview/v3.2-preview.1/TextAnalytics.json | 16 +- .../examples/SuccessfulAnalyzeRequest.json | 16 ++ .../SuccessfulAnalyzeStatusRequest.json | 18 +- .../examples/SuccessfulEntitiesRequest.json | 16 ++ .../SuccessfulEntityLinkingRequest.json | 16 ++ .../examples/SuccessfulEntityPIIRequest.json | 16 ++ .../SuccessfulHealthDeleteRequest.json | 30 +++ .../examples/SuccessfulHealthRequest.json | 201 ++--------------- .../SuccessfulHealthsStatusRequest.json | 205 ++++++++++++++++++ .../examples/SuccessfulKeyPhrasesRequest.json | 16 ++ .../examples/SuccessfulLanguagesRequest.json | 16 ++ .../examples/SuccessfulSentimentRequest.json | 16 ++ 18 files changed, 495 insertions(+), 183 deletions(-) create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthsStatusRequest.json 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..0939bff745de 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,22 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "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..7259f38ba163 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,22 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "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..e494bee4bf72 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,22 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "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..f22aeacb60d9 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,22 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "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 fad894b10669..183b441e282b 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 @@ -62,6 +62,22 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "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..8555f5d7b8fe 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,22 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index dc1c984ea4c5..ec657e7f1f40 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -178,7 +178,13 @@ } } } - } + }, + "x-ms-examples": { + "Successful Health request": { + "$ref": ".//examples//SuccessfulHealthDeleteRequest.json" + } + }, + "deprecated": false }, "get": { "description": "Get details of the healthcare prediction job specified by the jobId.", @@ -220,7 +226,13 @@ "$ref": "#/definitions/HealthcareJobState" } } - } + }, + "x-ms-examples": { + "Successful Health request": { + "$ref": ".//examples//SuccessfulHealthStatusRequest.json" + } + }, + "deprecated": false } }, "/entities/healthcare/jobs": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json index 4cbaed612055..a1aa3a5c61c8 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -36,6 +36,22 @@ "headers": { "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1//analyze/jobs/{jobId}" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json index bb885d0d6c2a..88b27b72d20c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -33,7 +33,7 @@ }, "responses": { "200": { - "headers" : {}, + "headers": {}, "body": { "createdUpdateDateTime": "2020-10-01T15-01-03.45Z", "displayName": "Extracting Location & US Region", @@ -121,6 +121,22 @@ "total": 2 } } + }, + "404": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json index 6aa19c223700..c26716b0b71f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json @@ -67,6 +67,22 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json index 294eb8e0f951..743490d5c2d1 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -111,6 +111,22 @@ } ] } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json index cff4b63dd916..8a1070fcd3fd 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -76,6 +76,22 @@ "errors": [], "modelVersion": "2019-10-01" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json new file mode 100644 index 000000000000..9d409d4f9811 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}" + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" + } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json index eaec5c788e8b..b89e8be5c909 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json @@ -2,6 +2,7 @@ "parameters": { "Ocp-Apim-Subscription-Key": "{API key}", "Endpoint": "{Endpoint}", + "jobId": "{Job ID}", "input": { "documents": [ { @@ -13,186 +14,26 @@ } }, "responses": { - "200": { - "headers": {}, - "body": { - "createdUpdateDateTime": "2020-10-01T15-01-03.45Z", - "expirationDateTime": "2020-10-03T15-01-03.55Z", - "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", - "lastUpdateDateTime": "2020-10-01T15-01-03.55Z", - "status": "succeeded", - "results": { - "documents": [ - { - "id": "1", - "entities": [ - { - "offset": 18, - "length": 5, - "text": "100mg", - "category": "Dosage", - "confidenceScore": 0.99, - "isNegated": false - }, - { - "offset": 27, - "length": 9, - "text": "ibuprofen", - "category": "MedicationName", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "id": "C0020740", - "dataSource": "UMLS" - }, - { - "id": "0000019879", - "dataSource": "AOD" - }, - { - "id": "M01AE01", - "dataSource": "ATC" - }, - { - "id": "0046165", - "dataSource": "CCPSS" - }, - { - "id": "0000006519", - "dataSource": "CHV" - }, - { - "id": "2270-2077", - "dataSource": "CSP" - }, - { - "id": "DB01050", - "dataSource": "DRUGBANK" - }, - { - "id": "1611", - "dataSource": "GS" - }, - { - "id": "sh97005926", - "dataSource": "LCH_NW" - }, - { - "id": "LP16165-0", - "dataSource": "LNC" - }, - { - "id": "40458", - "dataSource": "MEDCIN" - }, - { - "id": "d00015", - "dataSource": "MMSL" - }, - { - "id": "D007052", - "dataSource": "MSH" - }, - { - "id": "WK2XYI10QM", - "dataSource": "MTHSPL" - }, - { - "id": "C561", - "dataSource": "NCI" - }, - { - "id": "C561", - "dataSource": "NCI_CTRP" - }, - { - "id": "00803", - "dataSource": "NCI_DCP" - }, - { - "id": "NSC0256857", - "dataSource": "NCI_DTP" - }, - { - "id": "WK2XYI10QM", - "dataSource": "NCI_FDA" - }, - { - "id": "CDR0000613511", - "dataSource": "NCI_NCI-GLOSS" - }, - { - "id": "002377", - "dataSource": "NDDF" - }, - { - "id": "CDR0000040475", - "dataSource": "PDQ" - }, - { - "id": "x02MO", - "dataSource": "RCD" - }, - { - "id": "5640", - "dataSource": "RXNORM" - }, - { - "id": "E-7772", - "dataSource": "SNM" - }, - { - "id": "C-603C0", - "dataSource": "SNMI" - }, - { - "id": "387207008", - "dataSource": "SNOMEDCT_US" - }, - { - "id": "m39860", - "dataSource": "USP" - }, - { - "id": "MTHU000060", - "dataSource": "USPMG" - }, - { - "id": "4017840", - "dataSource": "VANDF" - } - ] - }, - { - "offset": 37, - "length": 11, - "text": "twice daily", - "category": "Frequency", - "confidenceScore": 1, - "isNegated": false - } - ], - "relations": [ - { - "relationType": "DosageOfMedication", - "bidirectional": false, - "source": "#/documents/0/entities/0", - "target": "#/documents/0/entities/1" - }, - { - "relationType": "FrequencyOfMedication", - "bidirectional": false, - "source": "#/documents/0/entities/2", - "target": "#/documents/0/entities/1" - } - ] - } - ], - "errors": [], - "modelVersion": "2020-05-08" - } - } + "202": { + "headers": { + "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" + } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthsStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthsStatusRequest.json new file mode 100644 index 000000000000..4a8f979cfa40 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthsStatusRequest.json @@ -0,0 +1,205 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "createdUpdateDateTime": "2020-10-01T15-01-03.45Z", + "expirationDateTime": "2020-10-03T15-01-03.55Z", + "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", + "lastUpdateDateTime": "2020-10-01T15-01-03.55Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "1", + "entities": [ + { + "offset": 18, + "length": 5, + "text": "100mg", + "category": "Dosage", + "confidenceScore": 0.99, + "isNegated": false + }, + { + "offset": 27, + "length": 9, + "text": "ibuprofen", + "category": "MedicationName", + "confidenceScore": 1.0, + "isNegated": false, + "links": [ + { + "id": "C0020740", + "dataSource": "UMLS" + }, + { + "id": "0000019879", + "dataSource": "AOD" + }, + { + "id": "M01AE01", + "dataSource": "ATC" + }, + { + "id": "0046165", + "dataSource": "CCPSS" + }, + { + "id": "0000006519", + "dataSource": "CHV" + }, + { + "id": "2270-2077", + "dataSource": "CSP" + }, + { + "id": "DB01050", + "dataSource": "DRUGBANK" + }, + { + "id": "1611", + "dataSource": "GS" + }, + { + "id": "sh97005926", + "dataSource": "LCH_NW" + }, + { + "id": "LP16165-0", + "dataSource": "LNC" + }, + { + "id": "40458", + "dataSource": "MEDCIN" + }, + { + "id": "d00015", + "dataSource": "MMSL" + }, + { + "id": "D007052", + "dataSource": "MSH" + }, + { + "id": "WK2XYI10QM", + "dataSource": "MTHSPL" + }, + { + "id": "C561", + "dataSource": "NCI" + }, + { + "id": "C561", + "dataSource": "NCI_CTRP" + }, + { + "id": "00803", + "dataSource": "NCI_DCP" + }, + { + "id": "NSC0256857", + "dataSource": "NCI_DTP" + }, + { + "id": "WK2XYI10QM", + "dataSource": "NCI_FDA" + }, + { + "id": "CDR0000613511", + "dataSource": "NCI_NCI-GLOSS" + }, + { + "id": "002377", + "dataSource": "NDDF" + }, + { + "id": "CDR0000040475", + "dataSource": "PDQ" + }, + { + "id": "x02MO", + "dataSource": "RCD" + }, + { + "id": "5640", + "dataSource": "RXNORM" + }, + { + "id": "E-7772", + "dataSource": "SNM" + }, + { + "id": "C-603C0", + "dataSource": "SNMI" + }, + { + "id": "387207008", + "dataSource": "SNOMEDCT_US" + }, + { + "id": "m39860", + "dataSource": "USP" + }, + { + "id": "MTHU000060", + "dataSource": "USPMG" + }, + { + "id": "4017840", + "dataSource": "VANDF" + } + ] + }, + { + "offset": 37, + "length": 11, + "text": "twice daily", + "category": "Frequency", + "confidenceScore": 1, + "isNegated": false + } + ], + "relations": [ + { + "relationType": "DosageOfMedication", + "bidirectional": false, + "source": "#/documents/0/entities/0", + "target": "#/documents/0/entities/1" + }, + { + "relationType": "FrequencyOfMedication", + "bidirectional": false, + "source": "#/documents/0/entities/2", + "target": "#/documents/0/entities/1" + } + ] + } + ], + "errors": [], + "modelVersion": "2020-05-08" + } + } + }, + "404": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json index 4f86d597673a..58faad7408a8 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -54,6 +54,22 @@ } ] } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json index 16714e4ca2ac..60701f3eeeb1 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json @@ -55,6 +55,22 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json index 1592cc9d8af8..466ab4811e3d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json @@ -133,6 +133,22 @@ "errors": [], "modelVersion": "2020-04-01" } + }, + "400": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } + } + }, + "500": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } From e1838846628d734ed2df42ddb960aeaed2b18f86 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 09:47:20 -0700 Subject: [PATCH 13/54] Fixing LD swagger + examples --- .../preview/v3.1-preview.1/TextAnalytics.json | 11 ++--- .../examples/SuccessfulLanguagesRequest.json | 41 ++++++++----------- .../preview/v3.2-preview.1/TextAnalytics.json | 11 ++--- 3 files changed, 25 insertions(+), 38 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 0ff15eff3ba9..be6c1a405786 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 @@ -1279,7 +1279,7 @@ "type": "object", "required": [ "id", - "detectedLanguages", + "detectedLanguage", "warnings" ], "properties": { @@ -1287,12 +1287,9 @@ "type": "string", "description": "Unique, non-empty document identifier." }, - "detectedLanguages": { - "type": "array", - "description": "A list of extracted languages.", - "items": { - "$ref": "#/definitions/DetectedLanguage" - } + "detectedLanguage": { + "description": "Detected Language.", + "$ref": "#/definitions/DetectedLanguage" }, "warnings": { "type": "array", 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 183b441e282b..60701f3eeeb1 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 @@ -5,7 +5,6 @@ "input": { "documents": [ { - "countryHint": "US", "id": "1", "text": "Hello world" }, @@ -15,7 +14,7 @@ }, { "id": "3", - "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer." + "text": "Hola mundo" } ] } @@ -26,41 +25,35 @@ "body": { "documents": [ { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "en", + "name": "English" + }, "id": "1", - "detectedLanguages": [ - { - "name": "English", - "iso6391Name": "en", - "confidenceScore": 1 - } - ], "warnings": [] }, { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "fr", + "name": "French" + }, "id": "2", - "detectedLanguages": [ - { - "name": "French", - "iso6391Name": "fr", - "confidenceScore": 1 - } - ], "warnings": [] }, { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "es", + "name": "Spanish" + }, "id": "3", - "detectedLanguages": [ - { - "name": "Spanish", - "iso6391Name": "es", - "confidenceScore": 1 - } - ], "warnings": [] } ], "errors": [], - "modelVersion": "2019-10-01" + "modelVersion": "2020-04-01" } }, "400": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index ec657e7f1f40..c2d71c9e9ae8 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -2361,7 +2361,7 @@ "type": "object", "required": [ "id", - "detectedLanguages", + "detectedLanguage", "warnings" ], "properties": { @@ -2369,12 +2369,9 @@ "type": "string", "description": "Unique, non-empty document identifier." }, - "detectedLanguages": { - "type": "array", - "description": "A list of extracted languages.", - "items": { - "$ref": "#/definitions/DetectedLanguage" - } + "detectedLanguage": { + "description": "Detected Language.", + "$ref": "#/definitions/DetectedLanguage" }, "warnings": { "type": "array", From fd811ecb1176e82e15739dc24fcb865d497a634b Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 09:50:51 -0700 Subject: [PATCH 14/54] Fixing KPE example --- .../v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json index 58faad7408a8..9d8732e2b6ef 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -52,7 +52,9 @@ ], "warnings": [] } - ] + ], + "errors": [], + "modelVersion": "2019-10-01" } }, "400": { From b3940686070637295552f90c04e98c38d4d449a1 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 09:58:50 -0700 Subject: [PATCH 15/54] PII redactedText in the right place --- .../preview/v3.2-preview.1/TextAnalytics.json | 91 ++++++++++++++++--- .../SuccessfulEntityLinkingRequest.json | 4 +- .../examples/SuccessfulEntityPIIRequest.json | 3 - 3 files changed, 80 insertions(+), 18 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index c2d71c9e9ae8..1fe1fa27ff6d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -1780,6 +1780,38 @@ } } }, + "DocumentPiiEntities": { + "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": [ @@ -1819,6 +1851,24 @@ } } }, + "PiiEntity": { + "allOf": [ + { + "$ref": "#/definitions/Entity" + }, + { + "type": "object", + "required": [ + "redactedText" + ], + "properties": { + "redactedText": { + "type": "string" + } + } + } + ] + }, "EntityLinkingResult": { "type": "object", "required": [ @@ -2309,22 +2359,35 @@ "type": "object" }, "PiiResult": { - "allOf": [ - { - "$ref": "#/definitions/EntitiesResult" + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentPiiEntities" + } }, - { - "properties": { - "redactedText": { - "type": "string" - } - }, - "required": [ - "redactedText" - ], - "type": "object" + "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." } - ] + } }, "LanguageResult": { "type": "object", diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json index 743490d5c2d1..a6b57f079ff0 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -109,7 +109,9 @@ "id": "2", "warnings": [] } - ] + ], + "errors": [], + "modelVersion": "2020-02-01" } }, "400": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json index 8a1070fcd3fd..b0b9fd1fd1a6 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -35,7 +35,6 @@ "length": 11, "offset": 28, "redactedText": "My SSN is ***********", - "subcategory": "", "text": "859-98-0987" } ], @@ -50,7 +49,6 @@ "length": 9, "offset": 18, "redactedText": "Your ABA number - ********* - is the first 9 digits in the lower left hand corner of your personal check.", - "subcategory": "", "text": "111000025" } ], @@ -65,7 +63,6 @@ "length": 14, "offset": 3, "redactedText": "Is ************** your Brazilian CPF number?", - "subcategory": "", "text": "998.214.865-68" } ], From fc9ffe5ed90dfb8d330c50ab8541244a2064ba18 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 10:11:07 -0700 Subject: [PATCH 16/54] Addressing linting issues --- .../preview/v3.1-preview.1/TextAnalytics.json | 4 ++++ .../preview/v3.2-preview.1/TextAnalytics.json | 23 +++++++++++-------- 2 files changed, 18 insertions(+), 9 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 be6c1a405786..bf5fb90abaa9 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 @@ -802,6 +802,10 @@ "mixed", "negative" ], + "x-ms-enum": { + "name": "AspectSentimentValue", + "modelAsString": false + }, "description": "Aspect level sentiment for the aspect in the sentence." }, "confidenceScores": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 1fe1fa27ff6d..faeefd874534 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -60,7 +60,6 @@ "description": "A successful call results with an operation-location header used to check the status of the analysis job.", "headers": { "Operation-Location": { - "format": "uri", "type": "string" } } @@ -83,7 +82,8 @@ "$ref": ".//examples//SuccessfulAnalyzeRequest.json" } }, - "deprecated": false + "deprecated": false, + "x-ms-long-running-operation": true } }, "/analyze/jobs/{jobId}": { @@ -173,7 +173,6 @@ "description": "Accepted - Cancel Job request has been received.", "headers": { "Operation-Location": { - "format": "uri", "type": "string" } } @@ -184,7 +183,8 @@ "$ref": ".//examples//SuccessfulHealthDeleteRequest.json" } }, - "deprecated": false + "deprecated": false, + "x-ms-long-running-operation": true }, "get": { "description": "Get details of the healthcare prediction job specified by the jobId.", @@ -287,7 +287,6 @@ "description": "Accepted - call results in a link where the status of the submitted job can be checked via the GET operation.", "headers": { "Operation-Location": { - "format": "uri", "type": "string" } } @@ -304,7 +303,8 @@ "$ref": ".//examples//SuccessfulHealthRequest.json" } }, - "deprecated": false + "deprecated": false, + "x-ms-long-running-operation": true } }, "/entities/recognition/general": { @@ -1605,6 +1605,10 @@ "mixed", "negative" ], + "x-ms-enum": { + "name": "AspectSentimentValue", + "modelAsString": false + }, "description": "Aspect level sentiment for the aspect in the sentence." }, "confidenceScores": { @@ -1691,6 +1695,10 @@ "opinion", "aspect" ], + "x-ms-enum": { + "name": "AspectRelationType", + "modelAsString": false + }, "description": "The type related to the aspect." }, "ref": { @@ -2085,11 +2093,9 @@ "type": "boolean" }, "source": { - "format": "uri", "type": "string" }, "target": { - "format": "uri", "type": "string" } } @@ -2352,7 +2358,6 @@ "Pagination": { "properties": { "@nextLink": { - "format": "uri", "type": "string" } }, From 437880195850e9fb27df8184643c998875fc6efe Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 10:55:47 -0700 Subject: [PATCH 17/54] More linting errors + file name typo --- .../preview/v3.1-preview.1/TextAnalytics.json | 60 +++++++++--- .../preview/v3.2-preview.1/TextAnalytics.json | 94 ++++++++++++++++--- ...son => SuccessfulHealthStatusRequest.json} | 0 3 files changed, 128 insertions(+), 26 deletions(-) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/{SuccessfulHealthsStatusRequest.json => SuccessfulHealthStatusRequest.json} (100%) 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 bf5fb90abaa9..c257478901f0 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,8 +77,14 @@ "$ref": "#/definitions/EntitiesResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -141,8 +147,14 @@ "$ref": "#/definitions/EntitiesResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -199,8 +211,14 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -257,8 +275,14 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -315,8 +339,14 @@ "$ref": "#/definitions/LanguageResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -379,8 +409,14 @@ "$ref": "#/definitions/SentimentResponse" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index faeefd874534..962b48637917 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -176,6 +176,18 @@ "type": "string" } } + }, + "404": { + "description": "Job ID not found.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } } }, "x-ms-examples": { @@ -225,6 +237,18 @@ "schema": { "$ref": "#/definitions/HealthcareJobState" } + }, + "404": { + "description": "Job ID not found.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } } }, "x-ms-examples": { @@ -291,8 +315,14 @@ } } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -366,8 +396,14 @@ "$ref": "#/definitions/EntitiesResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -446,8 +482,14 @@ "$ref": "#/definitions/PiiResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -520,8 +562,14 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -578,8 +626,14 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -636,8 +690,14 @@ "$ref": "#/definitions/LanguageResult" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } @@ -716,8 +776,14 @@ "$ref": "#/definitions/SentimentResponse" } }, - "default": { - "description": "Error Response", + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/TextAnalyticsError" + } + }, + "500": { + "description": "Internal error response", "schema": { "$ref": "#/definitions/TextAnalyticsError" } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthsStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthsStatusRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json From a5ea1690ffe9305ac6e49f42ecb21a9f942fd8f7 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 12:42:54 -0700 Subject: [PATCH 18/54] LRO RC from 202 to 204 --- .../preview/v3.1-preview.1/TextAnalytics.json | 10 +++++- .../examples/SuccessfulEntitiesRequest.json | 24 ++++++++----- .../SuccessfulEntityLinkingRequest.json | 24 ++++++++----- .../examples/SuccessfulEntityPIIRequest.json | 24 ++++++++----- .../examples/SuccessfulKeyPhrasesRequest.json | 24 ++++++++----- .../examples/SuccessfulLanguagesRequest.json | 24 ++++++++----- .../examples/SuccessfulSentimentRequest.json | 24 ++++++++----- .../preview/v3.2-preview.1/TextAnalytics.json | 22 ++++++++---- .../examples/SuccessfulAnalyzeRequest.json | 34 +++++++++++-------- .../SuccessfulAnalyzeStatusRequest.json | 24 ++++++++----- .../examples/SuccessfulEntitiesRequest.json | 24 ++++++++----- .../SuccessfulEntityLinkingRequest.json | 24 ++++++++----- .../examples/SuccessfulEntityPIIRequest.json | 24 ++++++++----- .../SuccessfulHealthDeleteRequest.json | 32 ++++++++++------- .../examples/SuccessfulHealthRequest.json | 34 +++++++++++-------- .../SuccessfulHealthStatusRequest.json | 24 ++++++++----- .../examples/SuccessfulKeyPhrasesRequest.json | 24 ++++++++----- .../examples/SuccessfulLanguagesRequest.json | 24 ++++++++----- .../examples/SuccessfulSentimentRequest.json | 24 ++++++++----- 19 files changed, 293 insertions(+), 175 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 c257478901f0..528bf76d2bb2 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 @@ -839,7 +839,7 @@ "negative" ], "x-ms-enum": { - "name": "AspectSentimentValue", + "name": "TokenSentimentValue", "modelAsString": false }, "description": "Aspect level sentiment for the aspect in the sentence." @@ -889,6 +889,10 @@ "mixed", "negative" ], + "x-ms-enum": { + "name": "TokenSentimentValue", + "modelAsString": false + }, "description": "Opinion level sentiment for the aspect in the sentence." }, "confidenceScores": { @@ -928,6 +932,10 @@ "opinion", "aspect" ], + "x-ms-enum": { + "name": "AspectRelationType", + "modelAsString": false + }, "description": "The type related to the aspect." }, "ref": { 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 0939bff745de..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 @@ -88,19 +88,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "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 7259f38ba163..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 @@ -96,19 +96,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "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 e494bee4bf72..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 @@ -75,19 +75,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "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 f22aeacb60d9..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 @@ -57,19 +57,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "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 60701f3eeeb1..b1077b92db58 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 @@ -57,19 +57,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "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 8555f5d7b8fe..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 @@ -320,19 +320,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 962b48637917..2b225716478d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -56,8 +56,8 @@ } ], "responses": { - "202": { - "description": "A successful call results with an operation-location header used to check the status of the analysis job.", + "204": { + "description": "A successful call results with an Operation-Location header used to check the status of the analysis job.", "headers": { "Operation-Location": { "type": "string" @@ -158,6 +158,8 @@ "/entities/healthcare/jobs/{jobId}": { "delete": { "description": "Cancel healthcare prediction job.", + "operationId": "CancelHealthJob", + "summary": "Cancel healthcare prediction job", "parameters": [ { "description": "Job ID", @@ -169,8 +171,8 @@ } ], "responses": { - "202": { - "description": "Accepted - Cancel Job request has been received.", + "204": { + "description": "Cancel Job request has been received.", "headers": { "Operation-Location": { "type": "string" @@ -200,6 +202,8 @@ }, "get": { "description": "Get details of the healthcare prediction job specified by the jobId.", + "operationId": "HealthStatus", + "summary": "Get healthcare analysis job status and results", "parameters": [ { "description": "Job ID", @@ -261,7 +265,7 @@ }, "/entities/healthcare/jobs": { "post": { - "summary": "Health", + "summary": "Submit healthcare analysis job", "description": "The API returns a list of recognized healthcare entities and relations for each valid document.", "operationId": "Health", "consumes": [ @@ -307,7 +311,7 @@ } ], "responses": { - "202": { + "204": { "description": "Accepted - call results in a link where the status of the submitted job can be checked via the GET operation.", "headers": { "Operation-Location": { @@ -1672,7 +1676,7 @@ "negative" ], "x-ms-enum": { - "name": "AspectSentimentValue", + "name": "TokenSentimentValue", "modelAsString": false }, "description": "Aspect level sentiment for the aspect in the sentence." @@ -1722,6 +1726,10 @@ "mixed", "negative" ], + "x-ms-enum": { + "name": "TokenSentimentValue", + "modelAsString": false + }, "description": "Opinion level sentiment for the aspect in the sentence." }, "confidenceScores": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json index a1aa3a5c61c8..28bf74f97813 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -32,26 +32,32 @@ } }, "responses": { - "202": { + "204": { "headers": { "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1//analyze/jobs/{jobId}" } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "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" + } } } - }, - "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json index 88b27b72d20c..de4f93baac2b 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -123,19 +123,25 @@ } }, "404": { - "error": { - "code": "NotFound", - "message": "Not Found", - "innererror": { - "code": "JobIdNotFound", - "message": "Job ID not found." + "headers": {}, + "body": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json index c26716b0b71f..02dd04bfe617 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json @@ -69,19 +69,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json index a6b57f079ff0..998ac1d65bab 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -115,19 +115,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json index b0b9fd1fd1a6..d07170bdba7f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -75,19 +75,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json index 9d409d4f9811..b9831626b22c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json @@ -5,26 +5,32 @@ "jobId": "{Job ID}" }, "responses": { - "202": { + "204": { "headers": { "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" } }, - "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "404": { + "headers": {}, + "body": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } + } } - } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json index b89e8be5c909..6323dee2e7cd 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json @@ -14,26 +14,32 @@ } }, "responses": { - "202": { + "204": { "headers": { "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "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" + } } } - }, - "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json index 4a8f979cfa40..af2ada8ff77f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json @@ -186,19 +186,25 @@ } }, "404": { - "error": { - "code": "NotFound", - "message": "Not Found", - "innererror": { - "code": "JobIdNotFound", - "message": "Job ID not found." + "headers": {}, + "body": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json index 9d8732e2b6ef..f45b74e027f5 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -58,19 +58,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json index 60701f3eeeb1..b1077b92db58 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json @@ -57,19 +57,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json index 466ab4811e3d..9363baebb94f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json @@ -135,19 +135,25 @@ } }, "400": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Invalid Request.", + "innererror": { + "code": "MissingInputRecords", + "message": "Missing input records." + } } } }, "500": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } } } } From 646ba42d358d07f64544d7804667bd52463ce10e Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 13:08:21 -0700 Subject: [PATCH 19/54] Error responses under "error" property in 400/500 --- .../preview/v3.1-preview.1/TextAnalytics.json | 37 ++++++++---- .../preview/v3.2-preview.1/TextAnalytics.json | 57 ++++++++++++------- 2 files changed, 60 insertions(+), 34 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 528bf76d2bb2..f7c18ffef7f3 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 @@ -80,13 +80,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -150,13 +150,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -214,13 +214,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -278,13 +278,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -342,13 +342,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -412,13 +412,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -488,6 +488,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.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 2b225716478d..d99c45b6eb68 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -67,13 +67,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -137,13 +137,13 @@ "404": { "description": "Job ID not found.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -182,13 +182,13 @@ "404": { "description": "Job ID not found.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -245,13 +245,13 @@ "404": { "description": "Job ID not found.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -322,13 +322,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -403,13 +403,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -489,13 +489,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -569,13 +569,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -633,13 +633,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -697,13 +697,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -783,13 +783,13 @@ "400": { "description": "Bad Request.", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } }, "500": { "description": "Internal error response", "schema": { - "$ref": "#/definitions/TextAnalyticsError" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -874,6 +874,19 @@ } } }, + "ErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "description": "Document Error.", + "$ref": "#/definitions/TextAnalyticsError" + } + } + }, "TextAnalyticsError": { "type": "object", "required": [ From f0b401fc33e2dd202d6741870ed8cc83c7c7669f Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 13:21:12 -0700 Subject: [PATCH 20/54] Fixing enum casing --- .../preview/v3.1-preview.1/TextAnalytics.json | 26 +++++++++---------- .../preview/v3.2-preview.1/TextAnalytics.json | 26 +++++++++---------- 2 files changed, 26 insertions(+), 26 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 f7c18ffef7f3..e5f46ac8a43d 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 @@ -511,10 +511,10 @@ "code": { "type": "string", "enum": [ - "invalidRequest", - "invalidArgument", - "internalServerError", - "serviceUnavailable" + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable" ], "x-ms-enum": { "name": "ErrorCodeValue", @@ -582,15 +582,15 @@ "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", diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index d99c45b6eb68..034bf3f47b3a 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -897,10 +897,10 @@ "code": { "type": "string", "enum": [ - "invalidRequest", - "invalidArgument", - "internalServerError", - "serviceUnavailable" + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable" ], "x-ms-enum": { "name": "ErrorCodeValue", @@ -1060,15 +1060,15 @@ "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", From f2b8667f68b67ae7163511e05229c2e19b37452c Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 13:55:34 -0700 Subject: [PATCH 21/54] StringIndexType enum casing --- .../preview/v3.2-preview.1/TextAnalytics.json | 88 ++++++++++--------- 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 034bf3f47b3a..2d09118edb38 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -157,6 +157,10 @@ }, "/entities/healthcare/jobs/{jobId}": { "delete": { + "produces": [ + "application/json", + "text/json" + ], "description": "Cancel healthcare prediction job.", "operationId": "CancelHealthJob", "summary": "Cancel healthcare prediction job", @@ -201,6 +205,10 @@ "x-ms-long-running-operation": true }, "get": { + "produces": [ + "application/json", + "text/json" + ], "description": "Get details of the healthcare prediction job specified by the jobId.", "operationId": "HealthStatus", "summary": "Get healthcare analysis job status and results", @@ -289,11 +297,11 @@ "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", + "default": "TextElements_v8", "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" ], "x-ms-enum": { "name": "StringIndexType", @@ -372,11 +380,11 @@ "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", + "default": "TextElements_v8", "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" ], "x-ms-enum": { "name": "StringIndexType", @@ -458,11 +466,11 @@ "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", + "default": "TextElements_v8", "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" ], "x-ms-enum": { "name": "StringIndexType", @@ -538,11 +546,11 @@ "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", + "default": "TextElements_v8", "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" ], "x-ms-enum": { "name": "StringIndexType", @@ -752,11 +760,11 @@ "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", + "default": "TextElements_v8", "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" ], "x-ms-enum": { "name": "StringIndexType", @@ -1004,11 +1012,11 @@ "type": "string" }, "stringIndexType": { - "default": "textelements_v8", + "default": "TextElements_v8", "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" ], "type": "string" } @@ -1034,11 +1042,11 @@ "type": "string" }, "stringIndexType": { - "default": "textelements_v8", + "default": "TextElements_v8", "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" ], "type": "string" } @@ -1265,11 +1273,11 @@ "type": "string" }, "stringIndexType": { - "default": "textelements_v8", + "default": "TextElements_v8", "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" ], "type": "string" } @@ -1378,11 +1386,11 @@ "type": "boolean" }, "stringIndexType": { - "default": "textelements_v8", + "default": "TextElements_v8", "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" ], "type": "string", "x-ms-enum": { @@ -2041,11 +2049,11 @@ "type": "string" }, "stringIndexType": { - "default": "textelements_v8", + "default": "TextElements_v8", "enum": [ - "textelements_v8", - "unicodecodepoint", - "utf16codeunit" + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" ], "type": "string" } From 569fbdfff7e2929a794b4b68abddfa836e728376 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 15:06:20 -0700 Subject: [PATCH 22/54] Enum as strings + common parameters --- .../preview/v3.1-preview.1/TextAnalytics.json | 167 ++++---- .../preview/v3.2-preview.1/TextAnalytics.json | 372 +++++++----------- .../examples/SuccessfulAnalyzeRequest.json | 2 +- .../SuccessfulAnalyzeStatusRequest.json | 5 +- 4 files changed, 209 insertions(+), 337 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 e5f46ac8a43d..ff9fc19145ae 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,27 +47,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. ", - "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" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -113,16 +99,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" + "$ref": "#/parameters/ShowStats" }, { "name": "domain", @@ -131,13 +111,7 @@ "type": "string" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -183,25 +157,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/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -247,25 +209,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": { @@ -311,25 +261,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/MultiLanguageInput" } ], "responses": { @@ -375,16 +313,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" + "$ref": "#/parameters/ShowStats" }, { "name": "opinionMining", @@ -393,13 +325,7 @@ "type": "boolean" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -558,7 +484,7 @@ ], "x-ms-enum": { "name": "WarningCodeValue", - "modelAsString": false + "modelAsString": true }, "description": "Error code." }, @@ -594,7 +520,7 @@ ], "x-ms-enum": { "name": "InnerErrorCodeValue", - "modelAsString": false + "modelAsString": true }, "description": "Error code." }, @@ -1398,6 +1324,59 @@ "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." + } + ] + } + }, + "ShowStats": { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain request and document level statistics.", + "type": "boolean", + "required": false + }, + "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 + }, + "MultiLanguageInput": { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 2d09118edb38..607f433c6ee7 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -97,18 +97,10 @@ "summary": "Get analysis status and results", "parameters": [ { - "description": "Job ID", - "format": "uuid", - "in": "path", - "name": "jobId", - "required": true, - "type": "string" + "$ref": "#/parameters/JobId" }, { - "description": "(Optional) if set to true, response will contain input and document level statistics.", - "in": "query", - "name": "showStats", - "type": "boolean" + "$ref": "#/parameters/ShowStats" }, { "default": 20, @@ -166,12 +158,7 @@ "summary": "Cancel healthcare prediction job", "parameters": [ { - "description": "Job ID", - "format": "uuid", - "in": "path", - "name": "jobId", - "required": true, - "type": "string" + "$ref": "#/parameters/JobId" } ], "responses": { @@ -214,12 +201,7 @@ "summary": "Get healthcare analysis job status and results", "parameters": [ { - "description": "Job ID", - "format": "uuid", - "in": "path", - "name": "jobId", - "required": true, - "type": "string" + "$ref": "#/parameters/JobId" }, { "in": "query", @@ -236,11 +218,7 @@ "required": false }, { - "name": "showStats", - "in": "query", - "description": "(Optional) if set to true, response will contain request and document level statistics.", - "type": "boolean", - "required": false + "$ref": "#/parameters/ShowStats" } ], "responses": { @@ -286,36 +264,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", - "required": false + "$ref": "#/parameters/ModelVersion" }, { - "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": true - } + "$ref": "#/parameters/StringIndexType" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -364,41 +319,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", - "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": true - } + "$ref": "#/parameters/StringIndexType" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -444,16 +374,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" + "$ref": "#/parameters/ShowStats" }, { "name": "domain", @@ -462,29 +386,10 @@ "type": "string" }, { - "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": true - } + "$ref": "#/parameters/StringIndexType" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -530,41 +435,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", - "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": true - } + "$ref": "#/parameters/StringIndexType" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -610,25 +490,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": { @@ -674,25 +542,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/MultiLanguageInput" } ], "responses": { @@ -738,16 +594,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" + "$ref": "#/parameters/ShowStats" }, { "name": "opinionMining", @@ -756,29 +606,10 @@ "type": "boolean" }, { - "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": true - } + "$ref": "#/parameters/StringIndexType" }, { - "in": "body", - "name": "input", - "description": "Collection of documents to analyze.", - "required": true, - "schema": { - "$ref": "#/definitions/MultiLanguageBatchInput" - } + "$ref": "#/parameters/MultiLanguageInput" } ], "responses": { @@ -976,7 +807,7 @@ ], "x-ms-enum": { "name": "WarningCodeValue", - "modelAsString": false + "modelAsString": true }, "description": "Error code." }, @@ -1012,13 +843,7 @@ "type": "string" }, "stringIndexType": { - "default": "TextElements_v8", - "enum": [ - "TextElements_v8", - "UnicodeCodePoint", - "Utf16CodeUnit" - ], - "type": "string" + "$ref": "#/definitions/StringIndexType" } }, "type": "object" @@ -1042,13 +867,7 @@ "type": "string" }, "stringIndexType": { - "default": "TextElements_v8", - "enum": [ - "TextElements_v8", - "UnicodeCodePoint", - "Utf16CodeUnit" - ], - "type": "string" + "$ref": "#/definitions/StringIndexType" } }, "type": "object" @@ -1080,7 +899,7 @@ ], "x-ms-enum": { "name": "InnerErrorCodeValue", - "modelAsString": false + "modelAsString": true }, "description": "Error code." }, @@ -1273,13 +1092,7 @@ "type": "string" }, "stringIndexType": { - "default": "TextElements_v8", - "enum": [ - "TextElements_v8", - "UnicodeCodePoint", - "Utf16CodeUnit" - ], - "type": "string" + "$ref": "#/definitions/StringIndexType" } }, "required": [ @@ -1386,17 +1199,7 @@ "type": "boolean" }, "stringIndexType": { - "default": "TextElements_v8", - "enum": [ - "TextElements_v8", - "UnicodeCodePoint", - "Utf16CodeUnit" - ], - "type": "string", - "x-ms-enum": { - "modelAsString": false, - "name": "State" - } + "$ref": "#/definitions/StringIndexType" } }, "type": "object" @@ -2049,13 +1852,7 @@ "type": "string" }, "stringIndexType": { - "default": "TextElements_v8", - "enum": [ - "TextElements_v8", - "UnicodeCodePoint", - "Utf16CodeUnit" - ], - "type": "string" + "$ref": "#/definitions/StringIndexType" } }, "type": "object" @@ -2573,6 +2370,7 @@ } }, "TypedCustomClassificationResult": { + "x-ms-discriminator-value": "CustomClassification", "allOf": [ { "$ref": "#/definitions/TextAnalyticsResult" @@ -2583,6 +2381,7 @@ ] }, "TypedCustomEntitiesResult": { + "x-ms-discriminator-value": "CustomEntityRecognition", "allOf": [ { "$ref": "#/definitions/TextAnalyticsResult" @@ -2593,6 +2392,7 @@ ] }, "TypedEntitiesResult": { + "x-ms-discriminator-value": "EntityRecognition", "allOf": [ { "$ref": "#/definitions/TextAnalyticsResult" @@ -2603,6 +2403,7 @@ ] }, "TypedEntityLinkingResult": { + "x-ms-discriminator-value": "EntityLinking", "allOf": [ { "$ref": "#/definitions/TextAnalyticsResult" @@ -2613,6 +2414,7 @@ ] }, "TypedKeyPhraseResult": { + "x-ms-discriminator-value": "KeyPhrasesExtraction", "allOf": [ { "$ref": "#/definitions/TextAnalyticsResult" @@ -2623,6 +2425,7 @@ ] }, "TypedPiiResult": { + "x-ms-discriminator-value": "PiiEntityRecognition", "allOf": [ { "$ref": "#/definitions/TextAnalyticsResult" @@ -2633,6 +2436,7 @@ ] }, "TypedSentimentResponse": { + "x-ms-discriminator-value": "SentimentAnalysis", "allOf": [ { "$ref": "#/definitions/TextAnalyticsResult" @@ -2641,6 +2445,33 @@ "$ref": "#/definitions/SentimentResponse" } ] + }, + "StringIndexType": { + "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." + } + ] + }, + "type": "string" } }, "parameters": { @@ -2652,6 +2483,67 @@ "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." + } + ] + } + }, + "JobId": { + "description": "Job ID", + "format": "uuid", + "in": "path", + "name": "jobId", + "required": true, + "type": "string" + }, + "ShowStats": { + "name": "showStats", + "in": "query", + "description": "(Optional) if set to true, response will contain request and document level statistics.", + "type": "boolean", + "required": false + }, + "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 + }, + "MultiLanguageInput": { + "in": "body", + "name": "input", + "description": "Collection of documents to analyze.", + "required": true, + "schema": { + "$ref": "#/definitions/MultiLanguageBatchInput" + } } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json index 28bf74f97813..865e0c8bdb1a 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -34,7 +34,7 @@ "responses": { "204": { "headers": { - "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1//analyze/jobs/{jobId}" + "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/analyze/jobs/{jobId}" } }, "400": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json index de4f93baac2b..6945ed85067a 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -103,7 +103,7 @@ ], "errors": [], "modelVersion": "2020-04-01", - "resultType": "EntitiesResult" + "resultType": "EntityRecognition" }, "status": "succeeded", "type": "Recognize Entities" @@ -113,7 +113,8 @@ "name": "Custom Classification 71baed8c-a832-489d-8f38-e3b44685785f/USRegionClassifier", "results": null, "status": "succeeded", - "type": "Custom Classification" + "type": "Custom Classification", + "resultType": "CustomClassification" } ], "failed": 0, From 6b3fbfadbae09894ef22a985fa35fde0b3b0c70d Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 16:12:27 -0700 Subject: [PATCH 23/54] NotFound code + fixing date formats --- .../preview/v3.2-preview.1/TextAnalytics.json | 33 +++++++++++++++---- .../SuccessfulAnalyzeStatusRequest.json | 32 +++++++++++++----- .../SuccessfulHealthStatusRequest.json | 12 ++++--- 3 files changed, 57 insertions(+), 20 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 607f433c6ee7..45f9fc0ebaa5 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -739,7 +739,8 @@ "InvalidRequest", "InvalidArgument", "InternalServerError", - "ServiceUnavailable" + "ServiceUnavailable", + "NotFound" ], "x-ms-enum": { "name": "ErrorCodeValue", @@ -987,7 +988,7 @@ "documents": { "description": "Response by document", "items": { - "$ref": "#/definitions/CustomClassifications" + "$ref": "#/definitions/CustomClassificationDocument" }, "type": "array" }, @@ -1038,11 +1039,23 @@ } ] }, - "CustomClassifications": { - "items": { - "$ref": "#/definitions/CustomClassification" - }, - "type": "array" + "CustomClassificationDocument": { + "type": "object", + "required": [ + "id", + "classifications" + ], + "properties": { + "id": { + "type": "string" + }, + "classifications": { + "items": { + "$ref": "#/definitions/CustomClassification" + }, + "type": "array" + } + } }, "CustomEntities": { "items": { @@ -1956,7 +1969,13 @@ "$ref": "#/definitions/Entity" }, { + "required": [ + "isNegated" + ], "properties": { + "isNegated": { + "type": "boolean" + }, "links": { "description": "Entity references in known data sources.", "type": "array", diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json index 6945ed85067a..d9516a2c8f44 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -35,17 +35,17 @@ "200": { "headers": {}, "body": { - "createdUpdateDateTime": "2020-10-01T15-01-03.45Z", + "createdDateTime": "2020-10-01T15:01:03Z", "displayName": "Extracting Location & US Region", - "expirationDateTime": "2020-10-03T15-01-03.55Z", + "expirationDateTime": "2020-10-03T15:01:03Z", "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", - "lastUpdateDateTime": "2020-10-01T15-01-03.55Z", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", "status": "succeeded", "tasks": { "completed": 2, "details": [ { - "lastUpdateDateTime": "2020-10-01T15-01-03.53Z", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", "name": "Recognize Entities", "results": { "documents": [ @@ -109,12 +109,28 @@ "type": "Recognize Entities" }, { - "lastUpdateDateTime": "2020-10-01T15-01-03.55Z", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", "name": "Custom Classification 71baed8c-a832-489d-8f38-e3b44685785f/USRegionClassifier", - "results": null, + "results": { + "documents": [{ + "id": "1", + "classifications": [{ + "name": "NorthWest", + "confidenceScore": 0.88 + }] + }, + { + "id": "2", + "classifications": [{ + "name": "NorthEast", + "confidenceScore": 0.94 + }] + }], + "errors": [], + "resultType": "CustomClassification" + }, "status": "succeeded", - "type": "Custom Classification", - "resultType": "CustomClassification" + "type": "Custom Classification" } ], "failed": 0, diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json index af2ada8ff77f..b3c6dcb0d50a 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json @@ -1,16 +1,17 @@ { "parameters": { "Ocp-Apim-Subscription-Key": "{API key}", - "Endpoint": "{Endpoint}" + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}" }, "responses": { "200": { "headers": {}, "body": { - "createdUpdateDateTime": "2020-10-01T15-01-03.45Z", - "expirationDateTime": "2020-10-03T15-01-03.55Z", + "createdDateTime": "2020-10-01T15:01:03Z", + "expirationDateTime": "2020-10-03T15:01:03Z", "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", - "lastUpdateDateTime": "2020-10-01T15-01-03.55Z", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", "status": "succeeded", "results": { "documents": [ @@ -177,7 +178,8 @@ "source": "#/documents/0/entities/2", "target": "#/documents/0/entities/1" } - ] + ], + "warnings": [] } ], "errors": [], From deaf191e581c6cb8eda09b2a80bcf7e412f1784e Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 16:22:44 -0700 Subject: [PATCH 24/54] Adding x-ms-parameter-location to global parameters --- .../preview/v3.1-preview.1/TextAnalytics.json | 12 ++++++++---- .../preview/v3.2-preview.1/TextAnalytics.json | 15 ++++++++++----- 2 files changed, 18 insertions(+), 9 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 ff9fc19145ae..b54d933b7aeb 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 @@ -1353,21 +1353,24 @@ "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 + "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 + "required": false, + "x-ms-parameter-location": "method" }, "MultiLanguageInput": { "in": "body", @@ -1376,7 +1379,8 @@ "required": true, "schema": { "$ref": "#/definitions/MultiLanguageBatchInput" - } + }, + "x-ms-parameter-location": "method" } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 45f9fc0ebaa5..eb6f2928bee6 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -2531,7 +2531,8 @@ "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" }, "JobId": { "description": "Job ID", @@ -2539,21 +2540,24 @@ "in": "path", "name": "jobId", "required": true, - "type": "string" + "type": "string", + "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 + "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 + "required": false, + "x-ms-parameter-location": "method" }, "MultiLanguageInput": { "in": "body", @@ -2562,7 +2566,8 @@ "required": true, "schema": { "$ref": "#/definitions/MultiLanguageBatchInput" - } + }, + "x-ms-parameter-location": "method" } } } From 5ba59c0631fde9d0fc4ff77cdf8d83b9a0fe51c8 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Fri, 24 Jul 2020 17:45:01 -0700 Subject: [PATCH 25/54] CustomEntity confirms to TA batch --- .../preview/v3.2-preview.1/TextAnalytics.json | 81 +++++++++---------- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index eb6f2928bee6..3d5cdc5a914d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -1057,18 +1057,30 @@ } } }, - "CustomEntities": { - "items": { - "$ref": "#/definitions/CustomEntity" - }, - "type": "array" + "CustomEntitiesDocument": { + "type": "object", + "required": [ + "id", + "entities" + ], + "properties": { + "id": { + "type": "string" + }, + "entities": { + "items": { + "$ref": "#/definitions/CustomEntity" + }, + "type": "array" + } + } }, "CustomEntitiesResult": { "properties": { "documents": { "description": "Response by document", "items": { - "$ref": "#/definitions/CustomEntities" + "$ref": "#/definitions/CustomEntitiesDocument" }, "type": "array" }, @@ -1123,45 +1135,30 @@ ] }, "CustomEntity": { - "properties": { - "category": { - "example": "address", - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/Entity" }, - "children": { - "example": [ - { - "category": "city", - "confidenceScore": 0.78, - "length": 3, - "offset": 5 + { + "type": "object", + "properties": { + "children": { + "example": [ + { + "category": "city", + "confidenceScore": 0.78, + "length": 3, + "offset": 5 + } + ], + "items": { + "$ref": "#/definitions/CustomEntity" + }, + "type": "array" } - ], - "items": { - "$ref": "#/definitions/CustomEntity" - }, - "type": "array" - }, - "confidenceScore": { - "example": 0.96, - "type": "number" - }, - "length": { - "example": 7, - "type": "number" - }, - "offset": { - "example": 3, - "type": "number" + } } - }, - "required": [ - "category", - "offset", - "length", - "confidenceScore" - ], - "type": "object" + ] }, "SentimentResponse": { "type": "object", From 94dc3219976962887a8f7c6bcc5c91e4a99273a3 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Sun, 26 Jul 2020 21:36:17 -0700 Subject: [PATCH 26/54] Changing back to 202 RC on LRO --- .../TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json | 4 ++-- .../v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json | 2 +- .../v3.2-preview.1/examples/SuccessfulHealthRequest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 3d5cdc5a914d..1e3774fb9b04 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -56,7 +56,7 @@ } ], "responses": { - "204": { + "202": { "description": "A successful call results with an Operation-Location header used to check the status of the analysis job.", "headers": { "Operation-Location": { @@ -274,7 +274,7 @@ } ], "responses": { - "204": { + "202": { "description": "Accepted - call results in a link where the status of the submitted job can be checked via the GET operation.", "headers": { "Operation-Location": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json index 865e0c8bdb1a..c002e6b4e0b8 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -32,7 +32,7 @@ } }, "responses": { - "204": { + "202": { "headers": { "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/analyze/jobs/{jobId}" } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json index 6323dee2e7cd..f63e04afd7fc 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json @@ -14,7 +14,7 @@ } }, "responses": { - "204": { + "202": { "headers": { "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" } From 363ea399ec5583975e808cc2fb4e623759b5261e Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Tue, 28 Jul 2020 13:29:15 -0700 Subject: [PATCH 27/54] Flipping delete and get operation order --- .../preview/v3.2-preview.1/TextAnalytics.json | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 1e3774fb9b04..4766a2d1ea5a 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -148,26 +148,41 @@ } }, "/entities/healthcare/jobs/{jobId}": { - "delete": { + "get": { "produces": [ "application/json", "text/json" ], - "description": "Cancel healthcare prediction job.", - "operationId": "CancelHealthJob", - "summary": "Cancel healthcare prediction job", + "description": "Get details of the healthcare prediction job specified by the jobId.", + "operationId": "HealthStatus", + "summary": "Get healthcare analysis job status and results", "parameters": [ { "$ref": "#/parameters/JobId" + }, + { + "in": "query", + "name": "$skip", + "type": "number", + "description": "Skip the $skip entries in the collection. When both $top and $skip are supplied, $skip is applied first.", + "required": false + }, + { + "in": "query", + "name": "$top", + "type": "number", + "description": "Take the $top entries in the collection. When both $top and $skip are supplied, $skip is applied first.", + "required": false + }, + { + "$ref": "#/parameters/ShowStats" } ], "responses": { - "204": { - "description": "Cancel Job request has been received.", - "headers": { - "Operation-Location": { - "type": "string" - } + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/HealthcareJobState" } }, "404": { @@ -185,47 +200,31 @@ }, "x-ms-examples": { "Successful Health request": { - "$ref": ".//examples//SuccessfulHealthDeleteRequest.json" + "$ref": ".//examples//SuccessfulHealthStatusRequest.json" } }, - "deprecated": false, - "x-ms-long-running-operation": true + "deprecated": false }, - "get": { + "delete": { "produces": [ "application/json", "text/json" ], - "description": "Get details of the healthcare prediction job specified by the jobId.", - "operationId": "HealthStatus", - "summary": "Get healthcare analysis job status and results", + "description": "Cancel healthcare prediction job.", + "operationId": "CancelHealthJob", + "summary": "Cancel healthcare prediction job", "parameters": [ { "$ref": "#/parameters/JobId" - }, - { - "in": "query", - "name": "$skip", - "type": "number", - "description": "Skip the $skip entries in the collection. When both $top and $skip are supplied, $skip is applied first.", - "required": false - }, - { - "in": "query", - "name": "$top", - "type": "number", - "description": "Take the $top entries in the collection. When both $top and $skip are supplied, $skip is applied first.", - "required": false - }, - { - "$ref": "#/parameters/ShowStats" } ], "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/HealthcareJobState" + "204": { + "description": "Cancel Job request has been received.", + "headers": { + "Operation-Location": { + "type": "string" + } } }, "404": { @@ -243,10 +242,11 @@ }, "x-ms-examples": { "Successful Health request": { - "$ref": ".//examples//SuccessfulHealthStatusRequest.json" + "$ref": ".//examples//SuccessfulHealthDeleteRequest.json" } }, - "deprecated": false + "deprecated": false, + "x-ms-long-running-operation": true } }, "/entities/healthcare/jobs": { From 4e636285978927fec64cc4f2ea5a0ef85168daab Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Tue, 28 Jul 2020 13:54:04 -0700 Subject: [PATCH 28/54] PHI description + analyze state creation date update --- .../preview/v3.2-preview.1/TextAnalytics.json | 7 +++++-- .../examples/SuccessfulAnalyzeStatusRequest.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 4766a2d1ea5a..bc8fb0d4e8b2 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -382,7 +382,7 @@ { "name": "domain", "in": "query", - "description": "(Optional) if set to 'PHI', response will contain only PHI entities.", + "description": "(Optional) if specified, will set the PII domain to include only a subset of the entity categories. Possible values include: 'PHI', 'none'.", "type": "string" }, { @@ -2129,7 +2129,10 @@ "notstarted", "running", "succeeded", - "failed" + "failed", + "cancelled", + "cancelling", + "partiallycompleted" ], "type": "string", "x-ms-enum": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json index d9516a2c8f44..444ba737adbd 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -35,7 +35,7 @@ "200": { "headers": {}, "body": { - "createdDateTime": "2020-10-01T15:01:03Z", + "createdDateTime": "2020-10-01T15:00:45Z", "displayName": "Extracting Location & US Region", "expirationDateTime": "2020-10-03T15:01:03Z", "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", From ea679e7810379e849fdd23363b2ebba373935fcb Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Tue, 28 Jul 2020 14:34:05 -0700 Subject: [PATCH 29/54] Adding descriptions to healthcare entities + example updates --- .../preview/v3.2-preview.1/TextAnalytics.json | 44 ++++++++++++------- .../examples/SuccessfulAnalyzeRequest.json | 2 +- .../SuccessfulAnalyzeStatusRequest.json | 29 +----------- 3 files changed, 29 insertions(+), 46 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index bc8fb0d4e8b2..e8ab82afa368 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -104,7 +104,7 @@ }, { "default": 20, - "description": "(Optional) Set the maximum number of results per task.", + "description": "(Optional) Set the maximum number of results per task. When both $top and $skip are specified, $skip is applied first.", "in": "query", "maximum": 50, "minimum": 1, @@ -112,7 +112,8 @@ "type": "integer" }, { - "description": "(Optional) Set the number of elements to offset in the response.", + "default": 0, + "description": "(Optional) Set the number of elements to offset in the response. When both $top and $skip are specified, $skip is applied first.", "in": "query", "minimum": 0, "name": "$skip", @@ -161,18 +162,21 @@ "$ref": "#/parameters/JobId" }, { + "default": 20, + "description": "(Optional) Set the maximum number of results per task. When both $top and $skip are specified, $skip is applied first.", "in": "query", - "name": "$skip", - "type": "number", - "description": "Skip the $skip entries in the collection. When both $top and $skip are supplied, $skip is applied first.", - "required": false + "maximum": 50, + "minimum": 1, + "name": "$top", + "type": "integer" }, { + "default": 0, + "description": "(Optional) Set the number of elements to offset in the response. When both $top and $skip are specified, $skip is applied first.", "in": "query", - "name": "$top", - "type": "number", - "description": "Take the $top entries in the collection. When both $top and $skip are supplied, $skip is applied first.", - "required": false + "minimum": 0, + "name": "$skip", + "type": "integer" }, { "$ref": "#/parameters/ShowStats" @@ -252,7 +256,7 @@ "/entities/healthcare/jobs": { "post": { "summary": "Submit healthcare analysis job", - "description": "The API returns a list of recognized healthcare entities and relations for each valid document.", + "description": "Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions, symptoms, etc) and their relations.", "operationId": "Health", "consumes": [ "application/json", @@ -1236,7 +1240,9 @@ "notstarted", "running", "succeeded", - "failed" + "failed", + "cancelled", + "cancelling" ], "type": "string", "x-ms-enum": { @@ -1274,15 +1280,15 @@ "properties": { "tasks": { "properties": { - "completed": { - "type": "integer" - }, "details": { "items": { "$ref": "#/definitions/TaskState" }, "type": "array" }, + "completed": { + "type": "integer" + }, "failed": { "type": "integer" }, @@ -1935,7 +1941,7 @@ "description": "Unique, non-empty document identifier." }, "entities": { - "description": "Gets or sets the list of recognized health entities in document.", + "description": "Healthcare entities.", "type": "array", "items": { "$ref": "#/definitions/HealthcareEntity" @@ -1943,6 +1949,7 @@ }, "relations": { "type": "array", + "description": "Healthcare entity relations.", "items": { "$ref": "#/definitions/HealthcareRelation" } @@ -1994,6 +2001,7 @@ ], "properties": { "relationType": { + "description": "Type of relation. Examples include: `DosageOfMedication` or 'FrequencyOfMedication', etc.", "type": "string" }, "bidirectional": { @@ -2001,9 +2009,11 @@ "type": "boolean" }, "source": { + "description": "Reference link to the source entity.", "type": "string" }, "target": { + "description": "Reference link to the target entity.", "type": "string" } } @@ -2020,7 +2030,7 @@ "type": "string" }, "id": { - "description": "Entity id in the given source catalog. Example: blood pressure - source: umls, concept_id: C1272641.", + "description": "Entity id in the given source catalog.", "type": "string" } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json index c002e6b4e0b8..466f6243fc32 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -19,7 +19,7 @@ ], "tasks": [ { - "type": "EntityRecognitionTask" + "type": "EntitiesTask" }, { "parameters": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json index 444ba737adbd..8e2de936504b 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -2,34 +2,7 @@ "parameters": { "Ocp-Apim-Subscription-Key": "{API key}", "Endpoint": "{Endpoint}", - "jobId": "{Job ID}", - "input": { - "displayName": "Extracting Location & US Region", - "documents": [ - { - "id": "1", - "language": "en", - "text": "I had a wonderful trip to Seattle last week." - }, - { - "id": "2", - "language": "en", - "text": "I'm flying to NYC tomorrow. See you there." - } - ], - "tasks": [ - { - "type": "EntityRecognitionTask" - }, - { - "parameters": { - "appId": "71baed8c-a832-489d-8f38-e3b44685785f", - "slotName": "USRegionClassifier" - }, - "type": "CustomClassificationTask" - } - ] - } + "jobId": "{Job ID}" }, "responses": { "200": { From 07c1279db26ac3f3c9d818f1f95774cb25f27936 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Thu, 6 Aug 2020 16:58:30 -0700 Subject: [PATCH 30/54] Removing polymorph types on /analyze --- .../preview/v3.2-preview.1/TextAnalytics.json | 335 +++++++++++------- .../examples/SuccessfulAnalyzeRequest.json | 33 +- .../SuccessfulAnalyzeStatusRequest.json | 34 +- 3 files changed, 237 insertions(+), 165 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index e8ab82afa368..679ff5ccc49b 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -646,14 +646,55 @@ } }, "definitions": { - "AnalysisTasks": { + "JobManifest": { "properties": { "tasks": { "description": "The set of tasks to execute on the input documents. Cannot specify the same task more than once.", - "items": { - "$ref": "#/definitions/TextAnalyticsTask" + "properties": { + "entityRecognitionTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/EntitiesTask" + } + }, + "entityRecognitionPiiTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/PiiTask" + } + }, + "entityLinkingTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityLinkingTask" + } + }, + "keyPhraseExtractionTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/KeyPhrasesTask" + } + }, + "sentimentAnalysisTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/SentimentTask" + } + }, + "customClassificationTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomClassificationTask" + } + }, + "customEntityRecognitionTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomEntitiesTask" + } + } }, - "type": "array" + "type": "object" } }, "required": [ @@ -773,29 +814,17 @@ } } }, - "TextAnalyticsResult": { - "discriminator": "resultType", - "properties": { - "resultType": { - "type": "string" - } - }, - "required": [ - "resultType" - ], - "type": "object" - }, "TextAnalyticsTask": { - "discriminator": "type", - "properties": { - "type": { - "type": "string" - } - }, + "type": "object", "required": [ - "type" + "enable" ], - "type": "object" + "properties": { + "enable": { + "default": false, + "type": "boolean" + } + } }, "TextAnalyticsWarning": { "type": "object", @@ -865,18 +894,18 @@ }, { "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" + } }, - "stringIndexType": { - "$ref": "#/definitions/StringIndexType" - } - }, - "type": "object" - } + "type": "object" + } }, "type": "object" } @@ -935,10 +964,19 @@ "$ref": "#/definitions/JobDescriptor" }, { - "$ref": "#/definitions/MultiLanguageBatchInput" + "type": "object", + "required": [ + "analysisInput" + ], + "properties": { + "analysisInput": + { + "$ref": "#/definitions/MultiLanguageBatchInput" + } + } }, { - "$ref": "#/definitions/AnalysisTasks" + "$ref": "#/definitions/JobManifest" } ] }, @@ -1249,23 +1287,6 @@ "modelAsString": false, "name": "State" } - }, - "type": { - "enum": [ - "Detect Language", - "Extract Key Phrases", - "Analyze Sentiment", - "Recognize Linked Entities", - "Recognize Entities", - "Recognize PII Entities", - "Custom Classification", - "Custom Entities" - ], - "type": "string", - "x-ms-enum": { - "modelAsString": false, - "name": "State" - } } }, "required": [ @@ -1297,14 +1318,139 @@ }, "total": { "type": "integer" + }, + "entityRecognitionTasks": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/EntitiesResult" + } + } + } + ] + } + }, + "entityRecognitionPiiTasks": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/PiiResult" + } + } + } + ] + } + }, + "entityLinkingTasks": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/EntityLinkingResult" + } + } + } + ] + } + }, + "keyPhraseExtractionTasks": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/KeyPhraseResult" + } + } + } + ] + } + }, + "sentimentAnalysisTasks": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/SentimentResponse" + } + } + } + ] + } + }, + "customClassificationTasks": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/CustomClassificationResult" + } + } + } + ] + } + }, + "customEntityRecognitionTasks": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/CustomEntitiesResult" + } + } + } + ] + } } }, "required": [ "total", "completed", "failed", - "inProgress", - "details" + "inProgress" ], "type": "object" } @@ -2398,83 +2544,6 @@ } } }, - "TypedCustomClassificationResult": { - "x-ms-discriminator-value": "CustomClassification", - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/CustomClassificationResult" - } - ] - }, - "TypedCustomEntitiesResult": { - "x-ms-discriminator-value": "CustomEntityRecognition", - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/CustomEntitiesResult" - } - ] - }, - "TypedEntitiesResult": { - "x-ms-discriminator-value": "EntityRecognition", - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/EntitiesResult" - } - ] - }, - "TypedEntityLinkingResult": { - "x-ms-discriminator-value": "EntityLinking", - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/EntityLinkingResult" - } - ] - }, - "TypedKeyPhraseResult": { - "x-ms-discriminator-value": "KeyPhrasesExtraction", - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/KeyPhraseResult" - } - ] - }, - "TypedPiiResult": { - "x-ms-discriminator-value": "PiiEntityRecognition", - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/PiiResult" - } - ] - }, - "TypedSentimentResponse": { - "x-ms-discriminator-value": "SentimentAnalysis", - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsResult" - }, - { - "$ref": "#/definitions/SentimentResponse" - } - ] - }, "StringIndexType": { "default": "TextElements_v8", "enum": [ diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json index 466f6243fc32..e43ae62b0e46 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -5,7 +5,8 @@ "jobId": "{Job ID}", "input": { "displayName": "Extracting Location & US Region", - "documents": [ + "analysisInput": { + "documents": [ { "id": "1", "language": "en", @@ -16,19 +17,23 @@ "language": "en", "text": "I'm flying to NYC tomorrow. See you there." } - ], - "tasks": [ - { - "type": "EntitiesTask" - }, - { - "parameters": { - "appId": "71baed8c-a832-489d-8f38-e3b44685785f", - "slotName": "USRegionClassifier" - }, - "type": "CustomClassificationTask" - } - ] + ] + }, + "tasks": { + "entityRecognitionTasks": [{ + "enable": true, + "parameters": { + "model-version": "latest" + } + }], + "customClassificationTasks": [{ + "enable": true, + "parameters": { + "appId": "71baed8c-a832-489d-8f38-e3b44685785f", + "slotName": "USRegionClassifier" + } + }] + } } }, "responses": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json index 8e2de936504b..28de8f2cc0cb 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -16,10 +16,14 @@ "status": "succeeded", "tasks": { "completed": 2, - "details": [ + "failed": 0, + "inProgress": 0, + "total": 2, + "entityRecognitionTasks": [ { + "name": "Recognize Entities (2020-04-01)", "lastUpdateDateTime": "2020-10-01T15:01:03Z", - "name": "Recognize Entities", + "status": "succeeded", "results": { "documents": [ { @@ -75,15 +79,15 @@ } ], "errors": [], - "modelVersion": "2020-04-01", - "resultType": "EntityRecognition" - }, - "status": "succeeded", - "type": "Recognize Entities" - }, + "modelVersion": "2020-04-01" + } + } + ], + "customClassificationTasks": [ { - "lastUpdateDateTime": "2020-10-01T15:01:03Z", "name": "Custom Classification 71baed8c-a832-489d-8f38-e3b44685785f/USRegionClassifier", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", + "status": "succeeded", "results": { "documents": [{ "id": "1", @@ -99,16 +103,10 @@ "confidenceScore": 0.94 }] }], - "errors": [], - "resultType": "CustomClassification" - }, - "status": "succeeded", - "type": "Custom Classification" + "errors": [] + } } - ], - "failed": 0, - "inProgress": 0, - "total": 2 + ] } } }, From ccc08ed95084f2ef8cc05b08594120014e6cfda2 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Tue, 11 Aug 2020 13:04:15 -0700 Subject: [PATCH 31/54] Removing TextAnalyticsResult ref --- .../TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 679ff5ccc49b..c7aa6648491c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -1270,9 +1270,6 @@ "name": { "type": "string" }, - "results": { - "$ref": "#/definitions/TextAnalyticsResult" - }, "status": { "enum": [ "notstarted", From 46755ff4c806c031b68f9efe6cc78a2403b75840 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Wed, 12 Aug 2020 11:48:48 -0700 Subject: [PATCH 32/54] Removing left-over type property from task results --- .../TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index c7aa6648491c..eadadcb34d7c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -1279,7 +1279,6 @@ "cancelled", "cancelling" ], - "type": "string", "x-ms-enum": { "modelAsString": false, "name": "State" @@ -1288,7 +1287,6 @@ }, "required": [ "name", - "type", "status", "lastUpdateDateTime" ], From 3ec491a186726aa7e47d60f29774fb82ea308ac7 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Tue, 22 Sep 2020 09:45:29 -0700 Subject: [PATCH 33/54] Update TextAnalytics.json --- .../preview/v3.2-preview.1/TextAnalytics.json | 74 +++++++++++++------ 1 file changed, 50 insertions(+), 24 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index e4a9b0eeaeba..a10b2f84d371 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -68,13 +68,15 @@ "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -131,13 +133,15 @@ "description": "Job ID not found.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -148,7 +152,7 @@ "deprecated": false } }, - "/entities/healthcare/jobs/{jobId}": { + "/entities/health/jobs/{jobId}": { "get": { "produces": [ "application/json", @@ -193,13 +197,15 @@ "description": "Job ID not found.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -235,13 +241,15 @@ "description": "Job ID not found.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -253,7 +261,7 @@ "x-ms-long-running-operation": true } }, - "/entities/healthcare/jobs": { + "/entities/health/jobs": { "post": { "summary": "Submit healthcare analysis job", "description": "Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions, symptoms, etc) and their relations.", @@ -290,13 +298,15 @@ "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -346,13 +356,15 @@ "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -407,13 +419,15 @@ "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -462,13 +476,15 @@ "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -514,13 +530,15 @@ "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -566,13 +584,15 @@ "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -627,13 +647,15 @@ "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -2212,6 +2234,10 @@ "dataSource": { "type": "string", "description": "Data source used to extract entity linking, such as Wiki/Bing etc." + }, + "bingId": { + "type": "string", + "description": "Bing Entity Search API unique identifier of the recognized entity." } } }, From 9146c425a4e87f328a7088619eeac24d8fc72468 Mon Sep 17 00:00:00 2001 From: Assaf Israel Date: Wed, 23 Sep 2020 09:45:13 -0700 Subject: [PATCH 34/54] Moving redacted text to the document level instead of entity level --- .../preview/v3.1-preview.2/TextAnalytics.json | 12 ++++---- .../preview/v3.2-preview.1/TextAnalytics.json | 29 +++++-------------- .../examples/SuccessfulAnalyzeRequest.json | 2 +- .../examples/SuccessfulEntityPIIRequest.json | 12 ++++---- 4 files changed, 21 insertions(+), 34 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 fcb470b19c05..51298697016f 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 @@ -975,15 +975,19 @@ "type": "object", "required": [ "id", + "redactedText", "entities", - "warnings", - "redactedText" + "warnings" ], "properties": { "id": { "type": "string", "description": "Unique, non-empty document identifier." }, + "redactedText": { + "type": "string", + "description": "Returns redacted text." + }, "entities": { "type": "array", "description": "Recognized entities in the document.", @@ -1001,10 +1005,6 @@ "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." } } }, diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index a10b2f84d371..3a14e77685ef 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -1865,10 +1865,11 @@ } } }, - "DocumentPiiEntities": { + "PiiDocumentEntities": { "type": "object", "required": [ "id", + "redactedText", "entities", "warnings" ], @@ -1877,11 +1878,15 @@ "type": "string", "description": "Unique, non-empty document identifier." }, + "redactedText": { + "type": "string", + "description": "Returns redacted text." + }, "entities": { "type": "array", "description": "Recognized entities in the document.", "items": { - "$ref": "#/definitions/PiiEntity" + "$ref": "#/definitions/Entity" } }, "warnings": { @@ -1936,24 +1941,6 @@ } } }, - "PiiEntity": { - "allOf": [ - { - "$ref": "#/definitions/Entity" - }, - { - "type": "object", - "required": [ - "redactedText" - ], - "properties": { - "redactedText": { - "type": "string" - } - } - } - ] - }, "EntityLinkingResult": { "type": "object", "required": [ @@ -2463,7 +2450,7 @@ "type": "array", "description": "Response by document", "items": { - "$ref": "#/definitions/DocumentPiiEntities" + "$ref": "#/definitions/PiiDocumentEntities" } }, "errors": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json index e43ae62b0e46..df53d615fad2 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -30,7 +30,7 @@ "enable": true, "parameters": { "appId": "71baed8c-a832-489d-8f38-e3b44685785f", - "slotName": "USRegionClassifier" + "slotName": "Production" } }] } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json index d07170bdba7f..d125525bda91 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -28,45 +28,45 @@ "body": { "documents": [ { + "id": "1", + "redactedText": "My SSN is ***********", "entities": [ { "category": "U.S. Social Security Number (SSN)", "confidenceScore": 0.65, "length": 11, "offset": 28, - "redactedText": "My SSN is ***********", "text": "859-98-0987" } ], - "id": "1", "warnings": [] }, { + "id": "2", + "redactedText": "Your ABA number - ********* - is the first 9 digits in the lower left hand corner of your personal check.", "entities": [ { "category": "ABA Routing Number", "confidenceScore": 0.75, "length": 9, "offset": 18, - "redactedText": "Your ABA number - ********* - is the first 9 digits in the lower left hand corner of your personal check.", "text": "111000025" } ], - "id": "2", "warnings": [] }, { + "id": "3", + "redactedText": "Is ************** your Brazilian CPF number?", "entities": [ { "category": "Brazil CPF Number", "confidenceScore": 0.85, "length": 14, "offset": 3, - "redactedText": "Is ************** your Brazilian CPF number?", "text": "998.214.865-68" } ], - "id": "3", "warnings": [] } ], From 4ef416bbfc5d7385c5c4f9e324b0ec14b7d20071 Mon Sep 17 00:00:00 2001 From: Abigail Hahn Date: Tue, 6 Oct 2020 10:45:44 -0700 Subject: [PATCH 35/54] Changed 204 response to 202 for Healthcare job deletion --- .../TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 3a14e77685ef..a516352f480b 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -229,7 +229,7 @@ } ], "responses": { - "204": { + "202": { "description": "Cancel Job request has been received.", "headers": { "Operation-Location": { From 23c8df3c4c76fd653ddf92b60979c383d9073386 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Tue, 6 Oct 2020 14:16:43 -0700 Subject: [PATCH 36/54] fix breaking changes and swagger lint --- cSpell.json | 6 +- .../preview/v3.1-preview.1/TextAnalytics.json | 60 ++++--------------- .../examples/SuccessfulEntitiesRequest.json | 22 ------- .../SuccessfulEntityLinkingRequest.json | 22 ------- .../examples/SuccessfulEntityPIIRequest.json | 22 ------- .../examples/SuccessfulKeyPhrasesRequest.json | 22 ------- .../examples/SuccessfulLanguagesRequest.json | 45 ++++---------- .../examples/SuccessfulSentimentRequest.json | 22 ------- 8 files changed, 28 insertions(+), 193 deletions(-) diff --git a/cSpell.json b/cSpell.json index 207203bfb932..812af914757d 100644 --- a/cSpell.json +++ b/cSpell.json @@ -2,7 +2,9 @@ "version": "0.1", "language": "en", "words": [ - "Creds" + "Creds", + "partiallycompleted", + "umls" ], "dictionaryDefinitions": [ { @@ -715,4 +717,4 @@ ] } ] -} +} \ No newline at end of file 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 019e5137443e..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 @@ -66,14 +66,8 @@ "$ref": "#/definitions/EntitiesResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", + "default": { + "description": "Error Response", "schema": { "$ref": "#/definitions/ErrorResponse" } @@ -127,14 +121,8 @@ "$ref": "#/definitions/EntitiesResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", + "default": { + "description": "Error Response", "schema": { "$ref": "#/definitions/ErrorResponse" } @@ -182,14 +170,8 @@ "$ref": "#/definitions/EntityLinkingResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", + "default": { + "description": "Error Response", "schema": { "$ref": "#/definitions/ErrorResponse" } @@ -234,14 +216,8 @@ "$ref": "#/definitions/KeyPhraseResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", + "default": { + "description": "Error Response", "schema": { "$ref": "#/definitions/ErrorResponse" } @@ -286,14 +262,8 @@ "$ref": "#/definitions/LanguageResult" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", + "default": { + "description": "Error Response", "schema": { "$ref": "#/definitions/ErrorResponse" } @@ -347,14 +317,8 @@ "$ref": "#/definitions/SentimentResponse" } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - }, - "500": { - "description": "Internal error response", + "default": { + "description": "Error Response", "schema": { "$ref": "#/definitions/ErrorResponse" } 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 b1077b92db58..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 @@ -5,6 +5,7 @@ "input": { "documents": [ { + "countryHint": "US", "id": "1", "text": "Hello world" }, @@ -14,7 +15,7 @@ }, { "id": "3", - "text": "Hola mundo" + "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer." } ] } @@ -25,57 +26,35 @@ "body": { "documents": [ { + "id": "1", "detectedLanguage": { - "confidenceScore": 1, + "name": "English", "iso6391Name": "en", - "name": "English" + "confidenceScore": 1 }, - "id": "1", "warnings": [] }, { + "id": "2", "detectedLanguage": { - "confidenceScore": 1, + "name": "French", "iso6391Name": "fr", - "name": "French" + "confidenceScore": 1 }, - "id": "2", "warnings": [] }, { + "id": "3", "detectedLanguage": { - "confidenceScore": 1, + "name": "Spanish", "iso6391Name": "es", - "name": "Spanish" + "confidenceScore": 1 }, - "id": "3", "warnings": [] } ], "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" - } + "modelVersion": "2019-10-01" } } } 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" - } - } } } } From bafc27ea426c181587f7488b09ed0050e82d1c76 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Tue, 6 Oct 2020 14:46:14 -0700 Subject: [PATCH 37/54] fix prettier --- .../preview/v3.2-preview.1/TextAnalytics.json | 83 ++-- .../examples/SuccessfulAnalyzeRequest.json | 128 +++--- .../SuccessfulAnalyzeStatusRequest.json | 264 +++++------ .../examples/SuccessfulEntitiesRequest.json | 2 +- .../SuccessfulHealthDeleteRequest.json | 62 +-- .../examples/SuccessfulHealthRequest.json | 78 ++-- .../SuccessfulHealthStatusRequest.json | 410 +++++++++--------- 7 files changed, 518 insertions(+), 509 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index a516352f480b..fbd3f0e4f64d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -69,14 +69,14 @@ "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -134,14 +134,14 @@ "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -198,14 +198,14 @@ "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -242,14 +242,14 @@ "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -298,15 +298,15 @@ "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - }, - "x-ms-error-response": true + }, + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -357,14 +357,14 @@ "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -420,14 +420,14 @@ "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -477,14 +477,14 @@ "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -531,14 +531,14 @@ "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -585,14 +585,14 @@ "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -648,14 +648,14 @@ "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true }, "500": { "description": "Internal error response", "schema": { "$ref": "#/definitions/ErrorResponse" }, - "x-ms-error-response": true + "x-ms-error-response": true } }, "x-ms-examples": { @@ -842,10 +842,10 @@ "enable" ], "properties": { - "enable": { - "default": false, - "type": "boolean" - } + "enable": { + "default": false, + "type": "boolean" + } } }, "TextAnalyticsWarning": { @@ -916,18 +916,18 @@ }, { "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - }, - "stringIndexType": { - "$ref": "#/definitions/StringIndexType" - } + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" }, - "type": "object" - } + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" + } + }, + "type": "object" + } }, "type": "object" } @@ -991,8 +991,7 @@ "analysisInput" ], "properties": { - "analysisInput": - { + "analysisInput": { "$ref": "#/definitions/MultiLanguageBatchInput" } } @@ -2221,8 +2220,8 @@ "dataSource": { "type": "string", "description": "Data source used to extract entity linking, such as Wiki/Bing etc." - }, - "bingId": { + }, + "bingId": { "type": "string", "description": "Bing Entity Search API unique identifier of the recognized entity." } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json index df53d615fad2..16d619927137 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -1,68 +1,72 @@ { - "parameters": { - "Ocp-Apim-Subscription-Key": "{API key}", - "Endpoint": "{Endpoint}", - "jobId": "{Job ID}", - "input": { - "displayName": "Extracting Location & US Region", - "analysisInput": { - "documents": [ - { - "id": "1", - "language": "en", - "text": "I had a wonderful trip to Seattle last week." - }, - { - "id": "2", - "language": "en", - "text": "I'm flying to NYC tomorrow. See you there." - } - ] - }, - "tasks": { - "entityRecognitionTasks": [{ - "enable": true, - "parameters": { - "model-version": "latest" - } - }], - "customClassificationTasks": [{ - "enable": true, - "parameters": { - "appId": "71baed8c-a832-489d-8f38-e3b44685785f", - "slotName": "Production" - } - }] - } - } - }, - "responses": { - "202": { - "headers": { - "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/analyze/jobs/{jobId}" - } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Invalid Request.", - "innererror": { - "code": "MissingInputRecords", - "message": "Missing input records." - } - } - } + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}", + "input": { + "displayName": "Extracting Location & US Region", + "analysisInput": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "I had a wonderful trip to Seattle last week." }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } + { + "id": "2", + "language": "en", + "text": "I'm flying to NYC tomorrow. See you there." + } + ] + }, + "tasks": { + "entityRecognitionTasks": [ + { + "enable": true, + "parameters": { + "model-version": "latest" + } + } + ], + "customClassificationTasks": [ + { + "enable": true, + "parameters": { + "appId": "71baed8c-a832-489d-8f38-e3b44685785f", + "slotName": "Production" } } + ] + } + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/analyze/jobs/{jobId}" + } + }, + "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.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json index 28de8f2cc0cb..84a88224664f 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -1,136 +1,142 @@ { - "parameters": { - "Ocp-Apim-Subscription-Key": "{API key}", - "Endpoint": "{Endpoint}", - "jobId": "{Job ID}" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "createdDateTime": "2020-10-01T15:00:45Z", - "displayName": "Extracting Location & US Region", - "expirationDateTime": "2020-10-03T15:01:03Z", - "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", - "lastUpdateDateTime": "2020-10-01T15:01:03Z", - "status": "succeeded", - "tasks": { - "completed": 2, - "failed": 0, - "inProgress": 0, - "total": 2, - "entityRecognitionTasks": [ - { - "name": "Recognize Entities (2020-04-01)", - "lastUpdateDateTime": "2020-10-01T15:01:03Z", - "status": "succeeded", - "results": { - "documents": [ - { - "entities": [ - { - "category": "Event", - "confidenceScore": 0.61, - "length": 4, - "offset": 18, - "text": "trip" - }, - { - "category": "Location", - "confidenceScore": 0.82, - "length": 7, - "offset": 26, - "subcategory": "GPE", - "text": "Seattle" - }, - { - "category": "DateTime", - "confidenceScore": 0.8, - "length": 9, - "offset": 34, - "subcategory": "DateRange", - "text": "last week" - } - ], - "id": "1", - "warnings": [] - }, - { - "entities": [ - { - "category": "Location", - "confidenceScore": 0.52, - "length": 3, - "offset": 14, - "subcategory": "GPE", - "text": "NYC" - }, - { - "category": "DateTime", - "confidenceScore": 0.8, - "length": 8, - "offset": 18, - "subcategory": "Date", - "text": "tomorrow" - } - ], - "id": "2", - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-04-01" - } - } + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "createdDateTime": "2020-10-01T15:00:45Z", + "displayName": "Extracting Location & US Region", + "expirationDateTime": "2020-10-03T15:01:03Z", + "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", + "status": "succeeded", + "tasks": { + "completed": 2, + "failed": 0, + "inProgress": 0, + "total": 2, + "entityRecognitionTasks": [ + { + "name": "Recognize Entities (2020-04-01)", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", + "status": "succeeded", + "results": { + "documents": [ + { + "entities": [ + { + "category": "Event", + "confidenceScore": 0.61, + "length": 4, + "offset": 18, + "text": "trip" + }, + { + "category": "Location", + "confidenceScore": 0.82, + "length": 7, + "offset": 26, + "subcategory": "GPE", + "text": "Seattle" + }, + { + "category": "DateTime", + "confidenceScore": 0.8, + "length": 9, + "offset": 34, + "subcategory": "DateRange", + "text": "last week" + } ], - "customClassificationTasks": [ - { - "name": "Custom Classification 71baed8c-a832-489d-8f38-e3b44685785f/USRegionClassifier", - "lastUpdateDateTime": "2020-10-01T15:01:03Z", - "status": "succeeded", - "results": { - "documents": [{ - "id": "1", - "classifications": [{ - "name": "NorthWest", - "confidenceScore": 0.88 - }] - }, - { - "id": "2", - "classifications": [{ - "name": "NorthEast", - "confidenceScore": 0.94 - }] - }], - "errors": [] - } - } - ] - } - } - }, - "404": { - "headers": {}, - "body": { - "error": { - "code": "NotFound", - "message": "Not Found", - "innererror": { - "code": "JobIdNotFound", - "message": "Job ID not found." - } - } + "id": "1", + "warnings": [] + }, + { + "entities": [ + { + "category": "Location", + "confidenceScore": 0.52, + "length": 3, + "offset": 14, + "subcategory": "GPE", + "text": "NYC" + }, + { + "category": "DateTime", + "confidenceScore": 0.8, + "length": 8, + "offset": 18, + "subcategory": "Date", + "text": "tomorrow" + } + ], + "id": "2", + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-04-01" + } } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } + ], + "customClassificationTasks": [ + { + "name": "Custom Classification 71baed8c-a832-489d-8f38-e3b44685785f/USRegionClassifier", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "1", + "classifications": [ + { + "name": "NorthWest", + "confidenceScore": 0.88 + } + ] + }, + { + "id": "2", + "classifications": [ + { + "name": "NorthEast", + "confidenceScore": 0.94 + } + ] + } + ], + "errors": [] + } } + ] + } + } + }, + "404": { + "headers": {}, + "body": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" } + } } + } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json index 02dd04bfe617..d6c9a0221153 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json @@ -19,7 +19,7 @@ }, "responses": { "200": { - "headers" : {}, + "headers": {}, "body": { "documents": [ { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json index b9831626b22c..383705014761 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json @@ -1,36 +1,36 @@ { - "parameters": { - "Ocp-Apim-Subscription-Key": "{API key}", - "Endpoint": "{Endpoint}", - "jobId": "{Job ID}" + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}" + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" + } }, - "responses": { - "204": { - "headers": { - "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" - } - }, - "404": { - "headers": {}, - "body": { - "error": { - "code": "NotFound", - "message": "Not Found", - "innererror": { - "code": "JobIdNotFound", - "message": "Job ID not found." - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" - } - } + "404": { + "headers": {}, + "body": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } } + } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json index f63e04afd7fc..989b7d60ad85 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json @@ -1,45 +1,45 @@ { - "parameters": { - "Ocp-Apim-Subscription-Key": "{API key}", - "Endpoint": "{Endpoint}", - "jobId": "{Job ID}", - "input": { - "documents": [ - { - "id": "1", - "language": "en", - "text": "Subject is taking 100mg of ibuprofen twice daily." - } - ] + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Subject is taking 100mg of ibuprofen twice daily." } + ] + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" + } }, - "responses": { - "202": { - "headers": { - "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" - } - }, - "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" - } - } + "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.2-preview.1/examples/SuccessfulHealthStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json index b3c6dcb0d50a..00b97c3ce314 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json @@ -1,213 +1,213 @@ { - "parameters": { - "Ocp-Apim-Subscription-Key": "{API key}", - "Endpoint": "{Endpoint}", - "jobId": "{Job ID}" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "createdDateTime": "2020-10-01T15:01:03Z", - "expirationDateTime": "2020-10-03T15:01:03Z", - "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", - "lastUpdateDateTime": "2020-10-01T15:01:03Z", - "status": "succeeded", - "results": { - "documents": [ - { - "id": "1", - "entities": [ - { - "offset": 18, - "length": 5, - "text": "100mg", - "category": "Dosage", - "confidenceScore": 0.99, - "isNegated": false - }, - { - "offset": 27, - "length": 9, - "text": "ibuprofen", - "category": "MedicationName", - "confidenceScore": 1.0, - "isNegated": false, - "links": [ - { - "id": "C0020740", - "dataSource": "UMLS" - }, - { - "id": "0000019879", - "dataSource": "AOD" - }, - { - "id": "M01AE01", - "dataSource": "ATC" - }, - { - "id": "0046165", - "dataSource": "CCPSS" - }, - { - "id": "0000006519", - "dataSource": "CHV" - }, - { - "id": "2270-2077", - "dataSource": "CSP" - }, - { - "id": "DB01050", - "dataSource": "DRUGBANK" - }, - { - "id": "1611", - "dataSource": "GS" - }, - { - "id": "sh97005926", - "dataSource": "LCH_NW" - }, - { - "id": "LP16165-0", - "dataSource": "LNC" - }, - { - "id": "40458", - "dataSource": "MEDCIN" - }, - { - "id": "d00015", - "dataSource": "MMSL" - }, - { - "id": "D007052", - "dataSource": "MSH" - }, - { - "id": "WK2XYI10QM", - "dataSource": "MTHSPL" - }, - { - "id": "C561", - "dataSource": "NCI" - }, - { - "id": "C561", - "dataSource": "NCI_CTRP" - }, - { - "id": "00803", - "dataSource": "NCI_DCP" - }, - { - "id": "NSC0256857", - "dataSource": "NCI_DTP" - }, - { - "id": "WK2XYI10QM", - "dataSource": "NCI_FDA" - }, - { - "id": "CDR0000613511", - "dataSource": "NCI_NCI-GLOSS" - }, - { - "id": "002377", - "dataSource": "NDDF" - }, - { - "id": "CDR0000040475", - "dataSource": "PDQ" - }, - { - "id": "x02MO", - "dataSource": "RCD" - }, - { - "id": "5640", - "dataSource": "RXNORM" - }, - { - "id": "E-7772", - "dataSource": "SNM" - }, - { - "id": "C-603C0", - "dataSource": "SNMI" - }, - { - "id": "387207008", - "dataSource": "SNOMEDCT_US" - }, - { - "id": "m39860", - "dataSource": "USP" - }, - { - "id": "MTHU000060", - "dataSource": "USPMG" - }, - { - "id": "4017840", - "dataSource": "VANDF" - } - ] - }, - { - "offset": 37, - "length": 11, - "text": "twice daily", - "category": "Frequency", - "confidenceScore": 1, - "isNegated": false - } - ], - "relations": [ - { - "relationType": "DosageOfMedication", - "bidirectional": false, - "source": "#/documents/0/entities/0", - "target": "#/documents/0/entities/1" - }, - { - "relationType": "FrequencyOfMedication", - "bidirectional": false, - "source": "#/documents/0/entities/2", - "target": "#/documents/0/entities/1" - } - ], - "warnings": [] - } - ], - "errors": [], - "modelVersion": "2020-05-08" - } - } - }, - "404": { - "headers": {}, - "body": { - "error": { - "code": "NotFound", - "message": "Not Found", - "innererror": { - "code": "JobIdNotFound", - "message": "Job ID not found." + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "createdDateTime": "2020-10-01T15:01:03Z", + "expirationDateTime": "2020-10-03T15:01:03Z", + "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "1", + "entities": [ + { + "offset": 18, + "length": 5, + "text": "100mg", + "category": "Dosage", + "confidenceScore": 0.99, + "isNegated": false + }, + { + "offset": 27, + "length": 9, + "text": "ibuprofen", + "category": "MedicationName", + "confidenceScore": 1.0, + "isNegated": false, + "links": [ + { + "id": "C0020740", + "dataSource": "UMLS" + }, + { + "id": "0000019879", + "dataSource": "AOD" + }, + { + "id": "M01AE01", + "dataSource": "ATC" + }, + { + "id": "0046165", + "dataSource": "CCPSS" + }, + { + "id": "0000006519", + "dataSource": "CHV" + }, + { + "id": "2270-2077", + "dataSource": "CSP" + }, + { + "id": "DB01050", + "dataSource": "DRUGBANK" + }, + { + "id": "1611", + "dataSource": "GS" + }, + { + "id": "sh97005926", + "dataSource": "LCH_NW" + }, + { + "id": "LP16165-0", + "dataSource": "LNC" + }, + { + "id": "40458", + "dataSource": "MEDCIN" + }, + { + "id": "d00015", + "dataSource": "MMSL" + }, + { + "id": "D007052", + "dataSource": "MSH" + }, + { + "id": "WK2XYI10QM", + "dataSource": "MTHSPL" + }, + { + "id": "C561", + "dataSource": "NCI" + }, + { + "id": "C561", + "dataSource": "NCI_CTRP" + }, + { + "id": "00803", + "dataSource": "NCI_DCP" + }, + { + "id": "NSC0256857", + "dataSource": "NCI_DTP" + }, + { + "id": "WK2XYI10QM", + "dataSource": "NCI_FDA" + }, + { + "id": "CDR0000613511", + "dataSource": "NCI_NCI-GLOSS" + }, + { + "id": "002377", + "dataSource": "NDDF" + }, + { + "id": "CDR0000040475", + "dataSource": "PDQ" + }, + { + "id": "x02MO", + "dataSource": "RCD" + }, + { + "id": "5640", + "dataSource": "RXNORM" + }, + { + "id": "E-7772", + "dataSource": "SNM" + }, + { + "id": "C-603C0", + "dataSource": "SNMI" + }, + { + "id": "387207008", + "dataSource": "SNOMEDCT_US" + }, + { + "id": "m39860", + "dataSource": "USP" + }, + { + "id": "MTHU000060", + "dataSource": "USPMG" + }, + { + "id": "4017840", + "dataSource": "VANDF" } + ] + }, + { + "offset": 37, + "length": 11, + "text": "twice daily", + "category": "Frequency", + "confidenceScore": 1, + "isNegated": false } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error" + ], + "relations": [ + { + "relationType": "DosageOfMedication", + "bidirectional": false, + "source": "#/documents/0/entities/0", + "target": "#/documents/0/entities/1" + }, + { + "relationType": "FrequencyOfMedication", + "bidirectional": false, + "source": "#/documents/0/entities/2", + "target": "#/documents/0/entities/1" } + ], + "warnings": [] } + ], + "errors": [], + "modelVersion": "2020-05-08" + } + } + }, + "404": { + "headers": {}, + "body": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" } + } } + } } From 663be6dd5e0aeac1922146616f80ca8d5f2c7125 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Wed, 7 Oct 2020 09:19:25 -0700 Subject: [PATCH 38/54] fix warnings for auto rest --- .../preview/v3.2-preview.1/TextAnalytics.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index fbd3f0e4f64d..c139a2e74726 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -1338,6 +1338,7 @@ "entityRecognitionTasks": { "type": "array", "items": { + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1356,6 +1357,7 @@ "entityRecognitionPiiTasks": { "type": "array", "items": { + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1374,6 +1376,7 @@ "entityLinkingTasks": { "type": "array", "items": { + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1392,6 +1395,7 @@ "keyPhraseExtractionTasks": { "type": "array", "items": { + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1410,6 +1414,7 @@ "sentimentAnalysisTasks": { "type": "array", "items": { + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1428,6 +1433,7 @@ "customClassificationTasks": { "type": "array", "items": { + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1446,6 +1452,7 @@ "customEntityRecognitionTasks": { "type": "array", "items": { + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" From 6391c5a50c4f7bd5b0123bebbfb83c8f9aa14d19 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Wed, 7 Oct 2020 09:44:25 -0700 Subject: [PATCH 39/54] fix healthcareentity --- .../TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index c139a2e74726..5a7ce2ea2e6c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -2124,6 +2124,7 @@ } }, "HealthcareEntity": { + "type": "object", "allOf": [ { "$ref": "#/definitions/Entity" From 437fa132cf88b90a657eef296f529c1d165e6157 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Wed, 7 Oct 2020 10:03:08 -0700 Subject: [PATCH 40/54] fix prettier --- .../preview/v3.2-preview.1/TextAnalytics.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 5a7ce2ea2e6c..9649678ef733 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -1338,7 +1338,7 @@ "entityRecognitionTasks": { "type": "array", "items": { - "type": "object", + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1357,7 +1357,7 @@ "entityRecognitionPiiTasks": { "type": "array", "items": { - "type": "object", + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1376,7 +1376,7 @@ "entityLinkingTasks": { "type": "array", "items": { - "type": "object", + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1395,7 +1395,7 @@ "keyPhraseExtractionTasks": { "type": "array", "items": { - "type": "object", + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1414,7 +1414,7 @@ "sentimentAnalysisTasks": { "type": "array", "items": { - "type": "object", + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1433,7 +1433,7 @@ "customClassificationTasks": { "type": "array", "items": { - "type": "object", + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -1452,7 +1452,7 @@ "customEntityRecognitionTasks": { "type": "array", "items": { - "type": "object", + "type": "object", "allOf": [ { "$ref": "#/definitions/TaskState" @@ -2124,7 +2124,7 @@ } }, "HealthcareEntity": { - "type": "object", + "type": "object", "allOf": [ { "$ref": "#/definitions/Entity" From d05f89f2002b8f50fa344cb3bef5fde7693b0f76 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Wed, 7 Oct 2020 13:07:32 -0700 Subject: [PATCH 41/54] remove 404 and 500 from analyze and health --- .../preview/v3.2-preview.1/TextAnalytics.json | 42 ++++--------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 9649678ef733..dfe5c20aa68a 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -64,19 +64,11 @@ } } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "x-ms-error-response": true - }, - "500": { - "description": "Internal error response", + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", "schema": { "$ref": "#/definitions/ErrorResponse" - }, - "x-ms-error-response": true + } } }, "x-ms-examples": { @@ -129,19 +121,11 @@ "$ref": "#/definitions/AnalyzeJobState" } }, - "404": { - "description": "Job ID not found.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "x-ms-error-response": true - }, - "500": { - "description": "Internal error response", + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", "schema": { "$ref": "#/definitions/ErrorResponse" - }, - "x-ms-error-response": true + } } }, "x-ms-examples": { @@ -294,19 +278,11 @@ } } }, - "400": { - "description": "Bad Request.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - }, - "x-ms-error-response": true - }, - "500": { - "description": "Internal error response", + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", "schema": { "$ref": "#/definitions/ErrorResponse" - }, - "x-ms-error-response": true + } } }, "x-ms-examples": { From cbe97f2312afca959a515078d342874bc2b5a754 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Wed, 7 Oct 2020 15:40:31 -0700 Subject: [PATCH 42/54] add suppression for 202 LongRunningResponseStatusCode --- .../preview/v3.2-preview.1/TextAnalytics.json | 42 +++++++++++++++---- .../data-plane/TextAnalytics/readme.md | 4 ++ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index dfe5c20aa68a..9649678ef733 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -64,11 +64,19 @@ } } }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "400": { + "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -121,11 +129,19 @@ "$ref": "#/definitions/AnalyzeJobState" } }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "404": { + "description": "Job ID not found.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -278,11 +294,19 @@ } } }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "400": { + "description": "Bad Request.", "schema": { "$ref": "#/definitions/ErrorResponse" - } + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true } }, "x-ms-examples": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index 75d88457da7e..a04609d62b7c 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -30,6 +30,10 @@ A preview release `release_2_1_preview` is also available. ``` yaml tag: release_2_1 add-credentials: true + +directive: + - suppress: LongRunningResponseStatusCode + reason: The validation tools do not properly recognize 202 as a supported response code. ``` ### Release 2.0 From 730efd40c293bcfad0f1aa6993345e64fa5d74e2 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Wed, 7 Oct 2020 17:12:00 -0700 Subject: [PATCH 43/54] removing multi api section (deprecated) --- .../data-plane/TextAnalytics/readme.md | 35 ++----------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index a04609d62b7c..4a04a0204ce7 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -88,7 +88,7 @@ input-file: preview/v3.1-preview.1/TextAnalytics.json These settings apply only when `--tag=release_3_1_preview.2` is specified on the command line. -``` yaml $(tag) == 'release_3_1_preview.1' +``` yaml $(tag) == 'release_3_1_preview.2' input-file: preview/v3.1-preview.2/TextAnalytics.json ``` @@ -178,35 +178,4 @@ java: output-folder: $(azure-libraries-for-java-folder)/cognitiveservices/data-plane/language/textanalytics with-optional-parameters: true with-single-async-method: true -``` - -## Multi-API/Profile support for AutoRest v3 generators - -AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. - -This block is updated by an automatic script. Edits may be lost! - -``` yaml $(tag) == 'all-api-versions' /* autogenerated */ -# include the azure profile definitions from the standard location -require: $(this-folder)/../../../../profiles/readme.md - -# all the input files across all versions -input-file: - - $(this-folder)/stable/v2.0/TextAnalytics.json - - $(this-folder)/stable/v2.1/TextAnalytics.json - - $(this-folder)/preview/v2.1/TextAnalytics.json - - $(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 - - $(this-folder)/preview/v3.2-preview.1/TextAnalytics.json - -``` - -If there are files that should not be in the `all-api-versions` set, -uncomment the `exclude-file` section below and add the file paths. - -``` yaml $(tag) == 'all-api-versions' -#exclude-file: -# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json -``` +``` \ No newline at end of file From bfe31093dc4c6391d1f3f630ac4796ee16097d18 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Wed, 14 Oct 2020 09:43:49 -0700 Subject: [PATCH 44/54] removing custom text variables from swagger and examples --- .../preview/v3.2-preview.1/TextAnalytics.json | 245 ------------------ .../examples/SuccessfulAnalyzeRequest.json | 9 - .../SuccessfulAnalyzeStatusRequest.json | 30 --- 3 files changed, 284 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 9649678ef733..48a031ea725b 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -702,18 +702,6 @@ "items": { "$ref": "#/definitions/SentimentTask" } - }, - "customClassificationTasks": { - "type": "array", - "items": { - "$ref": "#/definitions/CustomClassificationTask" - } - }, - "customEntityRecognitionTasks": { - "type": "array", - "items": { - "$ref": "#/definitions/CustomEntitiesTask" - } } }, "type": "object" @@ -1028,201 +1016,6 @@ } ] }, - "CustomClassification": { - "properties": { - "confidenceScore": { - "example": 0.87, - "format": "double", - "type": "number" - }, - "name": { - "example": "hotel booking", - "type": "string" - } - }, - "required": [ - "name", - "confidenceScore" - ], - "type": "object" - }, - "CustomClassificationResult": { - "properties": { - "documents": { - "description": "Response by document", - "items": { - "$ref": "#/definitions/CustomClassificationDocument" - }, - "type": "array" - }, - "errors": { - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - }, - "type": "array" - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - } - }, - "required": [ - "documents", - "errors" - ], - "type": "object" - }, - "CustomClassificationTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { - "properties": { - "parameters": { - "properties": { - "appId": { - "type": "string" - }, - "slotName": { - "type": "string" - } - }, - "required": [ - "appId", - "slotName" - ], - "type": "object" - } - }, - "required": [ - "parameters" - ], - "type": "object" - } - ] - }, - "CustomClassificationDocument": { - "type": "object", - "required": [ - "id", - "classifications" - ], - "properties": { - "id": { - "type": "string" - }, - "classifications": { - "items": { - "$ref": "#/definitions/CustomClassification" - }, - "type": "array" - } - } - }, - "CustomEntitiesDocument": { - "type": "object", - "required": [ - "id", - "entities" - ], - "properties": { - "id": { - "type": "string" - }, - "entities": { - "items": { - "$ref": "#/definitions/CustomEntity" - }, - "type": "array" - } - } - }, - "CustomEntitiesResult": { - "properties": { - "documents": { - "description": "Response by document", - "items": { - "$ref": "#/definitions/CustomEntitiesDocument" - }, - "type": "array" - }, - "errors": { - "description": "Errors by document id.", - "items": { - "$ref": "#/definitions/DocumentError" - }, - "type": "array" - }, - "statistics": { - "$ref": "#/definitions/RequestStatistics" - } - }, - "required": [ - "documents", - "errors" - ], - "type": "object" - }, - "CustomEntitiesTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { - "properties": { - "parameters": { - "properties": { - "appId": { - "type": "string" - }, - "slotName": { - "type": "string" - }, - "stringIndexType": { - "$ref": "#/definitions/StringIndexType" - } - }, - "required": [ - "appId", - "slotName" - ], - "type": "object" - } - }, - "required": [ - "parameters" - ], - "type": "object" - } - ] - }, - "CustomEntity": { - "allOf": [ - { - "$ref": "#/definitions/Entity" - }, - { - "type": "object", - "properties": { - "children": { - "example": [ - { - "category": "city", - "confidenceScore": 0.78, - "length": 3, - "offset": 5 - } - ], - "items": { - "$ref": "#/definitions/CustomEntity" - }, - "type": "array" - } - } - } - ] - }, "SentimentResponse": { "type": "object", "required": [ @@ -1429,44 +1222,6 @@ } ] } - }, - "customClassificationTasks": { - "type": "array", - "items": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/TaskState" - }, - { - "type": "object", - "properties": { - "results": { - "$ref": "#/definitions/CustomClassificationResult" - } - } - } - ] - } - }, - "customEntityRecognitionTasks": { - "type": "array", - "items": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/TaskState" - }, - { - "type": "object", - "properties": { - "results": { - "$ref": "#/definitions/CustomEntitiesResult" - } - } - } - ] - } } }, "required": [ diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json index 16d619927137..bbf8eec44697 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -27,15 +27,6 @@ "model-version": "latest" } } - ], - "customClassificationTasks": [ - { - "enable": true, - "parameters": { - "appId": "71baed8c-a832-489d-8f38-e3b44685785f", - "slotName": "Production" - } - } ] } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json index 84a88224664f..93d23bfe90a3 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -82,36 +82,6 @@ "modelVersion": "2020-04-01" } } - ], - "customClassificationTasks": [ - { - "name": "Custom Classification 71baed8c-a832-489d-8f38-e3b44685785f/USRegionClassifier", - "lastUpdateDateTime": "2020-10-01T15:01:03Z", - "status": "succeeded", - "results": { - "documents": [ - { - "id": "1", - "classifications": [ - { - "name": "NorthWest", - "confidenceScore": 0.88 - } - ] - }, - { - "id": "2", - "classifications": [ - { - "name": "NorthEast", - "confidenceScore": 0.94 - } - ] - } - ], - "errors": [] - } - } ] } } From a9a834665e0bb3ef132fd733489dd9cd38cbed86 Mon Sep 17 00:00:00 2001 From: Abigail Hartman Date: Wed, 14 Oct 2020 09:54:31 -0700 Subject: [PATCH 45/54] Local changes to readme files --- .../preview/v3.2-preview.1/TextAnalytics.json | 2677 +++++++++++++++++ .../examples/SuccessfulAnalyzeRequest.json | 68 + .../SuccessfulAnalyzeStatusRequest.json | 136 + .../examples/SuccessfulEntitiesRequest.json | 94 + .../SuccessfulEntityLinkingRequest.json | 140 + .../examples/SuccessfulEntityPIIRequest.json | 100 + .../SuccessfulHealthDeleteRequest.json | 36 + .../examples/SuccessfulHealthRequest.json | 45 + .../SuccessfulHealthStatusRequest.json | 213 ++ .../examples/SuccessfulKeyPhrasesRequest.json | 83 + .../examples/SuccessfulLanguagesRequest.json | 82 + .../examples/SuccessfulSentimentRequest.json | 160 + .../data-plane/TextAnalytics/readme.md | 39 +- .../data-plane/TextAnalytics/readme.python.md | 55 + 14 files changed, 3900 insertions(+), 28 deletions(-) create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/readme.python.md diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json new file mode 100644 index 000000000000..9649678ef733 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -0,0 +1,2677 @@ +{ + "swagger": "2.0", + "info": { + "version": "v3.2-preview.1", + "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 natural language processing (NLP) 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. 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.2-preview.1", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + }, + "paths": { + "/analyze": { + "post": { + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "description": "Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed.", + "operationId": "Analyze", + "summary": "Submit analysis job", + "parameters": [ + { + "description": "Collection of documents to analyze and tasks to execute.", + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/AnalyzeBatchInput" + } + } + ], + "responses": { + "202": { + "description": "A successful call results with an Operation-Location header used to check the status of the analysis job.", + "headers": { + "Operation-Location": { + "type": "string" + } + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Successful Submit analysis job request": { + "$ref": ".//examples//SuccessfulAnalyzeRequest.json" + } + }, + "deprecated": false, + "x-ms-long-running-operation": true + } + }, + "/analyze/jobs/{jobId}": { + "get": { + "produces": [ + "application/json", + "text/json" + ], + "description": "Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are completed, the job will transition to the completed state and results will be available for each task.", + "operationId": "AnalyzeStatus", + "summary": "Get analysis status and results", + "parameters": [ + { + "$ref": "#/parameters/JobId" + }, + { + "$ref": "#/parameters/ShowStats" + }, + { + "default": 20, + "description": "(Optional) Set the maximum number of results per task. When both $top and $skip are specified, $skip is applied first.", + "in": "query", + "maximum": 50, + "minimum": 1, + "name": "$top", + "type": "integer" + }, + { + "default": 0, + "description": "(Optional) Set the number of elements to offset in the response. When both $top and $skip are specified, $skip is applied first.", + "in": "query", + "minimum": 0, + "name": "$skip", + "type": "integer" + } + ], + "responses": { + "200": { + "description": "Analysis job status and metadata.", + "schema": { + "$ref": "#/definitions/AnalyzeJobState" + } + }, + "404": { + "description": "Job ID not found.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Successful Get Analysis job status request": { + "$ref": ".//examples//SuccessfulAnalyzeStatusRequest.json" + } + }, + "deprecated": false + } + }, + "/entities/health/jobs/{jobId}": { + "get": { + "produces": [ + "application/json", + "text/json" + ], + "description": "Get details of the healthcare prediction job specified by the jobId.", + "operationId": "HealthStatus", + "summary": "Get healthcare analysis job status and results", + "parameters": [ + { + "$ref": "#/parameters/JobId" + }, + { + "default": 20, + "description": "(Optional) Set the maximum number of results per task. When both $top and $skip are specified, $skip is applied first.", + "in": "query", + "maximum": 50, + "minimum": 1, + "name": "$top", + "type": "integer" + }, + { + "default": 0, + "description": "(Optional) Set the number of elements to offset in the response. When both $top and $skip are specified, $skip is applied first.", + "in": "query", + "minimum": 0, + "name": "$skip", + "type": "integer" + }, + { + "$ref": "#/parameters/ShowStats" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/HealthcareJobState" + } + }, + "404": { + "description": "Job ID not found.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Successful Health request": { + "$ref": ".//examples//SuccessfulHealthStatusRequest.json" + } + }, + "deprecated": false + }, + "delete": { + "produces": [ + "application/json", + "text/json" + ], + "description": "Cancel healthcare prediction job.", + "operationId": "CancelHealthJob", + "summary": "Cancel healthcare prediction job", + "parameters": [ + { + "$ref": "#/parameters/JobId" + } + ], + "responses": { + "202": { + "description": "Cancel Job request has been received.", + "headers": { + "Operation-Location": { + "type": "string" + } + } + }, + "404": { + "description": "Job ID not found.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Successful Health request": { + "$ref": ".//examples//SuccessfulHealthDeleteRequest.json" + } + }, + "deprecated": false, + "x-ms-long-running-operation": true + } + }, + "/entities/health/jobs": { + "post": { + "summary": "Submit healthcare analysis job", + "description": "Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions, symptoms, etc) and their relations.", + "operationId": "Health", + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "$ref": "#/parameters/ModelVersion" + }, + { + "$ref": "#/parameters/StringIndexType" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + } + ], + "responses": { + "202": { + "description": "Accepted - call results in a link where the status of the submitted job can be checked via the GET operation.", + "headers": { + "Operation-Location": { + "type": "string" + } + } + }, + "400": { + "description": "Bad Request.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Successful Health request": { + "$ref": ".//examples//SuccessfulHealthRequest.json" + } + }, + "deprecated": false, + "x-ms-long-running-operation": true + } + }, + "/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/StringIndexType" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + } + ], + "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" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "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 specified, will set the PII domain to include only a subset of the entity categories. Possible values include: 'PHI', 'none'.", + "type": "string" + }, + { + "$ref": "#/parameters/StringIndexType" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + } + ], + "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" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "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/StringIndexType" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + } + ], + "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" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "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" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "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" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "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/StringIndexType" + }, + { + "$ref": "#/parameters/MultiLanguageInput" + } + ], + "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" + }, + "x-ms-error-response": true + }, + "500": { + "description": "Internal error response", + "schema": { + "$ref": "#/definitions/ErrorResponse" + }, + "x-ms-error-response": true + } + }, + "x-ms-examples": { + "Successful Sentiment request": { + "$ref": ".//examples//SuccessfulSentimentRequest.json" + } + }, + "deprecated": false + } + } + }, + "definitions": { + "JobManifest": { + "properties": { + "tasks": { + "description": "The set of tasks to execute on the input documents. Cannot specify the same task more than once.", + "properties": { + "entityRecognitionTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/EntitiesTask" + } + }, + "entityRecognitionPiiTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/PiiTask" + } + }, + "entityLinkingTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityLinkingTask" + } + }, + "keyPhraseExtractionTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/KeyPhrasesTask" + } + }, + "sentimentAnalysisTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/SentimentTask" + } + }, + "customClassificationTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomClassificationTask" + } + }, + "customEntityRecognitionTasks": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomEntitiesTask" + } + } + }, + "type": "object" + } + }, + "required": [ + "tasks" + ], + "type": "object" + }, + "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" + } + } + }, + "TextAnalyticsError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable", + "NotFound" + ], + "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" + } + } + } + }, + "TextAnalyticsTask": { + "type": "object", + "required": [ + "enable" + ], + "properties": { + "enable": { + "default": false, + "type": "boolean" + } + } + }, + "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." + } + } + }, + "PiiTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "domain": { + "default": "none", + "enum": [ + "phi", + "none" + ], + "type": "string" + }, + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, + "EntitiesTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" + } + }, + "type": "object" + } + }, + "type": "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." + } + } + }, + "AnalyzeBatchInput": { + "allOf": [ + { + "$ref": "#/definitions/JobDescriptor" + }, + { + "type": "object", + "required": [ + "analysisInput" + ], + "properties": { + "analysisInput": { + "$ref": "#/definitions/MultiLanguageBatchInput" + } + } + }, + { + "$ref": "#/definitions/JobManifest" + } + ] + }, + "AnalyzeJobState": { + "allOf": [ + { + "$ref": "#/definitions/JobMetadata" + }, + { + "$ref": "#/definitions/TasksState" + }, + { + "properties": { + "errors": { + "items": { + "$ref": "#/definitions/TextAnalyticsError" + }, + "type": "array" + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + } + }, + "type": "object" + }, + { + "$ref": "#/definitions/Pagination" + } + ] + }, + "CustomClassification": { + "properties": { + "confidenceScore": { + "example": 0.87, + "format": "double", + "type": "number" + }, + "name": { + "example": "hotel booking", + "type": "string" + } + }, + "required": [ + "name", + "confidenceScore" + ], + "type": "object" + }, + "CustomClassificationResult": { + "properties": { + "documents": { + "description": "Response by document", + "items": { + "$ref": "#/definitions/CustomClassificationDocument" + }, + "type": "array" + }, + "errors": { + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + }, + "type": "array" + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + } + }, + "required": [ + "documents", + "errors" + ], + "type": "object" + }, + "CustomClassificationTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "appId": { + "type": "string" + }, + "slotName": { + "type": "string" + } + }, + "required": [ + "appId", + "slotName" + ], + "type": "object" + } + }, + "required": [ + "parameters" + ], + "type": "object" + } + ] + }, + "CustomClassificationDocument": { + "type": "object", + "required": [ + "id", + "classifications" + ], + "properties": { + "id": { + "type": "string" + }, + "classifications": { + "items": { + "$ref": "#/definitions/CustomClassification" + }, + "type": "array" + } + } + }, + "CustomEntitiesDocument": { + "type": "object", + "required": [ + "id", + "entities" + ], + "properties": { + "id": { + "type": "string" + }, + "entities": { + "items": { + "$ref": "#/definitions/CustomEntity" + }, + "type": "array" + } + } + }, + "CustomEntitiesResult": { + "properties": { + "documents": { + "description": "Response by document", + "items": { + "$ref": "#/definitions/CustomEntitiesDocument" + }, + "type": "array" + }, + "errors": { + "description": "Errors by document id.", + "items": { + "$ref": "#/definitions/DocumentError" + }, + "type": "array" + }, + "statistics": { + "$ref": "#/definitions/RequestStatistics" + } + }, + "required": [ + "documents", + "errors" + ], + "type": "object" + }, + "CustomEntitiesTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "appId": { + "type": "string" + }, + "slotName": { + "type": "string" + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" + } + }, + "required": [ + "appId", + "slotName" + ], + "type": "object" + } + }, + "required": [ + "parameters" + ], + "type": "object" + } + ] + }, + "CustomEntity": { + "allOf": [ + { + "$ref": "#/definitions/Entity" + }, + { + "type": "object", + "properties": { + "children": { + "example": [ + { + "category": "city", + "confidenceScore": 0.78, + "length": 3, + "offset": 5 + } + ], + "items": { + "$ref": "#/definitions/CustomEntity" + }, + "type": "array" + } + } + } + ] + }, + "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." + } + } + }, + "SentimentTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + }, + "opinionMining": { + "default": false, + "type": "boolean" + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, + "TaskState": { + "properties": { + "lastUpdateDateTime": { + "format": "date-time", + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "enum": [ + "notstarted", + "running", + "succeeded", + "failed", + "cancelled", + "cancelling" + ], + "x-ms-enum": { + "modelAsString": false, + "name": "State" + } + } + }, + "required": [ + "name", + "status", + "lastUpdateDateTime" + ], + "type": "object" + }, + "TasksState": { + "properties": { + "tasks": { + "properties": { + "details": { + "items": { + "$ref": "#/definitions/TaskState" + }, + "type": "array" + }, + "completed": { + "type": "integer" + }, + "failed": { + "type": "integer" + }, + "inProgress": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "entityRecognitionTasks": { + "type": "array", + "items": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/EntitiesResult" + } + } + } + ] + } + }, + "entityRecognitionPiiTasks": { + "type": "array", + "items": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/PiiResult" + } + } + } + ] + } + }, + "entityLinkingTasks": { + "type": "array", + "items": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/EntityLinkingResult" + } + } + } + ] + } + }, + "keyPhraseExtractionTasks": { + "type": "array", + "items": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/KeyPhraseResult" + } + } + } + ] + } + }, + "sentimentAnalysisTasks": { + "type": "array", + "items": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/SentimentResponse" + } + } + } + ] + } + }, + "customClassificationTasks": { + "type": "array", + "items": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/CustomClassificationResult" + } + } + } + ] + } + }, + "customEntityRecognitionTasks": { + "type": "array", + "items": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/TaskState" + }, + { + "type": "object", + "properties": { + "results": { + "$ref": "#/definitions/CustomEntitiesResult" + } + } + } + ] + } + } + }, + "required": [ + "total", + "completed", + "failed", + "inProgress" + ], + "type": "object" + } + }, + "required": [ + "tasks" + ], + "type": "object" + }, + "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 + }, + "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" + } + }, + "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" + } + } + }, + "PiiDocumentEntities": { + "type": "object", + "required": [ + "id", + "redactedText", + "entities", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "redactedText": { + "type": "string", + "description": "Returns redacted text." + }, + "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." + }, + "subcategory": { + "type": "string", + "description": "(Optional) Entity sub type." + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length for the entity text. Use of different 'stringIndexType' values can affect the length returned." + }, + "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" + } + } + }, + "EntityLinkingTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, + "HealthcareJobState": { + "allOf": [ + { + "$ref": "#/definitions/JobMetadata" + }, + { + "properties": { + "results": { + "$ref": "#/definitions/HealthcareResult" + } + }, + "type": "object" + }, + { + "$ref": "#/definitions/Pagination" + } + ] + }, + "HealthcareResult": { + "type": "object", + "required": [ + "documents", + "errors", + "modelVersion" + ], + "properties": { + "documents": { + "type": "array", + "description": "Response by document", + "items": { + "$ref": "#/definitions/DocumentHealthcareEntities" + } + }, + "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." + } + } + }, + "DocumentHealthcareEntities": { + "type": "object", + "required": [ + "id", + "entities", + "relations", + "warnings" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique, non-empty document identifier." + }, + "entities": { + "description": "Healthcare entities.", + "type": "array", + "items": { + "$ref": "#/definitions/HealthcareEntity" + } + }, + "relations": { + "type": "array", + "description": "Healthcare entity relations.", + "items": { + "$ref": "#/definitions/HealthcareRelation" + } + }, + "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" + } + } + }, + "HealthcareEntity": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Entity" + }, + { + "required": [ + "isNegated" + ], + "properties": { + "isNegated": { + "type": "boolean" + }, + "links": { + "description": "Entity references in known data sources.", + "type": "array", + "items": { + "$ref": "#/definitions/HealthcareEntityLink" + } + } + } + } + ] + }, + "HealthcareRelation": { + "type": "object", + "required": [ + "relationType", + "bidirectional", + "source", + "target" + ], + "properties": { + "relationType": { + "description": "Type of relation. Examples include: `DosageOfMedication` or 'FrequencyOfMedication', etc.", + "type": "string" + }, + "bidirectional": { + "description": "If true the relation between the entities is bidirectional, otherwise directionality is source to target.", + "type": "boolean" + }, + "source": { + "description": "Reference link to the source entity.", + "type": "string" + }, + "target": { + "description": "Reference link to the target entity.", + "type": "string" + } + } + }, + "HealthcareEntityLink": { + "type": "object", + "required": [ + "dataSource", + "id" + ], + "properties": { + "dataSource": { + "description": "Entity Catalog. Examples include: UMLS, CHV, MSH, etc.", + "type": "string" + }, + "id": { + "description": "Entity id in the given source catalog.", + "type": "string" + } + } + }, + "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 Entity Search API unique identifier of the recognized entity." + } + } + }, + "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." + } + } + }, + "JobDescriptor": { + "properties": { + "displayName": { + "description": "Optional display name for the analysis job.", + "type": "string" + } + }, + "type": "object" + }, + "JobMetadata": { + "properties": { + "createdDateTime": { + "format": "date-time", + "type": "string" + }, + "displayName": { + "type": "string" + }, + "expirationDateTime": { + "format": "date-time", + "type": "string" + }, + "jobId": { + "format": "uuid", + "type": "string" + }, + "lastUpdateDateTime": { + "format": "date-time", + "type": "string" + }, + "status": { + "enum": [ + "notstarted", + "running", + "succeeded", + "failed", + "cancelled", + "cancelling", + "partiallycompleted" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": false, + "name": "State" + } + } + }, + "required": [ + "jobId", + "lastUpdateDateTime", + "createdDateTime", + "status" + ], + "type": "object" + }, + "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" + } + } + }, + "KeyPhrasesTask": { + "allOf": [ + { + "$ref": "#/definitions/TextAnalyticsTask" + }, + { + "properties": { + "parameters": { + "properties": { + "model-version": { + "default": "latest", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + }, + "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" + } + } + }, + "Pagination": { + "properties": { + "@nextLink": { + "type": "string" + } + }, + "type": "object" + }, + "PiiResult": { + "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." + } + } + }, + "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." + } + } + }, + "StringIndexType": { + "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." + } + ] + }, + "type": "string" + } + }, + "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": true, + "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" + }, + "JobId": { + "description": "Job ID", + "format": "uuid", + "in": "path", + "name": "jobId", + "required": true, + "type": "string", + "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" + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json new file mode 100644 index 000000000000..e43ae62b0e46 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json @@ -0,0 +1,68 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}", + "input": { + "displayName": "Extracting Location & US Region", + "analysisInput": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "I had a wonderful trip to Seattle last week." + }, + { + "id": "2", + "language": "en", + "text": "I'm flying to NYC tomorrow. See you there." + } + ] + }, + "tasks": { + "entityRecognitionTasks": [{ + "enable": true, + "parameters": { + "model-version": "latest" + } + }], + "customClassificationTasks": [{ + "enable": true, + "parameters": { + "appId": "71baed8c-a832-489d-8f38-e3b44685785f", + "slotName": "USRegionClassifier" + } + }] + } + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/analyze/jobs/{jobId}" + } + }, + "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.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json new file mode 100644 index 000000000000..28de8f2cc0cb --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json @@ -0,0 +1,136 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "createdDateTime": "2020-10-01T15:00:45Z", + "displayName": "Extracting Location & US Region", + "expirationDateTime": "2020-10-03T15:01:03Z", + "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", + "status": "succeeded", + "tasks": { + "completed": 2, + "failed": 0, + "inProgress": 0, + "total": 2, + "entityRecognitionTasks": [ + { + "name": "Recognize Entities (2020-04-01)", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", + "status": "succeeded", + "results": { + "documents": [ + { + "entities": [ + { + "category": "Event", + "confidenceScore": 0.61, + "length": 4, + "offset": 18, + "text": "trip" + }, + { + "category": "Location", + "confidenceScore": 0.82, + "length": 7, + "offset": 26, + "subcategory": "GPE", + "text": "Seattle" + }, + { + "category": "DateTime", + "confidenceScore": 0.8, + "length": 9, + "offset": 34, + "subcategory": "DateRange", + "text": "last week" + } + ], + "id": "1", + "warnings": [] + }, + { + "entities": [ + { + "category": "Location", + "confidenceScore": 0.52, + "length": 3, + "offset": 14, + "subcategory": "GPE", + "text": "NYC" + }, + { + "category": "DateTime", + "confidenceScore": 0.8, + "length": 8, + "offset": 18, + "subcategory": "Date", + "text": "tomorrow" + } + ], + "id": "2", + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-04-01" + } + } + ], + "customClassificationTasks": [ + { + "name": "Custom Classification 71baed8c-a832-489d-8f38-e3b44685785f/USRegionClassifier", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", + "status": "succeeded", + "results": { + "documents": [{ + "id": "1", + "classifications": [{ + "name": "NorthWest", + "confidenceScore": 0.88 + }] + }, + { + "id": "2", + "classifications": [{ + "name": "NorthEast", + "confidenceScore": 0.94 + }] + }], + "errors": [] + } + } + ] + } + } + }, + "404": { + "headers": {}, + "body": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json new file mode 100644 index 000000000000..02dd04bfe617 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json @@ -0,0 +1,94 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Microsoft was founded by Bill Gates and Paul Allen." + }, + { + "id": "2", + "language": "en", + "text": "Pike place market is my favorite Seattle attraction." + } + ] + } + }, + "responses": { + "200": { + "headers" : {}, + "body": { + "documents": [ + { + "entities": [ + { + "category": "Organization", + "confidenceScore": 0.84, + "length": 9, + "offset": 0, + "text": "Microsoft" + }, + { + "category": "Person", + "confidenceScore": 0.85, + "length": 10, + "offset": 25, + "text": "Bill Gates" + }, + { + "category": "Person", + "confidenceScore": 0.9, + "length": 10, + "offset": 40, + "text": "Paul Allen" + } + ], + "id": "1", + "warnings": [] + }, + { + "entities": [ + { + "category": "Location", + "confidenceScore": 0.55, + "length": 7, + "offset": 33, + "subcategory": "GPE", + "text": "Seattle" + } + ], + "id": "2", + "warnings": [] + } + ], + "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.2-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json new file mode 100644 index 000000000000..998ac1d65bab --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json @@ -0,0 +1,140 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Microsoft was founded by Bill Gates and Paul Allen." + }, + { + "id": "2", + "language": "en", + "text": "Pike place market is my favorite Seattle attraction." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "entities": [ + { + "dataSource": "Wikipedia", + "id": "Bill Gates", + "language": "en", + "matches": [ + { + "confidenceScore": 0.52, + "length": 10, + "offset": 25, + "text": "Bill Gates" + } + ], + "name": "Bill Gates", + "url": "https://en.wikipedia.org/wiki/Bill_Gates" + }, + { + "dataSource": "Wikipedia", + "id": "Paul Allen", + "language": "en", + "matches": [ + { + "confidenceScore": 0.54, + "length": 10, + "offset": 40, + "text": "Paul Allen" + } + ], + "name": "Paul Allen", + "url": "https://en.wikipedia.org/wiki/Paul_Allen" + }, + { + "dataSource": "Wikipedia", + "id": "Microsoft", + "language": "en", + "matches": [ + { + "confidenceScore": 0.49, + "length": 9, + "offset": 0, + "text": "Microsoft" + } + ], + "name": "Microsoft", + "url": "https://en.wikipedia.org/wiki/Microsoft" + } + ], + "id": "1", + "warnings": [] + }, + { + "entities": [ + { + "dataSource": "Wikipedia", + "id": "Pike Place Market", + "language": "en", + "matches": [ + { + "confidenceScore": 0.86, + "length": 17, + "offset": 0, + "text": "Pike place market" + } + ], + "name": "Pike Place Market", + "url": "https://en.wikipedia.org/wiki/Pike_Place_Market" + }, + { + "dataSource": "Wikipedia", + "id": "Seattle", + "language": "en", + "matches": [ + { + "confidenceScore": 0.27, + "length": 7, + "offset": 33, + "text": "Seattle" + } + ], + "name": "Seattle", + "url": "https://en.wikipedia.org/wiki/Seattle" + } + ], + "id": "2", + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-02-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.2-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json new file mode 100644 index 000000000000..d07170bdba7f --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -0,0 +1,100 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "My SSN is 859-98-0987" + }, + { + "id": "2", + "language": "en", + "text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check." + }, + { + "id": "3", + "language": "en", + "text": "Is 998.214.865-68 your Brazilian CPF number?" + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "entities": [ + { + "category": "U.S. Social Security Number (SSN)", + "confidenceScore": 0.65, + "length": 11, + "offset": 28, + "redactedText": "My SSN is ***********", + "text": "859-98-0987" + } + ], + "id": "1", + "warnings": [] + }, + { + "entities": [ + { + "category": "ABA Routing Number", + "confidenceScore": 0.75, + "length": 9, + "offset": 18, + "redactedText": "Your ABA number - ********* - is the first 9 digits in the lower left hand corner of your personal check.", + "text": "111000025" + } + ], + "id": "2", + "warnings": [] + }, + { + "entities": [ + { + "category": "Brazil CPF Number", + "confidenceScore": 0.85, + "length": 14, + "offset": 3, + "redactedText": "Is ************** your Brazilian CPF number?", + "text": "998.214.865-68" + } + ], + "id": "3", + "warnings": [] + } + ], + "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.2-preview.1/examples/SuccessfulHealthDeleteRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json new file mode 100644 index 000000000000..b9831626b22c --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}" + }, + "responses": { + "204": { + "headers": { + "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" + } + }, + "404": { + "headers": {}, + "body": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json new file mode 100644 index 000000000000..f63e04afd7fc --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json @@ -0,0 +1,45 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Subject is taking 100mg of ibuprofen twice daily." + } + ] + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" + } + }, + "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.2-preview.1/examples/SuccessfulHealthStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json new file mode 100644 index 000000000000..b3c6dcb0d50a --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json @@ -0,0 +1,213 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "jobId": "{Job ID}" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "createdDateTime": "2020-10-01T15:01:03Z", + "expirationDateTime": "2020-10-03T15:01:03Z", + "jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18", + "lastUpdateDateTime": "2020-10-01T15:01:03Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "1", + "entities": [ + { + "offset": 18, + "length": 5, + "text": "100mg", + "category": "Dosage", + "confidenceScore": 0.99, + "isNegated": false + }, + { + "offset": 27, + "length": 9, + "text": "ibuprofen", + "category": "MedicationName", + "confidenceScore": 1.0, + "isNegated": false, + "links": [ + { + "id": "C0020740", + "dataSource": "UMLS" + }, + { + "id": "0000019879", + "dataSource": "AOD" + }, + { + "id": "M01AE01", + "dataSource": "ATC" + }, + { + "id": "0046165", + "dataSource": "CCPSS" + }, + { + "id": "0000006519", + "dataSource": "CHV" + }, + { + "id": "2270-2077", + "dataSource": "CSP" + }, + { + "id": "DB01050", + "dataSource": "DRUGBANK" + }, + { + "id": "1611", + "dataSource": "GS" + }, + { + "id": "sh97005926", + "dataSource": "LCH_NW" + }, + { + "id": "LP16165-0", + "dataSource": "LNC" + }, + { + "id": "40458", + "dataSource": "MEDCIN" + }, + { + "id": "d00015", + "dataSource": "MMSL" + }, + { + "id": "D007052", + "dataSource": "MSH" + }, + { + "id": "WK2XYI10QM", + "dataSource": "MTHSPL" + }, + { + "id": "C561", + "dataSource": "NCI" + }, + { + "id": "C561", + "dataSource": "NCI_CTRP" + }, + { + "id": "00803", + "dataSource": "NCI_DCP" + }, + { + "id": "NSC0256857", + "dataSource": "NCI_DTP" + }, + { + "id": "WK2XYI10QM", + "dataSource": "NCI_FDA" + }, + { + "id": "CDR0000613511", + "dataSource": "NCI_NCI-GLOSS" + }, + { + "id": "002377", + "dataSource": "NDDF" + }, + { + "id": "CDR0000040475", + "dataSource": "PDQ" + }, + { + "id": "x02MO", + "dataSource": "RCD" + }, + { + "id": "5640", + "dataSource": "RXNORM" + }, + { + "id": "E-7772", + "dataSource": "SNM" + }, + { + "id": "C-603C0", + "dataSource": "SNMI" + }, + { + "id": "387207008", + "dataSource": "SNOMEDCT_US" + }, + { + "id": "m39860", + "dataSource": "USP" + }, + { + "id": "MTHU000060", + "dataSource": "USPMG" + }, + { + "id": "4017840", + "dataSource": "VANDF" + } + ] + }, + { + "offset": 37, + "length": 11, + "text": "twice daily", + "category": "Frequency", + "confidenceScore": 1, + "isNegated": false + } + ], + "relations": [ + { + "relationType": "DosageOfMedication", + "bidirectional": false, + "source": "#/documents/0/entities/0", + "target": "#/documents/0/entities/1" + }, + { + "relationType": "FrequencyOfMedication", + "bidirectional": false, + "source": "#/documents/0/entities/2", + "target": "#/documents/0/entities/1" + } + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2020-05-08" + } + } + }, + "404": { + "headers": {}, + "body": { + "error": { + "code": "NotFound", + "message": "Not Found", + "innererror": { + "code": "JobIdNotFound", + "message": "Job ID not found." + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error" + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json new file mode 100644 index 000000000000..f45b74e027f5 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -0,0 +1,83 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Microsoft was founded by Bill Gates and Paul Allen." + }, + { + "id": "2", + "language": "en", + "text": "Text Analytics is one of the Azure Cognitive Services." + }, + { + "id": "3", + "language": "en", + "text": "My cat might need to see a veterinarian." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "1", + "keyPhrases": [ + "Bill Gates", + "Paul Allen", + "Microsoft" + ], + "warnings": [] + }, + { + "id": "2", + "keyPhrases": [ + "Azure Cognitive Services", + "Text Analytics" + ], + "warnings": [] + }, + { + "id": "3", + "keyPhrases": [ + "cat", + "veterinarian" + ], + "warnings": [] + } + ], + "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.2-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json new file mode 100644 index 000000000000..b1077b92db58 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json @@ -0,0 +1,82 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "text": "Hello world" + }, + { + "id": "2", + "text": "Bonjour tout le monde" + }, + { + "id": "3", + "text": "Hola mundo" + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "en", + "name": "English" + }, + "id": "1", + "warnings": [] + }, + { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "fr", + "name": "French" + }, + "id": "2", + "warnings": [] + }, + { + "detectedLanguage": { + "confidenceScore": 1, + "iso6391Name": "es", + "name": "Spanish" + }, + "id": "3", + "warnings": [] + } + ], + "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.2-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json new file mode 100644 index 000000000000..9363baebb94f --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json @@ -0,0 +1,160 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "id": "1", + "language": "en", + "text": "Great atmosphere. Close to plenty of restaurants, hotels, and transit! Staff are friendly and helpful." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "confidenceScores": { + "negative": 0, + "neutral": 0, + "positive": 1 + }, + "id": "1", + "sentences": [ + { + "aspects": [ + { + "confidenceScores": { + "negative": 0, + "positive": 1 + }, + "length": 10, + "offset": 6, + "relations": [ + { + "ref": "#/documents/0/sentences/0/opinions/0", + "relationType": "opinion" + } + ], + "sentiment": "positive", + "text": "atmosphere" + } + ], + "confidenceScores": { + "negative": 0, + "neutral": 0, + "positive": 1 + }, + "length": 17, + "offset": 0, + "opinions": [ + { + "confidenceScores": { + "negative": 0, + "positive": 1 + }, + "isNegated": false, + "length": 5, + "offset": 0, + "sentiment": "positive", + "text": "great" + } + ], + "sentiment": "positive", + "text": "Great atmosphere." + }, + { + "aspects": [ + { + "confidenceScores": { + "negative": 0.01, + "positive": 0.99 + }, + "length": 11, + "offset": 37, + "relations": [ + { + "ref": "#/documents/0/sentences/1/opinions/0", + "relationType": "opinion" + } + ], + "sentiment": "positive", + "text": "restaurants" + }, + { + "confidenceScores": { + "negative": 0.01, + "positive": 0.99 + }, + "length": 6, + "offset": 50, + "relations": [ + { + "ref": "#/documents/0/sentences/1/opinions/0", + "relationType": "opinion" + } + ], + "sentiment": "positive", + "text": "hotels" + } + ], + "confidenceScores": { + "negative": 0.01, + "neutral": 0.86, + "positive": 0.13 + }, + "length": 52, + "offset": 18, + "opinions": [ + { + "confidenceScores": { + "negative": 0.01, + "positive": 0.99 + }, + "isNegated": false, + "length": 15, + "offset": 18, + "sentiment": "positive", + "text": "Close to plenty" + } + ], + "sentiment": "neutral", + "text": "Close to plenty of restaurants, hotels, and transit!" + } + ], + "sentiment": "positive", + "warnings": [] + } + ], + "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/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index 441e055ee4d0..59dae938cb76 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -178,6 +178,14 @@ These settings apply only when `--tag=release_3_1_preview.2` is specified on the input-file: preview/v3.1-preview.2/TextAnalytics.json ``` +### Release 3.2-Preview.1 + +These settings apply only when `--tag=release_3_2_preview.1` is specified on the command line. + +``` yaml $(tag) == 'release_3_2_preview.1' +input-file: preview/v3.2-preview.1/TextAnalytics.json +``` + ## Swagger to SDK This section describes what SDK should be generated by the automatic system. @@ -210,33 +218,8 @@ csharp: ``` ## Python - -These settings apply only when `--python` is specified on the command line. -Please also specify `--python-sdks-folder=`. -Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. - -``` yaml $(python) -python-mode: create -python: - license-header: MICROSOFT_MIT_NO_VERSION - add-credentials: true - payload-flattening-threshold: 2 - namespace: azure.cognitiveservices.language.textanalytics - package-name: azure-cognitiveservices-language-textanalytics - clear-output-folder: true -``` - -``` yaml $(python) && $(python-mode) == 'update' -python: - no-namespace-folders: true - output-folder: $(python-sdks-folder)/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics -``` - -``` yaml $(python) && $(python-mode) == 'create' -python: - basic-setup-py: true - output-folder: $(python-sdks-folder)/cognitiveservices/azure-cognitiveservices-language-textanalytics -``` + +See configuration in [readme.python.md](./readme.python.md) ## Go @@ -277,7 +260,7 @@ input-file: - $(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 - + - $(this-folder)/preview/v3.2-preview.1/TextAnalytics.json ``` If there are files that should not be in the `all-api-versions` set, diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.python.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.python.md new file mode 100644 index 000000000000..4a63a1d1c41b --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.python.md @@ -0,0 +1,55 @@ +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. +Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. + +``` yaml +python-mode: create +license-header: MICROSOFT_MIT_NO_VERSION +add-credentials: true +payload-flattening-threshold: 2 +package-name: azure-ai-textanalytics +clear-output-folder: true +credential-scopes: https://cognitiveservices.azure.com/.default +no-namespace-folders: true +``` + +```yaml $(multiapi) +batch: + - tag: release_3_0 + - tag: release_3_1_preview.2 + - tag: release_3_2_preview.1 + - multiapiscript: true +``` + +``` yaml $(multiapiscript) +output-folder: $(python-sdks-folder)/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics +default-api: v3_0 +clear-output-folder: false +perform-load: false +``` + +### Tag: release_3_0 +``` yaml $(tag) == 'release_3_0' +namespace: azure.ai.textanalytics.v3_0 +output-folder: $(python-sdks-folder)/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/v3_0 +``` + +### Tag: release_3_1_preview_1 +``` yaml $(tag) == 'release_3_1_preview.1' +namespace: azure.ai.textanalytics.v3_1_preview_1 +output-folder: $(python-sdks-folder)/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/v3_1_preview_1 +``` + +### Tag: release_3_1_preview_2 +``` yaml $(tag) == 'release_3_1_preview.2' +namespace: azure.ai.textanalytics.v3_1_preview_2 +output-folder: $(python-sdks-folder)/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/v3_1_preview_2 +``` + +### Tag: release_3_2_preview_1 +``` yaml $(tag) == 'release_3_2_preview.1' +namespace: azure.ai.textanalytics.v3_2_preview_1 +output-folder: $(python-sdks-folder)/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/v3_2_preview_1 +``` \ No newline at end of file From e2e22685bb87c3fa8cd63815fa1d5946ebf704a3 Mon Sep 17 00:00:00 2001 From: Abigail Hartman Date: Wed, 14 Oct 2020 10:22:01 -0700 Subject: [PATCH 46/54] Removed TextAnalyticsTask definition and updated other definitions that inherited its properties --- .../preview/v3.2-preview.1/TextAnalytics.json | 165 +++++++----------- 1 file changed, 59 insertions(+), 106 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index 48a031ea725b..c0c4342dee75 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -824,18 +824,6 @@ } } }, - "TextAnalyticsTask": { - "type": "object", - "required": [ - "enable" - ], - "properties": { - "enable": { - "default": false, - "type": "boolean" - } - } - }, "TextAnalyticsWarning": { "type": "object", "required": [ @@ -866,60 +854,46 @@ } }, "PiiTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { + "properties": { + "parameters": { "properties": { - "parameters": { - "properties": { - "domain": { - "default": "none", - "enum": [ - "phi", - "none" - ], - "type": "string" - }, - "model-version": { - "default": "latest", - "type": "string" - }, - "stringIndexType": { - "$ref": "#/definitions/StringIndexType" - } - }, - "type": "object" + "domain": { + "default": "none", + "enum": [ + "phi", + "none" + ], + "type": "string" + }, + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" } }, "type": "object" } - ] + }, + "type": "object" }, "EntitiesTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { + "properties": { + "parameters": { "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - }, - "stringIndexType": { - "$ref": "#/definitions/StringIndexType" - } - }, - "type": "object" + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" } }, "type": "object" } - ] + }, + "type": "object" }, "InnerError": { "type": "object", @@ -1048,32 +1022,25 @@ } }, "SentimentTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { + "properties": { + "parameters": { "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - }, - "opinionMining": { - "default": false, - "type": "boolean" - }, - "stringIndexType": { - "$ref": "#/definitions/StringIndexType" - } - }, - "type": "object" + "model-version": { + "default": "latest", + "type": "string" + }, + "opinionMining": { + "default": false, + "type": "boolean" + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" } }, "type": "object" } - ] + }, + "type": "object" }, "TaskState": { "properties": { @@ -1766,28 +1733,21 @@ } }, "EntityLinkingTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { + "properties": { + "parameters": { "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - }, - "stringIndexType": { - "$ref": "#/definitions/StringIndexType" - } - }, - "type": "object" + "model-version": { + "default": "latest", + "type": "string" + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType" } }, "type": "object" } - ] + }, + "type": "object" }, "HealthcareJobState": { "allOf": [ @@ -2139,25 +2099,18 @@ } }, "KeyPhrasesTask": { - "allOf": [ - { - "$ref": "#/definitions/TextAnalyticsTask" - }, - { + "properties": { + "parameters": { "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - } - }, - "type": "object" + "model-version": { + "default": "latest", + "type": "string" } }, "type": "object" } - ] + }, + "type": "object" }, "LanguageBatchInput": { "type": "object", From bad940fa3fdf494154b8fa1095140d1966cc953a Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Fri, 16 Oct 2020 10:25:09 -0700 Subject: [PATCH 47/54] remove multi api section (deprecated)) --- .../data-plane/TextAnalytics/readme.md | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index e94713144337..1a7239ebd5cb 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -153,34 +153,4 @@ java: output-folder: $(azure-libraries-for-java-folder)/cognitiveservices/data-plane/language/textanalytics with-optional-parameters: true with-single-async-method: true -``` - -## Multi-API/Profile support for AutoRest v3 generators - -AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. - -This block is updated by an automatic script. Edits may be lost! - -``` yaml $(tag) == 'all-api-versions' /* autogenerated */ -# include the azure profile definitions from the standard location -require: $(this-folder)/../../../../profiles/readme.md - -# all the input files across all versions -input-file: - - $(this-folder)/stable/v2.0/TextAnalytics.json - - $(this-folder)/stable/v2.1/TextAnalytics.json - - $(this-folder)/preview/v2.1/TextAnalytics.json - - $(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 - - $(this-folder)/preview/v3.2-preview.1/TextAnalytics.json -``` - -If there are files that should not be in the `all-api-versions` set, -uncomment the `exclude-file` section below and add the file paths. - -``` yaml $(tag) == 'all-api-versions' -#exclude-file: -# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json ``` \ No newline at end of file From ec060cd787cb11c60aad3b9b033223ba2d26f541 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Fri, 16 Oct 2020 10:45:50 -0700 Subject: [PATCH 48/54] reverting back the readme changes --- .../data-plane/TextAnalytics/readme.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index 1a7239ebd5cb..615abb66e584 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -133,7 +133,32 @@ csharp: ## Python -See configuration in [readme.python.md](./readme.python.md) +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. +Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. + +``` yaml $(python) +python-mode: create +python: + license-header: MICROSOFT_MIT_NO_VERSION + add-credentials: true + payload-flattening-threshold: 2 + namespace: azure.cognitiveservices.language.textanalytics + package-name: azure-cognitiveservices-language-textanalytics + clear-output-folder: true +``` + +``` yaml $(python) && $(python-mode) == 'update' +python: + no-namespace-folders: true + output-folder: $(python-sdks-folder)/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics +``` + +``` yaml $(python) && $(python-mode) == 'create' +python: + basic-setup-py: true + output-folder: $(python-sdks-folder)/cognitiveservices/azure-cognitiveservices-language-textanalytics +``` ## Go From f92f286a25493e0269ec98a5d483cfb9dce5fecd Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Fri, 16 Oct 2020 11:31:10 -0700 Subject: [PATCH 49/54] update StringIndexType to StringIndexTypeResponse in one of the enums --- .../TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json index c0c4342dee75..4919269e69fa 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json @@ -2275,7 +2275,7 @@ "Utf16CodeUnit" ], "x-ms-enum": { - "name": "StringIndexType", + "name": "StringIndexTypeResponse", "modelAsString": false, "values": [ { From d087016048968da00122f4f34891c5c6382c1e28 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Mon, 26 Oct 2020 10:32:40 -0700 Subject: [PATCH 50/54] update 3.2-preview.1 to 3.1-preview.3 --- .../{v3.2-preview.1 => v3.1-preview.3}/TextAnalytics.json | 4 ++-- .../examples/SuccessfulAnalyzeRequest.json | 2 +- .../examples/SuccessfulAnalyzeStatusRequest.json | 0 .../examples/SuccessfulEntitiesRequest.json | 0 .../examples/SuccessfulEntityLinkingRequest.json | 0 .../examples/SuccessfulEntityPIIRequest.json | 0 .../examples/SuccessfulHealthDeleteRequest.json | 2 +- .../examples/SuccessfulHealthRequest.json | 2 +- .../examples/SuccessfulHealthStatusRequest.json | 0 .../examples/SuccessfulKeyPhrasesRequest.json | 0 .../examples/SuccessfulLanguagesRequest.json | 0 .../examples/SuccessfulSentimentRequest.json | 0 .../cognitiveservices/data-plane/TextAnalytics/readme.md | 4 ++-- 13 files changed, 7 insertions(+), 7 deletions(-) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/TextAnalytics.json (99%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulAnalyzeRequest.json (93%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulAnalyzeStatusRequest.json (100%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulEntitiesRequest.json (100%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulEntityLinkingRequest.json (100%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulEntityPIIRequest.json (100%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulHealthDeleteRequest.json (85%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulHealthRequest.json (89%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulHealthStatusRequest.json (100%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulKeyPhrasesRequest.json (100%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulLanguagesRequest.json (100%) rename specification/cognitiveservices/data-plane/TextAnalytics/preview/{v3.2-preview.1 => v3.1-preview.3}/examples/SuccessfulSentimentRequest.json (100%) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json similarity index 99% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json index 4919269e69fa..5f5a53ecaa30 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "v3.2-preview.1", + "version": "v3.1-preview.3", "contact": { "name": "Microsoft Cognitive Services", "url": "https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/", @@ -23,7 +23,7 @@ } ], "x-ms-parameterized-host": { - "hostTemplate": "{Endpoint}/text/analytics/v3.2-preview.1", + "hostTemplate": "{Endpoint}/text/analytics/v3.1-preview.3", "useSchemePrefix": false, "parameters": [ { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulAnalyzeRequest.json similarity index 93% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulAnalyzeRequest.json index bbf8eec44697..569fc89f0c7d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulAnalyzeRequest.json @@ -34,7 +34,7 @@ "responses": { "202": { "headers": { - "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/analyze/jobs/{jobId}" + "Operation-Location": "{endpoint}/text/analytics/v3.1-preview.3/analyze/jobs/{jobId}" } }, "400": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulAnalyzeStatusRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulAnalyzeStatusRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulAnalyzeStatusRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulEntitiesRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntitiesRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulEntitiesRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulEntityLinkingRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityLinkingRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulEntityLinkingRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulEntityPIIRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulEntityPIIRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulEntityPIIRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulHealthDeleteRequest.json similarity index 85% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulHealthDeleteRequest.json index 383705014761..ef2721ece65d 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthDeleteRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulHealthDeleteRequest.json @@ -7,7 +7,7 @@ "responses": { "202": { "headers": { - "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" + "Operation-Location": "{endpoint}/text/analytics/v3.1-preview.3/entities/healthcare/jobs/{jobId}" } }, "404": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulHealthRequest.json similarity index 89% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulHealthRequest.json index 989b7d60ad85..7fe69d163906 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulHealthRequest.json @@ -16,7 +16,7 @@ "responses": { "202": { "headers": { - "Operation-Location": "{endpoint}/text/analytics/v3.2-preview.1/entities/healthcare/jobs/{jobId}" + "Operation-Location": "{endpoint}/text/analytics/v3.1-preview.3/entities/healthcare/jobs/{jobId}" } }, "400": { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulHealthStatusRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulHealthStatusRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulHealthStatusRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulKeyPhrasesRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulKeyPhrasesRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulKeyPhrasesRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulLanguagesRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulLanguagesRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulLanguagesRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulSentimentRequest.json similarity index 100% rename from specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.2-preview.1/examples/SuccessfulSentimentRequest.json rename to specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulSentimentRequest.json diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index 615abb66e584..5fb753b1b464 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -92,12 +92,12 @@ These settings apply only when `--tag=release_3_1_preview.2` is specified on the input-file: preview/v3.1-preview.2/TextAnalytics.json ``` -### Release 3.2-Preview.1 +### Release 3.1-Preview.3 These settings apply only when `--tag=release_3_2_preview.1` is specified on the command line. ``` yaml $(tag) == 'release_3_2_preview.1' -input-file: preview/v3.2-preview.1/TextAnalytics.json +input-file: preview/v3.1-preview.3/TextAnalytics.json ``` ## Swagger to SDK From 5ad71933796f9a64130d2d4888477b5dd279bb80 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Mon, 26 Oct 2020 11:01:13 -0700 Subject: [PATCH 51/54] remove sentiment task --- .../preview/v3.1-preview.3/TextAnalytics.json | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json index 5f5a53ecaa30..52148f2044a1 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json @@ -696,12 +696,6 @@ "items": { "$ref": "#/definitions/KeyPhrasesTask" } - }, - "sentimentAnalysisTasks": { - "type": "array", - "items": { - "$ref": "#/definitions/SentimentTask" - } } }, "type": "object" @@ -1170,25 +1164,6 @@ } ] } - }, - "sentimentAnalysisTasks": { - "type": "array", - "items": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/TaskState" - }, - { - "type": "object", - "properties": { - "results": { - "$ref": "#/definitions/SentimentResponse" - } - } - } - ] - } } }, "required": [ From 17de3d9c58b04bfe455f5f10fefa608e978e1ff0 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Mon, 26 Oct 2020 14:13:57 -0700 Subject: [PATCH 52/54] remove entitylinking tasks --- .../preview/v3.1-preview.3/TextAnalytics.json | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json index 52148f2044a1..d5abaebe17a2 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json @@ -685,12 +685,6 @@ "$ref": "#/definitions/PiiTask" } }, - "entityLinkingTasks": { - "type": "array", - "items": { - "$ref": "#/definitions/EntityLinkingTask" - } - }, "keyPhraseExtractionTasks": { "type": "array", "items": { @@ -1127,25 +1121,6 @@ ] } }, - "entityLinkingTasks": { - "type": "array", - "items": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/TaskState" - }, - { - "type": "object", - "properties": { - "results": { - "$ref": "#/definitions/EntityLinkingResult" - } - } - } - ] - } - }, "keyPhraseExtractionTasks": { "type": "array", "items": { @@ -1707,23 +1682,6 @@ } } }, - "EntityLinkingTask": { - "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - }, - "stringIndexType": { - "$ref": "#/definitions/StringIndexType" - } - }, - "type": "object" - } - }, - "type": "object" - }, "HealthcareJobState": { "allOf": [ { From a38796354e05169091a2c946a19d53009929cfd9 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Mon, 26 Oct 2020 14:24:14 -0700 Subject: [PATCH 53/54] fix analyze example --- .../v3.1-preview.3/examples/SuccessfulAnalyzeRequest.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulAnalyzeRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulAnalyzeRequest.json index 569fc89f0c7d..87414f0d5cf7 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulAnalyzeRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/examples/SuccessfulAnalyzeRequest.json @@ -22,7 +22,6 @@ "tasks": { "entityRecognitionTasks": [ { - "enable": true, "parameters": { "model-version": "latest" } From c2eefcbdad9aeb7cea8efdd7ed2390f24ad0c807 Mon Sep 17 00:00:00 2001 From: Suhas Mehta Date: Mon, 26 Oct 2020 15:58:59 -0700 Subject: [PATCH 54/54] remove sentiment task def --- .../preview/v3.1-preview.3/TextAnalytics.json | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json index d5abaebe17a2..3af58c58c528 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.3/TextAnalytics.json @@ -1009,27 +1009,6 @@ } } }, - "SentimentTask": { - "properties": { - "parameters": { - "properties": { - "model-version": { - "default": "latest", - "type": "string" - }, - "opinionMining": { - "default": false, - "type": "boolean" - }, - "stringIndexType": { - "$ref": "#/definitions/StringIndexType" - } - }, - "type": "object" - } - }, - "type": "object" - }, "TaskState": { "properties": { "lastUpdateDateTime": {