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 new file mode 100644 index 000000000000..675210bab169 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json @@ -0,0 +1,1347 @@ +{ + "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", + "aspects", + "opinions" + ], + "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/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json new file mode 100644 index 000000000000..75b4489dcb2d --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntitiesRequest.json @@ -0,0 +1,91 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "language": "en", + "id": "1", + "text": "I had a wonderful trip to Seattle last week." + }, + { + "language": "en", + "id": "2", + "text": "I work at Microsoft." + }, + { + "language": "en", + "id": "3", + "text": "I visited Space Needle 2 times." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "1", + "entities": [ + { + "text": "Seattle", + "category": "Location", + "offset": 26, + "length": 7, + "confidenceScore": 0.80 + }, + { + "text": "last week", + "category": "DateTime", + "subcategory": "DateRange", + "offset": 34, + "length": 9, + "confidenceScore": 0.8 + } + ], + "warnings": [] + }, + { + "id": "2", + "entities": [ + { + "text": "Microsoft", + "category": "Organization", + "offset": 10, + "length": 9, + "confidenceScore": 0.99 + } + ], + "warnings": [] + }, + { + "id": "3", + "entities": [ + { + "text": "Space Needle", + "category": "Organization", + "offset": 10, + "length": 12, + "confidenceScore": 0.75 + }, + { + "text": "2", + "category": "Quantity", + "subcategory": "Number", + "offset": 23, + "length": 1, + "confidenceScore": 0.8 + } + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2019-10-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityLinkingRequest.json new file mode 100644 index 000000000000..caf12d36bc11 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/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/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json new file mode 100644 index 000000000000..70d30744fd02 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulEntityPIIRequest.json @@ -0,0 +1,78 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "language": "en", + "id": "0", + "text": "Microsoft employee with ssn 859-98-0987 is using our awesome API's." + }, + { + "language": "en", + "id": "1", + "text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check." + }, + { + "language": "en", + "id": "2", + "text": "Is 998.214.865-68 your Brazilian CPF number?" + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "0", + "entities": [ + { + "text": "859-98-0987", + "category": "U.S. Social Security Number (SSN)", + "subcategory": "", + "offset": 28, + "length": 11, + "confidenceScore": 0.65 + } + ], + "warnings": [] + }, + { + "id": "1", + "entities": [ + { + "text": "111000025", + "category": "ABA Routing Number", + "subcategory": "", + "offset": 18, + "length": 9, + "confidenceScore": 0.75 + } + ], + "warnings": [] + }, + { + "id": "2", + "entities": [ + { + "text": "998.214.865-68", + "category": "Brazil CPF Number", + "subcategory": "", + "offset": 3, + "length": 14, + "confidenceScore": 0.85 + } + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2019-10-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json new file mode 100644 index 000000000000..12ff0ccce583 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulKeyPhrasesRequest.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}", + "input": { + "documents": [ + { + "language": "en", + "id": "1", + "text": "Hello world. This is some input text that I love." + }, + { + "language": "fr", + "id": "2", + "text": "Bonjour tout le monde" + }, + { + "language": "es", + "id": "3", + "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer." + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "documents": [ + { + "id": "1", + "keyPhrases": [ + "world", + "input text" + ], + "warnings": [] + }, + { + "id": "2", + "keyPhrases": [ + "monde" + ], + "warnings": [] + }, + { + "id": "3", + "keyPhrases": [ + "carretera", + "tráfico", + "día" + ], + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2019-10-01" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulLanguagesRequest.json new file mode 100644 index 000000000000..fad894b10669 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/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/v3.1-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/examples/SuccessfulSentimentRequest.json new file mode 100644 index 000000000000..ad3fc48d2cae --- /dev/null +++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/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" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md index aaa4fc2829e7..76c9442fa1a4 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md @@ -158,6 +158,15 @@ input-file: preview/v3.0-preview.1/TextAnalytics.json log-file: logs/log.txt ``` +### Release 3.1-Preview.1 + +These settings apply only when `--tag=release_3_1_preview.1` is specified on the command line. + +``` yaml $(tag) == 'release_3_1_preview.1' +input-file: preview/v3.1-preview.1/TextAnalytics.json +log-file: logs/log.txt +``` + ## Swagger to SDK This section describes what SDK should be generated by the automatic system.