forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move QuestionAnswering 2021-07-15-preview to main (Azure#16411)
* move questionAnswering 2021-07-15-preview to main * update version in examples
- Loading branch information
Showing
27 changed files
with
3,428 additions
and
1 deletion.
There are no files selected for viewing
237 changes: 237 additions & 0 deletions
237
specification/cognitiveservices/data-plane/Language/preview/2021-07-15-preview/common.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-07-15-preview" | ||
}, | ||
"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" | ||
} | ||
} | ||
} |
99 changes: 99 additions & 0 deletions
99
.../preview/2021-07-15-preview/examples/questionanswering/SuccessfulQueryKnowledgebases.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-07-15-preview", | ||
"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" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.