Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions specification/cognitiveservices/data-plane/Language/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ This is the AutoRest configuration file the Cognitive Services Language SDK.

## Releases

The current preview release is 2021-07-15-preview
The current stable release of QuestionAnswering is 2021-10-01 and preview release of Luis Deepstack is 2021-07-15-preview


```yaml
tag: release_2021_10_01
add-credentials: true
clear-output-folder: true
openapi-type: data-plane
```

```yaml
tag: release_2021_07_15_preview
Expand All @@ -21,6 +29,20 @@ add-credentials: true
clear-output-folder: true
```

### Release 2021-10-01

These settings apply only when `--tag=release_2021_10_01` is specified on the command line.

``` yaml $(tag) == 'release_2021_10_01'
input-file:
- stable/2021-10-01/questionanswering.json
- stable/2021-10-01/questionanswering-authoring.json
title:
Microsoft Cognitive Language Service
modelerfour:
lenient-model-deduplication: true
```

### Release 2021-07-15-preview

These settings apply only when `--tag=release_2021_07_15_preview` is specified on the command line.
Expand Down Expand Up @@ -57,6 +79,5 @@ This is not used by Autorest itself.
``` yaml $(swagger-to-sdk)
swagger-to-sdk:
- repo: azure-sdk-for-net
- repo: azure-sdk-for-net-track2
- repo: azure-sdk-for-python
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
{
"swagger": "2.0",
"info": {
"title": "Microsoft Cognitive Language Service",
"description": "The language service API is a suite of natural language processing (NLP) skills 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, language detection and question answering. Further documentation can be found in <a href=\"https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview\">https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview</a>.",
"version": "2021-10-01"
},
"paths": {},
"definitions": {
"ErrorResponse": {
"type": "object",
"description": "Error response.",
"additionalProperties": false,
"properties": {
"error": {
"description": "The error object.",
"$ref": "#/definitions/Error"
}
}
},
"Error": {
"type": "object",
"description": "The error object.",
"additionalProperties": false,
"required": [
"code",
"message"
],
"properties": {
"code": {
"description": "One of a server-defined set of error codes.",
"$ref": "#/definitions/ErrorCode"
},
"message": {
"type": "string",
"description": "A human-readable representation of the error."
},
"target": {
"type": "string",
"description": "The target of the error."
},
"details": {
"type": "array",
"description": "An array of details about specific errors that led to this reported error.",
"items": {
"$ref": "#/definitions/Error"
}
},
"innererror": {
"description": "An object containing more specific information than the current object about the error.",
"$ref": "#/definitions/InnerErrorModel"
}
}
},
"InnerErrorModel": {
"type": "object",
"description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.",
"additionalProperties": false,
"required": [
"code",
"message"
],
"properties": {
"code": {
"description": "One of a server-defined set of error codes.",
"$ref": "#/definitions/InnerErrorCode"
},
"message": {
"type": "string",
"description": "Error message."
},
"details": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Error details."
},
"target": {
"type": "string",
"description": "Error target."
},
"innererror": {
"description": "An object containing more specific information than the current object about the error.",
"$ref": "#/definitions/InnerErrorModel"
}
}
},
"ErrorCode": {
"type": "string",
"description": "Human-readable error code.",
"x-ms-enum": {
"name": "ErrorCode",
"modelAsString": true
},
"enum": [
"InvalidRequest",
"InvalidArgument",
"Unauthorized",
"Forbidden",
"NotFound",
"ProjectNotFound",
"OperationNotFound",
"AzureCognitiveSearchNotFound",
"AzureCognitiveSearchIndexNotFound",
"TooManyRequests",
"AzureCognitiveSearchThrottling",
"AzureCognitiveSearchIndexLimitReached",
"InternalServerError",
"ServiceUnavailable"
]
},
"InnerErrorCode": {
"type": "string",
"description": "Human-readable error code.",
"x-ms-enum": {
"name": "InnerErrorCode",
"modelAsString": true
},
"enum": [
"InvalidRequest",
"InvalidParameterValue",
"KnowledgeBaseNotFound",
"AzureCognitiveSearchNotFound",
"AzureCognitiveSearchThrottling",
"ExtractionFailure"
]
},
"Language": {
"type": "string",
"description": "Language of the text records. This is BCP-47 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default."
},
"StringIndexType": {
"type": "string",
"description": "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."
}
]
}
}
},
"parameters": {
"Endpoint": {
"name": "Endpoint",
"description": "Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).",
"x-ms-parameter-location": "client",
"required": true,
"type": "string",
"in": "path",
"x-ms-skip-url-encoding": true
},
"ProjectNameQueryParameter": {
"name": "projectName",
"in": "query",
"required": true,
"type": "string",
"description": "The name of the project to use.",
"x-ms-parameter-location": "method"
},
"ProjectNamePathParameter": {
"name": "projectName",
"in": "path",
"required": true,
"type": "string",
"maxLength": 100,
"description": "The name of the project to use.",
"x-ms-parameter-location": "method"
},
"DeploymentNameQueryParameter": {
"name": "deploymentName",
"in": "query",
"required": true,
"type": "string",
"description": "The name of the specific deployment of the project to use.",
"x-ms-parameter-location": "method"
},
"DeploymentNamePathParameter": {
"name": "deploymentName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the specific deployment of the project to use.",
"x-ms-parameter-location": "method"
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"required": true,
"type": "string",
"description": "Client API version."
},
"TopParameter": {
"name": "top",
"in": "query",
"description": "The maximum number of resources to return from the collection.",
"type": "integer",
"format": "int32",
"x-ms-parameter-location": "method"
},
"SkipParameter": {
"name": "skip",
"in": "query",
"description": "An offset into the collection of the first resource to be returned.",
"type": "integer",
"format": "int32",
"x-ms-parameter-location": "method"
},
"MaxPageSizeParameter": {
"name": "maxpagesize",
"in": "query",
"description": "The maximum number of resources to include in a single response.",
"type": "integer",
"format": "int32",
"x-ms-parameter-location": "method"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"parameters": {
"Endpoint": "{Endpoint}",
"Ocp-Apim-Subscription-Key": "{API key}",
"Content-Type": "application/json",
"api-version": "2021-10-01",
"projectName": "proj1",
"deploymentName": "production",
"knowledgeBaseQueryOptions": {
"question": "how long it takes to charge surface?",
"top": 3,
"userId": "sd53lsY=",
"confidenceScoreThreshold": 0.20,
"context": {
"previousQnaId": 9,
"previousUserQuery": "Where are QnA Maker quickstarts?"
},
"rankerType": "Default",
"filters": {
"metadataFilter": {
"metadata": [
{
"key": "category",
"value": "api"
},
{
"key": "editorial",
"value": "chitchat"
}
],
"logicalOperation": "AND"
},
"sourceFilter": [
"filename1.pdf",
"https://www.wikipedia.org/microsoft"
],
"logicalOperation": "AND"
},
"answerSpanRequest": {
"enable": true,
"confidenceScoreThreshold": 0.20,
"topAnswersWithSpan": 1
},
"includeUnstructuredSources": true
}
},
"responses": {
"200": {
"headers": {},
"body": {
"answers": [
{
"questions": [
"Power and charging"
],
"answer": "Power and charging**\n\nIt takes two to four hours to charge the Surface Pro 4 battery fully from an empty state. It can take longer if you’re using your Surface for power-intensive activities like gaming or video streaming while you’re charging it.\n\nYou can use the USB port on your Surface Pro 4 power supply to charge other devices, like a phone, while your Surface charges. The USB port on the power supply is only for charging, not for data transfer. If you want to use a USB device, plug it into the USB port on your Surface.",
"confidenceScore": 0.65,
"id": 20,
"source": "surface-pro-4-user-guide-EN.pdf",
"metadata": {
"category": "api",
"editorial": "chitchat"
},
"dialog": {
"isContextOnly": false,
"prompts": [
{
"displayOrder": 1,
"qnaId": 23,
"displayText": "prompt1"
},
{
"displayOrder": 2,
"qnaId": 36,
"displayText": "prompt2"
}
]
},
"answerSpan": {
"text": "two to four hours",
"confidenceScore": 0.30,
"offset": 33,
"length": 50
}
},
{
"questions": [
"Charge your Surface Pro 4"
],
"answer": "**Charge your Surface Pro 4**\n\n1. Connect the two parts of the power cord.\n\n2. Connect the power cord securely to the charging port.\n\n3. Plug the power supply into an electrical outlet.",
"confidenceScore": 0.32,
"id": 13,
"source": "surface-pro-4-user-guide-EN.pdf"
}
]
}
}
}
}
Loading