Skip to content

Commit

Permalink
Language API for TA (2022-03-01-preview) (Azure#17281)
Browse files Browse the repository at this point in the history
* Add blockchain to latest profile

* Add additional types

* WIP for language api spec for TA

* Updated preview version number; finished up async definitions

* Finished first draft of full spec

* Finished first draft of full spec, minus FHIR structuring in HC output

* Removed features not included in 2021-11-01 preview

* Update custom text tasks TODOs

* Moved common definitions to TA-specific definitions

* Added custom text tasks to JobManifest

* Addressing feedback from PR comments and internal review

* Addressed some PR comments

* Updated some remaining references to documents

* PR comments

* Updated a previous change

* Reverted references to 'records' back to 'documents'

* A few small updates to examples; removed base Task type to simplify structure

* PR comments

* Addressed TODO items; removed LD-related objects (will be added in another preview)

* Fixed anonymous types

* Removed required field for body in POST request

* Fix prettier check

* Added a few more details; experimental change for documents property

* Ran prettier

* Correction to AnalysisInput object

* Merged changes from 2021-11-01-preview and moved new changes to 2022-02-01

* PR comments

* Updates to the design for tasks

* Added custom entities task to examples

* Updates

* Finished implementation of discriminator pattern and added some exmaples

* Updates

* Prettier

* Fixed semantic validation errors

* Fixed model validation

* Another model validation fix

* Debugging model validation errors

* Using a different discriminator enum for output schemas

* Fixed some missing discriminator updates

* More semantic validation fixes

* Fixed model validation errors; updated sample names

* Fixed linting errors and addressed some warnings in the linter output

* Ran prettier on examples

* PR comments and some minor restructuring

* Ran prettier

* Removed a duplicate schema from CustomEntitiesTaskParameters

* PR comments

* PR comments

* PR comments

* Added missing job task status 'partiallySucceeded'

* Added preview folder for 2022-03-01-preview

* Added delete and cancel operations for jobs

* Added some examples for delete and cancel; updated samples for new preview

* Incorporating feedback from the API review

* fix naming consistency (#1)

* naming updates

* fix typo

* Fixed one last merge conflict

* naming fix (#2)

* Fixed a ref

* Ran prettier on all files

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
Co-authored-by: Abigail Hartman <Abigail.Hartman@microsoft.com>
Co-authored-by: Kareem Yousef <kayousef@microsoft.com>
Co-authored-by: Abby Hartman <abhahn@microsoft.com>
Co-authored-by: Mohamed Shaban <official.mohamedshaban@gmail.com>
  • Loading branch information
6 people authored Mar 17, 2022
1 parent 8d186bf commit 472892b
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"parameters": {
"Ocp-Apim-Subscription-Key": "{API key}",
"ApiVersion": "2022-03-01-preview",
"Endpoint": "{Endpoint}",
"jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"
},
"responses": {
"202": {
"headers": {
"Operation-Location": "{Endpoint}/language/analyze-text/jobs/{jobId}?api-version=2022-03-01-preview"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,43 @@
}
}
}
},
"/analyze-text/jobs/{jobId}:cancel": {
"post": {
"produces": [
"application/json"
],
"description": "Cancel a long-running Text Analysis job.",
"operationId": "AnalyzeText_CancelJob",
"summary": "Cancel a long-running Text Analysis job",
"parameters": [
{
"$ref": "#/parameters/JobId"
}
],
"responses": {
"202": {
"description": "Cancel Job request has been received.",
"headers": {
"Operation-Location": {
"type": "string"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "common.json#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Successful Job Delete Request": {
"$ref": ".//examples//SuccessfulAnalyzeTextJobsCancelRequest.json"
}
},
"x-ms-long-running-operation": true
}
}
},
"definitions": {
Expand Down Expand Up @@ -217,8 +254,8 @@
"Healthcare",
"ExtractiveSummarization",
"CustomEntityRecognition",
"CustomSingleClassification",
"CustomMultiClassification"
"CustomSingleLabelClassification",
"CustomMultiLabelClassification"
],
"x-ms-enum": {
"name": "AnalyzeTextLROTaskKind",
Expand Down Expand Up @@ -253,8 +290,8 @@
"HealthcareLROResults",
"ExtractiveSummarizationLROResults",
"CustomEntityRecognitionLROResults",
"CustomSingleClassificationLROResults",
"CustomMultiClassificationLROResults"
"CustomSingleLabelClassificationLROResults",
"CustomMultiLabelClassificationLROResults"
],
"x-ms-enum": {
"name": "AnalyzeTextLROResultsKind",
Expand Down Expand Up @@ -594,7 +631,7 @@
"documents"
]
},
"CustomSingleClassificationTaskParameters": {
"CustomSingleLabelClassificationTaskParameters": {
"type": "object",
"description": "Supported parameters for a Custom Single Classification task.",
"allOf": [
Expand All @@ -603,22 +640,22 @@
}
]
},
"CustomSingleClassificationLROTask": {
"CustomSingleLabelClassificationLROTask": {
"type": "object",
"description": "Use custom models to classify text into single label taxonomy",
"properties": {
"parameters": {
"$ref": "#/definitions/CustomSingleClassificationTaskParameters"
"$ref": "#/definitions/CustomSingleLabelClassificationTaskParameters"
}
},
"allOf": [
{
"$ref": "#/definitions/AnalyzeTextLROTask"
}
],
"x-ms-discriminator-value": "CustomSingleClassification"
"x-ms-discriminator-value": "CustomSingleLabelClassification"
},
"CustomSingleClassificationResult": {
"CustomSingleLabelClassificationResult": {
"type": "object",
"properties": {
"documents": {
Expand All @@ -645,7 +682,7 @@
"SingleClassificationDocumentResult": {
"type": "object",
"properties": {
"classification": {
"class": {
"$ref": "#/definitions/ClassificationResult"
}
},
Expand All @@ -655,7 +692,7 @@
}
],
"required": [
"classification"
"class"
]
},
"ClassificationResult": {
Expand All @@ -672,11 +709,11 @@
"confidenceScore": {
"type": "number",
"format": "double",
"description": "Confidence score between 0 and 1 of the recognized classification."
"description": "Confidence score between 0 and 1 of the recognized class."
}
}
},
"CustomMultiClassificationTaskParameters": {
"CustomMultiLabelClassificationTaskParameters": {
"type": "object",
"description": "Supported parameters for a Custom Multi Classification task.",
"allOf": [
Expand All @@ -685,22 +722,22 @@
}
]
},
"CustomMultiClassificationLROTask": {
"CustomMultiLabelClassificationLROTask": {
"type": "object",
"description": "Use custom models to classify text into multi label taxonomy",
"properties": {
"parameters": {
"$ref": "#/definitions/CustomMultiClassificationTaskParameters"
"$ref": "#/definitions/CustomMultiLabelClassificationTaskParameters"
}
},
"allOf": [
{
"$ref": "#/definitions/AnalyzeTextLROTask"
}
],
"x-ms-discriminator-value": "CustomMultiClassification"
"x-ms-discriminator-value": "CustomMultiLabelClassification"
},
"CustomMultiClassificationResult": {
"CustomMultiLabelClassificationResult": {
"type": "object",
"properties": {
"documents": {
Expand All @@ -727,7 +764,7 @@
"MultiClassificationDocumentResult": {
"type": "object",
"properties": {
"classifications": {
"class": {
"type": "array",
"items": {
"$ref": "#/definitions/ClassificationResult"
Expand All @@ -740,7 +777,7 @@
}
],
"required": [
"classifications"
"class"
]
},
"HealthcareTaskParameters": {
Expand Down Expand Up @@ -2524,11 +2561,11 @@
],
"x-ms-discriminator-value": "CustomEntityRecognitionLROResults"
},
"CustomSingleClassificationLROResult": {
"CustomSingleLabelClassificationLROResult": {
"type": "object",
"properties": {
"results": {
"$ref": "#/definitions/CustomSingleClassificationResult"
"$ref": "#/definitions/CustomSingleLabelClassificationResult"
}
},
"allOf": [
Expand All @@ -2539,13 +2576,13 @@
"required": [
"results"
],
"x-ms-discriminator-value": "CustomSingleClassificationLROResults"
"x-ms-discriminator-value": "CustomSingleLabelClassificationLROResults"
},
"CustomMultiClassificationLROResult": {
"CustomMultiLabelClassificationLROResult": {
"type": "object",
"properties": {
"results": {
"$ref": "#/definitions/CustomMultiClassificationResult"
"$ref": "#/definitions/CustomMultiLabelClassificationResult"
}
},
"allOf": [
Expand All @@ -2556,7 +2593,7 @@
"required": [
"results"
],
"x-ms-discriminator-value": "CustomMultiClassificationLROResults"
"x-ms-discriminator-value": "CustomMultiLabelClassificationLROResults"
},
"EntityLinkingLROResult": {
"type": "object",
Expand Down

0 comments on commit 472892b

Please sign in to comment.