From 10a514388d64ce927da614efda0e684e2880ee0f Mon Sep 17 00:00:00 2001
From: HanLiMS <31705044+HanLiMS@users.noreply.github.com>
Date: Tue, 19 Nov 2019 22:35:15 -0800
Subject: [PATCH] Add Text Analytics V3.0-Preview.1 (#7133)
* add ta v3.0-preview.1
* resolve comments
* fix spaces
* update examples
* resolve comments
* update /healthcare and score
* update Bioentity and entityrecord
* temp
* update api changes based on meeting discussions
* update healthcare
* update entity linking
* update naming/description
* update pii
* update required
* udpate required --> still need kv pair for details inside innererror
* update summary and description
* resolve comments -- update opreationid, model-version, errors, etc
* update error
* update error
* remove optional in response, update uppercase of Optional in requests
* update space
* resolve comments
* revole comments
* remove /healthcare
* update score range in description
* update description
* update aka.ms links
* update pii description to use personal information
* resolve comments -- updte detectedLnauges & operationId
* update error enum
* update /readme.md
* update aka.ms links
* update aka.ms links
* update preview read me name & descrition
* update all examples to /examples
* update unkown word to custom-word.txt
* git update folder case name
* update input name to match with example json files
* update 500 to default --> same as previous version .json files
* update MultiLanguageBatchInput
* update examples formatting
* update formatting of .json
* update x-ms-examples descriptions
* test required false for model-version&showStats
* update model-version and showStats
* update formatting
* add x-nullabletrue
* update formmating
* update pii example forammating
* update formaating
* update formatting
* update textanalytics.json format
* testing
* update model-vesrion
* detele required false
* prettier --write
* remove exmpales from TextAnalytics.json
* test keyphrase
* keyphrase
* keyphrase retry
* update keyphrase back
* update ta.json split []
---
custom-words.txt | 6 +
.../preview/v3.0-preview.1/TextAnalytics.json | 1099 +++++++++++++++++
.../examples/SuccessfulEntitiesRequest.json | 88 ++
.../SuccessfulEntityLinkingRequest.json | 96 ++
.../examples/SuccessfulEntityPIIRequest.json | 75 ++
.../examples/SuccessfulKeyPhrasesRequest.json | 57 +
.../examples/SuccessfulLanguagesRequest.json | 64 +
.../examples/SuccessfulSentimentRequest.json | 119 ++
.../data-plane/TextAnalytics/readme.md | 10 +
9 files changed, 1614 insertions(+)
create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json
create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json
create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json
create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json
create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json
create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json
create mode 100644 specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json
diff --git a/custom-words.txt b/custom-words.txt
index 378abd074c1a..c43e57031f49 100644
--- a/custom-words.txt
+++ b/custom-words.txt
@@ -106,6 +106,7 @@ Asns
aspnet
asyncinfo
asyncoperation
+atascada
australiaeast
australiasoutheast
authenticatable
@@ -224,6 +225,7 @@ canceldelete
cancelpipelinerun
canonicalized
Carbonite
+carretera
catenate
catenated
caverphone
@@ -472,6 +474,7 @@ environmentsettings
errordetail
errored
Español
+estaba
Etag
Ethereum
evaluateautoscale
@@ -589,6 +592,7 @@ GUID
GUIDs
GZRS
haase
+Había
hadoop
hana
hanaonazure
@@ -870,6 +874,7 @@ MSGETACLSTATUS
MSGETFILESTATUS
MSLISTSTATUS
MSMCAZR
+mucho
multiapi
Multiclass
MULTIJSON
@@ -1466,6 +1471,7 @@ tooltips
trafficmanager
trafficmanageranalytics
trafficmanagerprofiles
+tráfico
transcoding
transcriptmoderationresult
translatortext
diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json
new file mode 100644
index 000000000000..91bdbfa05aca
--- /dev/null
+++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/TextAnalytics.json
@@ -0,0 +1,1099 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "version": "v3.0-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.0-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/Error"
+ }
+ }
+ },
+ "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"
+ },
+ {
+ "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/Error"
+ }
+ }
+ },
+ "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/Error"
+ }
+ }
+ },
+ "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/Error"
+ }
+ }
+ },
+ "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/Error"
+ }
+ }
+ },
+ "x-ms-examples": {
+ "Successful Detect Language request": {
+ "$ref": ".//examples//SuccessfulLanguagesRequest.json"
+ }
+ },
+ "deprecated": false
+ }
+ },
+ "/sentiment": {
+ "post": {
+ "summary": "Sentiment",
+ "description": "The API returns a sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral) for the document and each sentence within it. See the Supported languages in Text Analytics API for the list of enabled languages.",
+ "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"
+ },
+ {
+ "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/Error"
+ }
+ }
+ },
+ "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.",
+ "items": {
+ "$ref": "#/definitions/Error"
+ }
+ }
+ }
+ },
+ "Error": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "string",
+ "enum": [
+ "invalidRequest",
+ "invalidArgument",
+ "internalServerError",
+ "serviceUnavailable"
+ ],
+ "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/Error"
+ }
+ }
+ }
+ },
+ "InnerError": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "string",
+ "enum": [
+ "invalidParameterValue",
+ "invalidRequestBodyFormat",
+ "emptyRequest",
+ "missingInputRecords",
+ "invalidDocument",
+ "modelVersionIncorrect",
+ "invalidDocumentBatch",
+ "unsupportedLanguageCode",
+ "invalidCountryHint"
+ ],
+ "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."
+ }
+ }
+ },
+ "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",
+ "documentScores",
+ "sentences"
+ ],
+ "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"
+ ]
+ },
+ "statistics": {
+ "$ref": "#/definitions/DocumentStatistics"
+ },
+ "documentScores": {
+ "description": "Document level sentiment confidence scores between 0 and 1 for each sentiment class."
+ },
+ "sentences": {
+ "type": "array",
+ "description": "Sentence level sentiment analysis.",
+ "items": {
+ "$ref": "#/definitions/SentenceSentiment"
+ }
+ }
+ }
+ },
+ "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": [
+ "sentiment",
+ "sentenceScores",
+ "offset",
+ "length"
+ ],
+ "properties": {
+ "sentiment": {
+ "type": "string",
+ "description": "The predicted Sentiment for the sentence.",
+ "enum": [
+ "positive",
+ "neutral",
+ "negative"
+ ]
+ },
+ "sentenceScores": {
+ "description": "The sentiment confidence score between 0 and 1 for the sentence for all classes."
+ },
+ "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 by Unicode standard."
+ },
+ "warnings": {
+ "type": "array",
+ "description": "The warnings generated for the sentence.",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "EntitiesResult": {
+ "type": "object",
+ "required": [
+ "documents",
+ "errors",
+ "modelVersion"
+ ],
+ "properties": {
+ "documents": {
+ "type": "array",
+ "description": "Response by document",
+ "items": {
+ "$ref": "#/definitions/DocumentEntities"
+ }
+ },
+ "errors": {
+ "type": "array",
+ "description": "Errors by document id.",
+ "items": {
+ "$ref": "#/definitions/DocumentError"
+ }
+ },
+ "statistics": {
+ "$ref": "#/definitions/RequestStatistics"
+ },
+ "modelVersion": {
+ "type": "string",
+ "description": "This field indicates which model is used for scoring."
+ }
+ }
+ },
+ "DocumentEntities": {
+ "type": "object",
+ "required": [
+ "id",
+ "entities"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique, non-empty document identifier."
+ },
+ "entities": {
+ "type": "array",
+ "description": "Recognized entities in the document.",
+ "items": {
+ "$ref": "#/definitions/Entity"
+ }
+ },
+ "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",
+ "type",
+ "offset",
+ "length",
+ "score"
+ ],
+ "properties": {
+ "text": {
+ "type": "string",
+ "description": "Entity text as appears in the request."
+ },
+ "type": {
+ "type": "string",
+ "description": "Entity type, such as Person/Location/Org/SSN etc"
+ },
+ "subtype": {
+ "type": "string",
+ "description": "Entity sub type, such as Age/Year/TimeRange etc"
+ },
+ "offset": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Start position (in Unicode characters) for the entity text."
+ },
+ "length": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Length (in Unicode characters) for the entity text."
+ },
+ "score": {
+ "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"
+ ],
+ "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"
+ }
+ },
+ "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": [
+ "score",
+ "text",
+ "offset",
+ "length"
+ ],
+ "properties": {
+ "score": {
+ "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 (in Unicode characters) for the entity match text."
+ },
+ "length": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Length (in Unicode characters) 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"
+ ],
+ "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"
+ }
+ },
+ "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"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique, non-empty document identifier."
+ },
+ "detectedLanguages": {
+ "type": "array",
+ "description": "A list of extracted languages.",
+ "items": {
+ "$ref": "#/definitions/DetectedLanguage"
+ }
+ },
+ "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",
+ "score"
+ ],
+ "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)."
+ },
+ "score": {
+ "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.0-preview.1/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json
new file mode 100644
index 000000000000..babd6e22d296
--- /dev/null
+++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntitiesRequest.json
@@ -0,0 +1,88 @@
+{
+ "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",
+ "type": "Location",
+ "offset": 26,
+ "length": 7,
+ "score": 0.8062429428100586
+ },
+ {
+ "text": "last week",
+ "type": "DateTime",
+ "subtype": "DateRange",
+ "offset": 34,
+ "length": 9,
+ "score": 0.8
+ }
+ ]
+ },
+ {
+ "id": "2",
+ "entities": [
+ {
+ "text": "Microsoft",
+ "type": "Organization",
+ "offset": 10,
+ "length": 9,
+ "score": 0.9998359680175781
+ }
+ ]
+ },
+ {
+ "id": "3",
+ "entities": [
+ {
+ "text": "Space Needle",
+ "type": "Organization",
+ "offset": 10,
+ "length": 12,
+ "score": 0.7599651217460632
+ },
+ {
+ "text": "2",
+ "type": "Quantity",
+ "subtype": "Number",
+ "offset": 23,
+ "length": 1,
+ "score": 0.8
+ }
+ ]
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2019-10-01"
+ }
+ }
+ }
+}
diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json
new file mode 100644
index 000000000000..c58af39167b9
--- /dev/null
+++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityLinkingRequest.json
@@ -0,0 +1,96 @@
+{
+ "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,
+ "score": 0.15046201222847677
+ }
+ ],
+ "language": "en",
+ "id": "Seattle",
+ "url": "https://en.wikipedia.org/wiki/Seattle",
+ "dataSource": "Wikipedia"
+ }
+ ]
+ },
+ {
+ "id": "2",
+ "entities": [
+ {
+ "name": "Microsoft",
+ "matches": [
+ {
+ "text": "Microsoft",
+ "offset": 10,
+ "length": 9,
+ "score": 0.1869365971673207
+ }
+ ],
+ "language": "en",
+ "id": "Microsoft",
+ "url": "https://en.wikipedia.org/wiki/Microsoft",
+ "dataSource": "Wikipedia"
+ }
+ ]
+ },
+ {
+ "id": "3",
+ "entities": [
+ {
+ "name": "Space Needle",
+ "matches": [
+ {
+ "text": "Space Needle",
+ "offset": 10,
+ "length": 12,
+ "score": 0.155903620065595
+ }
+ ],
+ "language": "en",
+ "id": "Space Needle",
+ "url": "https://en.wikipedia.org/wiki/Space_Needle",
+ "dataSource": "Wikipedia"
+ }
+ ]
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2019-10-01"
+ }
+ }
+ }
+}
diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json
new file mode 100644
index 000000000000..29cba30d10b6
--- /dev/null
+++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulEntityPIIRequest.json
@@ -0,0 +1,75 @@
+{
+ "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",
+ "type": "U.S. Social Security Number (SSN)",
+ "subtype": "",
+ "offset": 28,
+ "length": 11,
+ "score": 0.65
+ }
+ ]
+ },
+ {
+ "id": "1",
+ "entities": [
+ {
+ "text": "111000025",
+ "type": "ABA Routing Number",
+ "subtype": "",
+ "offset": 18,
+ "length": 9,
+ "score": 0.75
+ }
+ ]
+ },
+ {
+ "id": "2",
+ "entities": [
+ {
+ "text": "998.214.865-68",
+ "type": "Brazil CPF Number",
+ "subtype": "",
+ "offset": 3,
+ "length": 14,
+ "score": 0.85
+ }
+ ]
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2019-10-01"
+ }
+ }
+ }
+}
diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json
new file mode 100644
index 000000000000..4a61dd56c123
--- /dev/null
+++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulKeyPhrasesRequest.json
@@ -0,0 +1,57 @@
+{
+ "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"
+ ]
+ },
+ {
+ "id": "2",
+ "keyPhrases": [
+ "monde"
+ ]
+ },
+ {
+ "id": "3",
+ "keyPhrases": [
+ "carretera",
+ "tráfico",
+ "día"
+ ]
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2019-10-01"
+ }
+ }
+ }
+}
diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json
new file mode 100644
index 000000000000..071bf51ea8c9
--- /dev/null
+++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulLanguagesRequest.json
@@ -0,0 +1,64 @@
+{
+ "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",
+ "score": 1
+ }
+ ]
+ },
+ {
+ "id": "2",
+ "detectedLanguages": [
+ {
+ "name": "French",
+ "iso6391Name": "fr",
+ "score": 1
+ }
+ ]
+ },
+ {
+ "id": "3",
+ "detectedLanguages": [
+ {
+ "name": "Spanish",
+ "iso6391Name": "es",
+ "score": 1
+ }
+ ]
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2019-10-01"
+ }
+ }
+ }
+}
diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json
new file mode 100644
index 000000000000..a61d236644d0
--- /dev/null
+++ b/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.0-preview.1/examples/SuccessfulSentimentRequest.json
@@ -0,0 +1,119 @@
+{
+ "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": "en",
+ "id": "2",
+ "text": "It's incredibly sunny outside! I'm so happy."
+ },
+ {
+ "language": "en",
+ "id": "3",
+ "text": "Pike place market is my favorite Seattle attraction."
+ }
+ ]
+ }
+ },
+ "responses": {
+ "200": {
+ "headers": {},
+ "body": {
+ "documents": [
+ {
+ "id": "1",
+ "sentiment": "positive",
+ "documentScores": {
+ "positive": 0.998519241809845,
+ "neutral": 0.0009635657188483,
+ "negative": 0.000517153472174
+ },
+ "sentences": [
+ {
+ "sentiment": "neutral",
+ "sentenceScores": {
+ "positive": 0.070910170674324,
+ "neutral": 0.9124033451080322,
+ "negative": 0.0166865326464176
+ },
+ "offset": 0,
+ "length": 12
+ },
+ {
+ "sentiment": "positive",
+ "sentenceScores": {
+ "positive": 0.998519241809845,
+ "neutral": 0.0009635657188483,
+ "negative": 0.000517153472174
+ },
+ "offset": 13,
+ "length": 36
+ }
+ ]
+ },
+ {
+ "id": "2",
+ "sentiment": "positive",
+ "documentScores": {
+ "positive": 0.9954571723937988,
+ "neutral": 0.0034653299953789,
+ "negative": 0.0010774657130241
+ },
+ "sentences": [
+ {
+ "sentiment": "neutral",
+ "sentenceScores": {
+ "positive": 0.0499138832092285,
+ "neutral": 0.9387012720108032,
+ "negative": 0.0113849258050323
+ },
+ "offset": 0,
+ "length": 30
+ },
+ {
+ "sentiment": "positive",
+ "sentenceScores": {
+ "positive": 0.9954571723937988,
+ "neutral": 0.0034653299953789,
+ "negative": 0.0010774657130241
+ },
+ "offset": 31,
+ "length": 13
+ }
+ ]
+ },
+ {
+ "id": "3",
+ "sentiment": "positive",
+ "documentScores": {
+ "positive": 0.9965128302574158,
+ "neutral": 0.0018965365597978,
+ "negative": 0.0015906029148027
+ },
+ "sentences": [
+ {
+ "sentiment": "positive",
+ "sentenceScores": {
+ "positive": 0.9965128302574158,
+ "neutral": 0.0018965365597978,
+ "negative": 0.0015906029148027
+ },
+ "offset": 0,
+ "length": 52
+ }
+ ]
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2019-10-01"
+ }
+ }
+ }
+}
diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md
index 60e5b6ad8d9d..aaa4fc2829e7 100644
--- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.md
+++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.md
@@ -149,6 +149,15 @@ input-file: preview/v2.1/TextAnalytics.json
log-file: logs/log.txt
```
+### Release 3.0-Preview.1
+
+These settings apply only when `--tag=release_3_0_preview.1` is specified on the command line.
+
+``` yaml $(tag) == 'release_3_0_preview.1'
+input-file: preview/v3.0-preview.1/TextAnalytics.json
+log-file: logs/log.txt
+```
+
## Swagger to SDK
This section describes what SDK should be generated by the automatic system.
@@ -244,6 +253,7 @@ 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
```