From 89f97db393af3d6b0ce471c0729daccbe2aa35dc Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Mon, 21 Jun 2021 23:44:42 -0700 Subject: [PATCH 01/25] Add TrainingStatus Schema --- openapi/commons/components/schemas/TrainingStatus.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 openapi/commons/components/schemas/TrainingStatus.yaml diff --git a/openapi/commons/components/schemas/TrainingStatus.yaml b/openapi/commons/components/schemas/TrainingStatus.yaml new file mode 100644 index 00000000..3e9a2c93 --- /dev/null +++ b/openapi/commons/components/schemas/TrainingStatus.yaml @@ -0,0 +1,5 @@ +type: string +enum: + - not yet started + - ongoing + - finished \ No newline at end of file From f33242100c4f7647e902f7cf0fa1fbe3608ebb59 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Mon, 21 Jun 2021 23:52:31 -0700 Subject: [PATCH 02/25] Add Training Endpoints to Date, Location, and Name Annotators --- openapi/date-annotator/openapi.yaml | 4 ++++ .../paths/textDateAnnotatorTrain.yaml | 19 +++++++++++++++++++ .../textDateAnnotatorTrainingStatus.yaml | 17 +++++++++++++++++ openapi/location-annotator/openapi.yaml | 4 ++++ .../paths/textLocationAnnotatorTrain.yaml | 19 +++++++++++++++++++ .../textLocationAnnotatorTrainingStatus.yaml | 17 +++++++++++++++++ openapi/person-name-annotator/openapi.yaml | 4 ++++ .../paths/textPersonNameAnnotatorTrain.yaml | 19 +++++++++++++++++++ ...textPersonNameAnnotatorTrainingStatus.yaml | 17 +++++++++++++++++ 9 files changed, 120 insertions(+) create mode 100644 openapi/date-annotator/paths/textDateAnnotatorTrain.yaml create mode 100644 openapi/date-annotator/paths/textDateAnnotatorTrainingStatus.yaml create mode 100644 openapi/location-annotator/paths/textLocationAnnotatorTrain.yaml create mode 100644 openapi/location-annotator/paths/textLocationAnnotatorTrainingStatus.yaml create mode 100644 openapi/person-name-annotator/paths/textPersonNameAnnotatorTrain.yaml create mode 100644 openapi/person-name-annotator/paths/textPersonNameAnnotatorTrainingStatus.yaml diff --git a/openapi/date-annotator/openapi.yaml b/openapi/date-annotator/openapi.yaml index 55ad4d26..59ef0254 100644 --- a/openapi/date-annotator/openapi.yaml +++ b/openapi/date-annotator/openapi.yaml @@ -68,6 +68,10 @@ paths: $ref: ../commons/paths/healthCheck.yaml /textDateAnnotations: $ref: paths/textDateAnnotations.yaml + /textDateAnnotatorTrain: + $ref: paths/textDateAnnotatorTrain.yaml + /textDateAnnotatorTrainingStatus: + $ref: paths/textDateAnnotatorTrainingStatus.yaml /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: diff --git a/openapi/date-annotator/paths/textDateAnnotatorTrain.yaml b/openapi/date-annotator/paths/textDateAnnotatorTrain.yaml new file mode 100644 index 00000000..e55681cd --- /dev/null +++ b/openapi/date-annotator/paths/textDateAnnotatorTrain.yaml @@ -0,0 +1,19 @@ +post: + tags: + - Training + summary: Initiate annotator training (async) + description: Start training the tool's annotation model + operationId: textDateAnnotatorTrain + responses: + '201': + description: Training initialized + content: + application/json: + schema: + links: + GetTrainingStatus: + operationId: textDateAnnotatorTrainingStatus + '404': + $ref: ../components/responses/NotFound.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml diff --git a/openapi/date-annotator/paths/textDateAnnotatorTrainingStatus.yaml b/openapi/date-annotator/paths/textDateAnnotatorTrainingStatus.yaml new file mode 100644 index 00000000..f0183046 --- /dev/null +++ b/openapi/date-annotator/paths/textDateAnnotatorTrainingStatus.yaml @@ -0,0 +1,17 @@ +get: + tags: + - Training + summary: Get status of annotator training + description: Start training the tool's annotation model + operationId: textDateAnnotatorTrainingStatus + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../commons/components/schemas/TrainingStatus.yaml + '404': + $ref: ../components/responses/NotFound.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml diff --git a/openapi/location-annotator/openapi.yaml b/openapi/location-annotator/openapi.yaml index a1e2cbe9..85cbb51d 100644 --- a/openapi/location-annotator/openapi.yaml +++ b/openapi/location-annotator/openapi.yaml @@ -66,6 +66,10 @@ paths: $ref: ../commons/paths/healthCheck.yaml /textLocationAnnotations: $ref: paths/textLocationAnnotations.yaml + /textLocationAnnotatorTrain: + $ref: paths/textLocationAnnotatorTrain.yaml + /textLocationAnnotatorTrainingStatus: + $ref: paths/textLocationAnnotatorTrainingStatus.yaml /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: diff --git a/openapi/location-annotator/paths/textLocationAnnotatorTrain.yaml b/openapi/location-annotator/paths/textLocationAnnotatorTrain.yaml new file mode 100644 index 00000000..58d2a07f --- /dev/null +++ b/openapi/location-annotator/paths/textLocationAnnotatorTrain.yaml @@ -0,0 +1,19 @@ +post: + tags: + - Training + summary: Initiate annotator training (async) + description: Start training the tool's annotation model + operationId: textLocationAnnotatorTrain + responses: + '201': + description: Training initialized + content: + application/json: + schema: + links: + GetTrainingStatus: + operationId: textLocationAnnotatorTrainingStatus + '404': + $ref: ../components/responses/NotFound.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml diff --git a/openapi/location-annotator/paths/textLocationAnnotatorTrainingStatus.yaml b/openapi/location-annotator/paths/textLocationAnnotatorTrainingStatus.yaml new file mode 100644 index 00000000..f628d093 --- /dev/null +++ b/openapi/location-annotator/paths/textLocationAnnotatorTrainingStatus.yaml @@ -0,0 +1,17 @@ +get: + tags: + - Training + summary: Get status of annotator training + description: Start training the tool's annotation model + operationId: textLocationAnnotatorTrainingStatus + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../commons/components/schemas/TrainingStatus.yaml + '404': + $ref: ../components/responses/NotFound.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml diff --git a/openapi/person-name-annotator/openapi.yaml b/openapi/person-name-annotator/openapi.yaml index 149d46bf..e10dfb7f 100644 --- a/openapi/person-name-annotator/openapi.yaml +++ b/openapi/person-name-annotator/openapi.yaml @@ -66,6 +66,10 @@ paths: $ref: ../commons/paths/healthCheck.yaml /textPersonNameAnnotations: $ref: paths/textPersonNameAnnotations.yaml + /textPersonNameAnnotatorTrain: + $ref: paths/textPersonNameAnnotatorTrain.yaml + /textPersonNameAnnotatorTrainingStatus: + $ref: paths/textPersonNameAnnotatorTrainingStatus.yaml /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: diff --git a/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrain.yaml b/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrain.yaml new file mode 100644 index 00000000..54a53e5e --- /dev/null +++ b/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrain.yaml @@ -0,0 +1,19 @@ +post: + tags: + - Training + summary: Initiate annotator training (async) + description: Start training the tool's annotation model + operationId: textPersonNameAnnotatorTrain + responses: + '201': + description: Training initialized + content: + application/json: + schema: + links: + GetTrainingStatus: + operationId: textPersonNameAnnotatorTrainingStatus + '404': + $ref: ../components/responses/NotFound.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml diff --git a/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrainingStatus.yaml b/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrainingStatus.yaml new file mode 100644 index 00000000..9285ed48 --- /dev/null +++ b/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrainingStatus.yaml @@ -0,0 +1,17 @@ +get: + tags: + - Training + summary: Get status of annotator training + description: Start training the tool's annotation model + operationId: textPersonNameAnnotatorTrainingStatus + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../commons/components/schemas/TrainingStatus.yaml + '404': + $ref: ../components/responses/NotFound.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml From 720fc2cfd3ef13cdee937a15a815092729bbd91c Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Tue, 22 Jun 2021 01:15:28 -0700 Subject: [PATCH 03/25] Revert "Add Training Endpoints to Date, Location, and Name Annotators" This reverts commit f33242100c4f7647e902f7cf0fa1fbe3608ebb59. --- openapi/date-annotator/openapi.yaml | 4 ---- .../paths/textDateAnnotatorTrain.yaml | 19 ------------------- .../textDateAnnotatorTrainingStatus.yaml | 17 ----------------- openapi/location-annotator/openapi.yaml | 4 ---- .../paths/textLocationAnnotatorTrain.yaml | 19 ------------------- .../textLocationAnnotatorTrainingStatus.yaml | 17 ----------------- openapi/person-name-annotator/openapi.yaml | 4 ---- .../paths/textPersonNameAnnotatorTrain.yaml | 19 ------------------- ...textPersonNameAnnotatorTrainingStatus.yaml | 17 ----------------- 9 files changed, 120 deletions(-) delete mode 100644 openapi/date-annotator/paths/textDateAnnotatorTrain.yaml delete mode 100644 openapi/date-annotator/paths/textDateAnnotatorTrainingStatus.yaml delete mode 100644 openapi/location-annotator/paths/textLocationAnnotatorTrain.yaml delete mode 100644 openapi/location-annotator/paths/textLocationAnnotatorTrainingStatus.yaml delete mode 100644 openapi/person-name-annotator/paths/textPersonNameAnnotatorTrain.yaml delete mode 100644 openapi/person-name-annotator/paths/textPersonNameAnnotatorTrainingStatus.yaml diff --git a/openapi/date-annotator/openapi.yaml b/openapi/date-annotator/openapi.yaml index 59ef0254..55ad4d26 100644 --- a/openapi/date-annotator/openapi.yaml +++ b/openapi/date-annotator/openapi.yaml @@ -68,10 +68,6 @@ paths: $ref: ../commons/paths/healthCheck.yaml /textDateAnnotations: $ref: paths/textDateAnnotations.yaml - /textDateAnnotatorTrain: - $ref: paths/textDateAnnotatorTrain.yaml - /textDateAnnotatorTrainingStatus: - $ref: paths/textDateAnnotatorTrainingStatus.yaml /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: diff --git a/openapi/date-annotator/paths/textDateAnnotatorTrain.yaml b/openapi/date-annotator/paths/textDateAnnotatorTrain.yaml deleted file mode 100644 index e55681cd..00000000 --- a/openapi/date-annotator/paths/textDateAnnotatorTrain.yaml +++ /dev/null @@ -1,19 +0,0 @@ -post: - tags: - - Training - summary: Initiate annotator training (async) - description: Start training the tool's annotation model - operationId: textDateAnnotatorTrain - responses: - '201': - description: Training initialized - content: - application/json: - schema: - links: - GetTrainingStatus: - operationId: textDateAnnotatorTrainingStatus - '404': - $ref: ../components/responses/NotFound.yaml - '500': - $ref: ../components/responses/InternalServerError.yaml diff --git a/openapi/date-annotator/paths/textDateAnnotatorTrainingStatus.yaml b/openapi/date-annotator/paths/textDateAnnotatorTrainingStatus.yaml deleted file mode 100644 index f0183046..00000000 --- a/openapi/date-annotator/paths/textDateAnnotatorTrainingStatus.yaml +++ /dev/null @@ -1,17 +0,0 @@ -get: - tags: - - Training - summary: Get status of annotator training - description: Start training the tool's annotation model - operationId: textDateAnnotatorTrainingStatus - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: ../../commons/components/schemas/TrainingStatus.yaml - '404': - $ref: ../components/responses/NotFound.yaml - '500': - $ref: ../components/responses/InternalServerError.yaml diff --git a/openapi/location-annotator/openapi.yaml b/openapi/location-annotator/openapi.yaml index 85cbb51d..a1e2cbe9 100644 --- a/openapi/location-annotator/openapi.yaml +++ b/openapi/location-annotator/openapi.yaml @@ -66,10 +66,6 @@ paths: $ref: ../commons/paths/healthCheck.yaml /textLocationAnnotations: $ref: paths/textLocationAnnotations.yaml - /textLocationAnnotatorTrain: - $ref: paths/textLocationAnnotatorTrain.yaml - /textLocationAnnotatorTrainingStatus: - $ref: paths/textLocationAnnotatorTrainingStatus.yaml /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: diff --git a/openapi/location-annotator/paths/textLocationAnnotatorTrain.yaml b/openapi/location-annotator/paths/textLocationAnnotatorTrain.yaml deleted file mode 100644 index 58d2a07f..00000000 --- a/openapi/location-annotator/paths/textLocationAnnotatorTrain.yaml +++ /dev/null @@ -1,19 +0,0 @@ -post: - tags: - - Training - summary: Initiate annotator training (async) - description: Start training the tool's annotation model - operationId: textLocationAnnotatorTrain - responses: - '201': - description: Training initialized - content: - application/json: - schema: - links: - GetTrainingStatus: - operationId: textLocationAnnotatorTrainingStatus - '404': - $ref: ../components/responses/NotFound.yaml - '500': - $ref: ../components/responses/InternalServerError.yaml diff --git a/openapi/location-annotator/paths/textLocationAnnotatorTrainingStatus.yaml b/openapi/location-annotator/paths/textLocationAnnotatorTrainingStatus.yaml deleted file mode 100644 index f628d093..00000000 --- a/openapi/location-annotator/paths/textLocationAnnotatorTrainingStatus.yaml +++ /dev/null @@ -1,17 +0,0 @@ -get: - tags: - - Training - summary: Get status of annotator training - description: Start training the tool's annotation model - operationId: textLocationAnnotatorTrainingStatus - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: ../../commons/components/schemas/TrainingStatus.yaml - '404': - $ref: ../components/responses/NotFound.yaml - '500': - $ref: ../components/responses/InternalServerError.yaml diff --git a/openapi/person-name-annotator/openapi.yaml b/openapi/person-name-annotator/openapi.yaml index e10dfb7f..149d46bf 100644 --- a/openapi/person-name-annotator/openapi.yaml +++ b/openapi/person-name-annotator/openapi.yaml @@ -66,10 +66,6 @@ paths: $ref: ../commons/paths/healthCheck.yaml /textPersonNameAnnotations: $ref: paths/textPersonNameAnnotations.yaml - /textPersonNameAnnotatorTrain: - $ref: paths/textPersonNameAnnotatorTrain.yaml - /textPersonNameAnnotatorTrainingStatus: - $ref: paths/textPersonNameAnnotatorTrainingStatus.yaml /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: diff --git a/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrain.yaml b/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrain.yaml deleted file mode 100644 index 54a53e5e..00000000 --- a/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrain.yaml +++ /dev/null @@ -1,19 +0,0 @@ -post: - tags: - - Training - summary: Initiate annotator training (async) - description: Start training the tool's annotation model - operationId: textPersonNameAnnotatorTrain - responses: - '201': - description: Training initialized - content: - application/json: - schema: - links: - GetTrainingStatus: - operationId: textPersonNameAnnotatorTrainingStatus - '404': - $ref: ../components/responses/NotFound.yaml - '500': - $ref: ../components/responses/InternalServerError.yaml diff --git a/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrainingStatus.yaml b/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrainingStatus.yaml deleted file mode 100644 index 9285ed48..00000000 --- a/openapi/person-name-annotator/paths/textPersonNameAnnotatorTrainingStatus.yaml +++ /dev/null @@ -1,17 +0,0 @@ -get: - tags: - - Training - summary: Get status of annotator training - description: Start training the tool's annotation model - operationId: textPersonNameAnnotatorTrainingStatus - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: ../../commons/components/schemas/TrainingStatus.yaml - '404': - $ref: ../components/responses/NotFound.yaml - '500': - $ref: ../components/responses/InternalServerError.yaml From eb58bbee8527ee9a44fad79d123bf9f037988c13 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Tue, 22 Jun 2021 17:08:24 -0700 Subject: [PATCH 04/25] Add Info re: Trained Annotator to Schema --- openapi/commons/components/schemas/Tool.yaml | 9 +++++++++ .../components/schemas/TrainedAnnotatorStatus.yaml | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml diff --git a/openapi/commons/components/schemas/Tool.yaml b/openapi/commons/components/schemas/Tool.yaml index 5f4c3d4b..8d361088 100644 --- a/openapi/commons/components/schemas/Tool.yaml +++ b/openapi/commons/components/schemas/Tool.yaml @@ -32,6 +32,14 @@ properties: description: The URL to the homepage of the tool type: string format: uri + trainable: + description: Whether the tool implements trainability + type: boolean + default: false + trainedAnnotatorStatus: + description: Information about the trained component of the annotator + schema: + $ref: TrainedAnnotatorStatus.yaml type: $ref: ../parameters/ToolType.yaml apiVersion: @@ -50,6 +58,7 @@ required: - url - type - apiVersion + - trainable example: name: awesome-nlp-tool version: 1.0.6 diff --git a/openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml b/openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml new file mode 100644 index 00000000..33f636ee --- /dev/null +++ b/openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml @@ -0,0 +1,9 @@ +type: object +description: Information about whether the annotator is using a trained model, and which one it is +properties: + loaded: + description: Whether the annotator is using a trained model + type: boolean + dataset: + description: Which dataset the annotator's trained model was trained on + type: string \ No newline at end of file From 833ae72604c9c6e3e3bf8218a508361fa4a69695 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Tue, 22 Jun 2021 20:14:33 -0700 Subject: [PATCH 05/25] Add Description to TrainingStatus --- openapi/commons/components/schemas/TrainingStatus.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/openapi/commons/components/schemas/TrainingStatus.yaml b/openapi/commons/components/schemas/TrainingStatus.yaml index 3e9a2c93..e4e05d4e 100644 --- a/openapi/commons/components/schemas/TrainingStatus.yaml +++ b/openapi/commons/components/schemas/TrainingStatus.yaml @@ -1,4 +1,5 @@ type: string +description: Whether this annotator instance has been used to generate a trained model enum: - not yet started - ongoing From f12ad401355c2671e1e56c10710c2c7f616fd66e Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Tue, 22 Jun 2021 20:16:28 -0700 Subject: [PATCH 06/25] Add Endpoint for Starting Annotator Training --- openapi/commons/paths/trainAnnotator.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 openapi/commons/paths/trainAnnotator.yaml diff --git a/openapi/commons/paths/trainAnnotator.yaml b/openapi/commons/paths/trainAnnotator.yaml new file mode 100644 index 00000000..95fee7ac --- /dev/null +++ b/openapi/commons/paths/trainAnnotator.yaml @@ -0,0 +1,23 @@ +post: + tags: + - Training + summary: Initiate annotator training (async) + description: Start training the tool's annotation model + operationId: trainAnnotator + requestBody: + content: + application/json: + schema: + responses: + '201': + description: Training initialized + content: + application/json: + schema: + links: + GetTrainingStatus: + operationId: annotatorTrainingStatus + '404': + $ref: ../components/responses/NotFound.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml From c484380cfb6cfd531f5c1eb6265078e85e2e63cd Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Tue, 22 Jun 2021 23:00:32 -0700 Subject: [PATCH 07/25] Add Training Status URL --- .../commons/paths/annotatorTrainingStatus.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 openapi/commons/paths/annotatorTrainingStatus.yaml diff --git a/openapi/commons/paths/annotatorTrainingStatus.yaml b/openapi/commons/paths/annotatorTrainingStatus.yaml new file mode 100644 index 00000000..cbbb2b0d --- /dev/null +++ b/openapi/commons/paths/annotatorTrainingStatus.yaml @@ -0,0 +1,17 @@ +get: + tags: + - Training + summary: Get status of annotator training + description: Get status of the tool's training process (404 if annotator is not trainable) + operationId: getAnnotatorTrainingStatus + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../components/schemas/TrainingStatus.yaml + '404': + $ref: ../components/responses/NotFound.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml From 07db3b8ce887a0fa80de6106586a72501b53238a Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Tue, 22 Jun 2021 23:00:47 -0700 Subject: [PATCH 08/25] Add Model-Loading Endpoint --- .../commons/paths/loadTrainedAnnotator.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 openapi/commons/paths/loadTrainedAnnotator.yaml diff --git a/openapi/commons/paths/loadTrainedAnnotator.yaml b/openapi/commons/paths/loadTrainedAnnotator.yaml new file mode 100644 index 00000000..fc61bb45 --- /dev/null +++ b/openapi/commons/paths/loadTrainedAnnotator.yaml @@ -0,0 +1,21 @@ +post: + tags: + - Training + summary: Load the results of training + description: Load the results of training (e.g. a machine learning model) into memory from mounted volume + operationId: loadTrainedAnnotator + responses: + '201': + description: Trained annotator loaded + content: + application/json: + schema: + links: + GetTrainingStatus: + operationId: getAnnotatorTrainingStatus + '403': + $ref: ../components/response/Unauthorized.yaml + '404': + $ref: ../components/responses/NotFound.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml From f29ed6f9bbafb0d8e49f86c0d01e84885c09f6f7 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Tue, 22 Jun 2021 23:05:45 -0700 Subject: [PATCH 09/25] Refactor bad `schema` Property of Tool --- openapi/commons/components/schemas/Tool.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openapi/commons/components/schemas/Tool.yaml b/openapi/commons/components/schemas/Tool.yaml index 8d361088..0022310f 100644 --- a/openapi/commons/components/schemas/Tool.yaml +++ b/openapi/commons/components/schemas/Tool.yaml @@ -38,8 +38,7 @@ properties: default: false trainedAnnotatorStatus: description: Information about the trained component of the annotator - schema: - $ref: TrainedAnnotatorStatus.yaml + $ref: TrainedAnnotatorStatus.yaml type: $ref: ../parameters/ToolType.yaml apiVersion: From 1032397c1db72062f6bbbf57486a8e9f9e02a9c3 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Tue, 22 Jun 2021 23:09:20 -0700 Subject: [PATCH 10/25] Add `trainable` Property to Example `Tool` --- openapi/commons/components/schemas/Tool.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/openapi/commons/components/schemas/Tool.yaml b/openapi/commons/components/schemas/Tool.yaml index 0022310f..dbc29812 100644 --- a/openapi/commons/components/schemas/Tool.yaml +++ b/openapi/commons/components/schemas/Tool.yaml @@ -67,5 +67,6 @@ example: author: Awesome Team authorEmail: author@example.com url: https://example.com + trainable: false type: nlpsandbox:date-annotator apiVersion: 1.2.0 \ No newline at end of file From 7b684dcd2bb079f3225f8141940eb697126866ab Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Tue, 22 Jun 2021 23:27:53 -0700 Subject: [PATCH 11/25] Remove Empty Request & Response Bodies --- openapi/commons/paths/loadTrainedAnnotator.yaml | 5 +---- openapi/commons/paths/trainAnnotator.yaml | 7 ------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/openapi/commons/paths/loadTrainedAnnotator.yaml b/openapi/commons/paths/loadTrainedAnnotator.yaml index fc61bb45..f199d22c 100644 --- a/openapi/commons/paths/loadTrainedAnnotator.yaml +++ b/openapi/commons/paths/loadTrainedAnnotator.yaml @@ -7,14 +7,11 @@ post: responses: '201': description: Trained annotator loaded - content: - application/json: - schema: links: GetTrainingStatus: operationId: getAnnotatorTrainingStatus '403': - $ref: ../components/response/Unauthorized.yaml + $ref: ../components/responses/Unauthorized.yaml '404': $ref: ../components/responses/NotFound.yaml '500': diff --git a/openapi/commons/paths/trainAnnotator.yaml b/openapi/commons/paths/trainAnnotator.yaml index 95fee7ac..fbdb5f30 100644 --- a/openapi/commons/paths/trainAnnotator.yaml +++ b/openapi/commons/paths/trainAnnotator.yaml @@ -4,16 +4,9 @@ post: summary: Initiate annotator training (async) description: Start training the tool's annotation model operationId: trainAnnotator - requestBody: - content: - application/json: - schema: responses: '201': description: Training initialized - content: - application/json: - schema: links: GetTrainingStatus: operationId: annotatorTrainingStatus From e8639bae5ad69e1b6873dedf7770d1f7c4d84463 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Tue, 22 Jun 2021 23:30:43 -0700 Subject: [PATCH 12/25] Add Training Paths to Annotator Specs --- openapi/contact-annotator/openapi.yaml | 6 ++++++ openapi/covid-symptom-annotator/openapi.yaml | 8 +++++++- openapi/date-annotator/openapi.yaml | 8 +++++++- openapi/id-annotator/openapi.yaml | 8 +++++++- openapi/location-annotator/openapi.yaml | 8 +++++++- openapi/person-name-annotator/openapi.yaml | 8 +++++++- openapi/phi-annotator/openapi.yaml | 6 ++++++ 7 files changed, 47 insertions(+), 5 deletions(-) diff --git a/openapi/contact-annotator/openapi.yaml b/openapi/contact-annotator/openapi.yaml index 39afdc5d..d91d2da6 100644 --- a/openapi/contact-annotator/openapi.yaml +++ b/openapi/contact-annotator/openapi.yaml @@ -70,3 +70,9 @@ paths: $ref: ../commons/paths/tool.yaml /tool/dependencies: $ref: ../commons/paths/dependencies.yaml + /train: + $ref: ../commons/paths/trainAnnotator.yaml + /train/status: + $ref: ../commons/paths/annotatorTrainingStatus.yaml + /train/load: + $ref: ../commons/paths/loadTrainedAnnotator.yaml diff --git a/openapi/covid-symptom-annotator/openapi.yaml b/openapi/covid-symptom-annotator/openapi.yaml index c8cd7f58..38a88389 100644 --- a/openapi/covid-symptom-annotator/openapi.yaml +++ b/openapi/covid-symptom-annotator/openapi.yaml @@ -70,4 +70,10 @@ paths: /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: - $ref: ../commons/paths/dependencies.yaml \ No newline at end of file + $ref: ../commons/paths/dependencies.yaml + /train: + $ref: ../commons/paths/trainAnnotator.yaml + /train/status: + $ref: ../commons/paths/annotatorTrainingStatus.yaml + /train/load: + $ref: ../commons/paths/loadTrainedAnnotator.yaml \ No newline at end of file diff --git a/openapi/date-annotator/openapi.yaml b/openapi/date-annotator/openapi.yaml index 55ad4d26..9c998c2f 100644 --- a/openapi/date-annotator/openapi.yaml +++ b/openapi/date-annotator/openapi.yaml @@ -71,4 +71,10 @@ paths: /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: - $ref: ../commons/paths/dependencies.yaml \ No newline at end of file + $ref: ../commons/paths/dependencies.yaml + /train: + $ref: ../commons/paths/trainAnnotator.yaml + /train/status: + $ref: ../commons/paths/annotatorTrainingStatus.yaml + /train/load: + $ref: ../commons/paths/loadTrainedAnnotator.yaml \ No newline at end of file diff --git a/openapi/id-annotator/openapi.yaml b/openapi/id-annotator/openapi.yaml index 0586dd73..123444b0 100644 --- a/openapi/id-annotator/openapi.yaml +++ b/openapi/id-annotator/openapi.yaml @@ -69,4 +69,10 @@ paths: /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: - $ref: ../commons/paths/dependencies.yaml \ No newline at end of file + $ref: ../commons/paths/dependencies.yaml + /train: + $ref: ../commons/paths/trainAnnotator.yaml + /train/status: + $ref: ../commons/paths/annotatorTrainingStatus.yaml + /train/load: + $ref: ../commons/paths/loadTrainedAnnotator.yaml \ No newline at end of file diff --git a/openapi/location-annotator/openapi.yaml b/openapi/location-annotator/openapi.yaml index a1e2cbe9..263724ff 100644 --- a/openapi/location-annotator/openapi.yaml +++ b/openapi/location-annotator/openapi.yaml @@ -69,4 +69,10 @@ paths: /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: - $ref: ../commons/paths/dependencies.yaml \ No newline at end of file + $ref: ../commons/paths/dependencies.yaml + /train: + $ref: ../commons/paths/trainAnnotator.yaml + /train/status: + $ref: ../commons/paths/annotatorTrainingStatus.yaml + /train/load: + $ref: ../commons/paths/loadTrainedAnnotator.yaml \ No newline at end of file diff --git a/openapi/person-name-annotator/openapi.yaml b/openapi/person-name-annotator/openapi.yaml index 149d46bf..24458528 100644 --- a/openapi/person-name-annotator/openapi.yaml +++ b/openapi/person-name-annotator/openapi.yaml @@ -69,4 +69,10 @@ paths: /tool: $ref: ../commons/paths/tool.yaml /tool/dependencies: - $ref: ../commons/paths/dependencies.yaml \ No newline at end of file + $ref: ../commons/paths/dependencies.yaml + /train: + $ref: ../commons/paths/trainAnnotator.yaml + /train/status: + $ref: ../commons/paths/annotatorTrainingStatus.yaml + /train/load: + $ref: ../commons/paths/loadTrainedAnnotator.yaml \ No newline at end of file diff --git a/openapi/phi-annotator/openapi.yaml b/openapi/phi-annotator/openapi.yaml index cb206f9b..e09ff46b 100644 --- a/openapi/phi-annotator/openapi.yaml +++ b/openapi/phi-annotator/openapi.yaml @@ -87,3 +87,9 @@ paths: $ref: ../commons/paths/tool.yaml /tool/dependencies: $ref: ../commons/paths/dependencies.yaml + /train: + $ref: ../commons/paths/trainAnnotator.yaml + /train/status: + $ref: ../commons/paths/annotatorTrainingStatus.yaml + /train/load: + $ref: ../commons/paths/loadTrainedAnnotator.yaml From 0c2c61bec9abfc406f1b1021335671e684ded6d4 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Wed, 23 Jun 2021 00:05:33 -0700 Subject: [PATCH 13/25] Add Training tag to Annotator Merge Exceptions --- openapi/_internal/tool/openapi-merge.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openapi/_internal/tool/openapi-merge.yaml b/openapi/_internal/tool/openapi-merge.yaml index 5ea5f86b..e73cd01e 100644 --- a/openapi/_internal/tool/openapi-merge.yaml +++ b/openapi/_internal/tool/openapi-merge.yaml @@ -5,26 +5,31 @@ inputs: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/person-name-annotator.openapi.yaml operationSelection: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/location-annotator.openapi.yaml operationSelection: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/id-annotator.openapi.yaml operationSelection: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/contact-annotator.openapi.yaml operationSelection: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/phi-deidentifier.openapi.yaml operationSelection: excludeTags: @@ -35,4 +40,5 @@ inputs: excludeTags: - Tool - HealthCheck + - Training output: openapi.yaml \ No newline at end of file From f111d1374de14d5015b9bfa3252ec4188fdd9b68 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Wed, 23 Jun 2021 00:12:00 -0700 Subject: [PATCH 14/25] Add Training Tag to nlpsandbox no-merge List --- openapi/_internal/nlpsandbox/openapi-merge.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openapi/_internal/nlpsandbox/openapi-merge.yaml b/openapi/_internal/nlpsandbox/openapi-merge.yaml index 9c7af9fa..3ec8ce1c 100644 --- a/openapi/_internal/nlpsandbox/openapi-merge.yaml +++ b/openapi/_internal/nlpsandbox/openapi-merge.yaml @@ -5,26 +5,31 @@ inputs: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/person-name-annotator.openapi.yaml operationSelection: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/location-annotator.openapi.yaml operationSelection: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/id-annotator.openapi.yaml operationSelection: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/contact-annotator.openapi.yaml operationSelection: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/phi-deidentifier.openapi.yaml operationSelection: excludeTags: @@ -35,6 +40,7 @@ inputs: excludeTags: - Tool - HealthCheck + - Training - inputFile: ../individuals/data-node.openapi.yaml operationSelection: excludeTags: From 0ca306847e998b4dfd7883d9bd4d9d1e7428c697 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Wed, 23 Jun 2021 17:58:30 -0700 Subject: [PATCH 15/25] Switch TrainingStatus Enum to Kebab Case --- openapi/commons/components/schemas/TrainingStatus.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/commons/components/schemas/TrainingStatus.yaml b/openapi/commons/components/schemas/TrainingStatus.yaml index e4e05d4e..8e489dbd 100644 --- a/openapi/commons/components/schemas/TrainingStatus.yaml +++ b/openapi/commons/components/schemas/TrainingStatus.yaml @@ -1,6 +1,6 @@ type: string description: Whether this annotator instance has been used to generate a trained model enum: - - not yet started + - not-yet-started - ongoing - - finished \ No newline at end of file + - finished From 83c510b728633376920318d7cbe87a6c98be1274 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Fri, 25 Jun 2021 16:55:52 -0700 Subject: [PATCH 16/25] Add Dataset URIs to TrainedAnnotatorStatus.yaml --- .../components/schemas/TrainedAnnotatorStatus.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml b/openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml index 33f636ee..a93926c3 100644 --- a/openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml +++ b/openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml @@ -1,9 +1,14 @@ type: object -description: Information about whether the annotator is using a trained model, and which one it is +description: Information about whether the annotator is using a trained model, and the dataset on which the annotator was trained properties: loaded: description: Whether the annotator is using a trained model type: boolean - dataset: - description: Which dataset the annotator's trained model was trained on - type: string \ No newline at end of file + notesURI: + description: URI to first page of the notes in the dataset + type: string + format: uri + goldStandardAnnotationsURI: + description: URI to first page of gold standard annotations + type: string + format: uri From 59f1c6e709751abe237f8b5fe0654796fe2f8b8e Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Fri, 25 Jun 2021 16:55:59 -0700 Subject: [PATCH 17/25] Add Dataset URIs to TrainedAnnotatorStatus.yaml From be6b00b1edba3703408eedb1bdedb1e4ed1c5be2 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Mon, 28 Jun 2021 19:29:12 -0700 Subject: [PATCH 18/25] Annotator -> Tool --- .../{TrainedAnnotatorStatus.yaml => TrainedToolStatus.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename openapi/commons/components/schemas/{TrainedAnnotatorStatus.yaml => TrainedToolStatus.yaml} (73%) diff --git a/openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml b/openapi/commons/components/schemas/TrainedToolStatus.yaml similarity index 73% rename from openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml rename to openapi/commons/components/schemas/TrainedToolStatus.yaml index a93926c3..b2d44a6d 100644 --- a/openapi/commons/components/schemas/TrainedAnnotatorStatus.yaml +++ b/openapi/commons/components/schemas/TrainedToolStatus.yaml @@ -1,5 +1,5 @@ type: object -description: Information about whether the annotator is using a trained model, and the dataset on which the annotator was trained +description: Information about whether the tool is using a trained model, and the dataset on which the tool was trained properties: loaded: description: Whether the annotator is using a trained model From 0151f12612ac7b5f6f1b46e6259c0c1895b657de Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Wed, 30 Jun 2021 21:38:29 -0700 Subject: [PATCH 19/25] Update Tool.yaml `TrainedAnnotatorStatus` -> `TrainedToolStatus` --- openapi/commons/components/schemas/Tool.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi/commons/components/schemas/Tool.yaml b/openapi/commons/components/schemas/Tool.yaml index dbc29812..9bb0473f 100644 --- a/openapi/commons/components/schemas/Tool.yaml +++ b/openapi/commons/components/schemas/Tool.yaml @@ -36,9 +36,9 @@ properties: description: Whether the tool implements trainability type: boolean default: false - trainedAnnotatorStatus: + trainedToolStatus: description: Information about the trained component of the annotator - $ref: TrainedAnnotatorStatus.yaml + $ref: TrainedToolStatus.yaml type: $ref: ../parameters/ToolType.yaml apiVersion: @@ -69,4 +69,4 @@ example: url: https://example.com trainable: false type: nlpsandbox:date-annotator - apiVersion: 1.2.0 \ No newline at end of file + apiVersion: 1.2.0 From a4f7ac99747a8ebc33b0ca67dae22a22fcfd8616 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Wed, 30 Jun 2021 21:39:57 -0700 Subject: [PATCH 20/25] Remove TrainedToolStatus from Tool Info --- openapi/commons/components/schemas/Tool.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/openapi/commons/components/schemas/Tool.yaml b/openapi/commons/components/schemas/Tool.yaml index 9bb0473f..6166efa1 100644 --- a/openapi/commons/components/schemas/Tool.yaml +++ b/openapi/commons/components/schemas/Tool.yaml @@ -36,9 +36,6 @@ properties: description: Whether the tool implements trainability type: boolean default: false - trainedToolStatus: - description: Information about the trained component of the annotator - $ref: TrainedToolStatus.yaml type: $ref: ../parameters/ToolType.yaml apiVersion: From 26fe35454d79826552e0841939b56cea2011ae1c Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Wed, 30 Jun 2021 22:33:56 -0700 Subject: [PATCH 21/25] `Annotator` -> `Tool` --- openapi/commons/components/schemas/TrainedToolStatus.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/commons/components/schemas/TrainedToolStatus.yaml b/openapi/commons/components/schemas/TrainedToolStatus.yaml index b2d44a6d..ff49e803 100644 --- a/openapi/commons/components/schemas/TrainedToolStatus.yaml +++ b/openapi/commons/components/schemas/TrainedToolStatus.yaml @@ -2,7 +2,7 @@ type: object description: Information about whether the tool is using a trained model, and the dataset on which the tool was trained properties: loaded: - description: Whether the annotator is using a trained model + description: Whether the tool is using a trained model type: boolean notesURI: description: URI to first page of the notes in the dataset From f1b1d62dbe493524edeebdc86ed39c1d2a7ef12b Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Wed, 30 Jun 2021 22:35:41 -0700 Subject: [PATCH 22/25] Update and rename annotatorTrainingStatus.yaml to toolTrainingStatus.yaml --- ...annotatorTrainingStatus.yaml => toolTrainingStatus.yaml} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename openapi/commons/paths/{annotatorTrainingStatus.yaml => toolTrainingStatus.yaml} (77%) diff --git a/openapi/commons/paths/annotatorTrainingStatus.yaml b/openapi/commons/paths/toolTrainingStatus.yaml similarity index 77% rename from openapi/commons/paths/annotatorTrainingStatus.yaml rename to openapi/commons/paths/toolTrainingStatus.yaml index cbbb2b0d..69f3a7e8 100644 --- a/openapi/commons/paths/annotatorTrainingStatus.yaml +++ b/openapi/commons/paths/toolTrainingStatus.yaml @@ -1,9 +1,9 @@ get: tags: - Training - summary: Get status of annotator training - description: Get status of the tool's training process (404 if annotator is not trainable) - operationId: getAnnotatorTrainingStatus + summary: Get status of tool training + description: Get status of the tool's training process (404 if tool is not trainable) + operationId: getToolTrainingStatus responses: '200': description: Success From 628cd7b293005d8516cd933cb0d9d6bae7223f63 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Thu, 1 Jul 2021 12:33:02 -0700 Subject: [PATCH 23/25] Create trainedToolStatus Endpoint --- openapi/commons/paths/trainedToolStatus.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 openapi/commons/paths/trainedToolStatus.yaml diff --git a/openapi/commons/paths/trainedToolStatus.yaml b/openapi/commons/paths/trainedToolStatus.yaml new file mode 100644 index 00000000..90686a2a --- /dev/null +++ b/openapi/commons/paths/trainedToolStatus.yaml @@ -0,0 +1,17 @@ +get: + tags: + - Training + summary: Get information about whether trained model has been loaded + description: Get information about the tool's trained model (404 if tool is not trainable) + operationId: getTrainedToolStatus + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../components/schemas/TrainedToolStatus.yaml + '404': + $ref: ../components/responses/NotFound.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml From 24d94fe08c896e89cd2c0ce131b6f8824a11e967 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Fri, 2 Jul 2021 18:44:38 -0700 Subject: [PATCH 24/25] Remove Erroneous References to "Annotator" --- openapi/commons/paths/trainAnnotator.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi/commons/paths/trainAnnotator.yaml b/openapi/commons/paths/trainAnnotator.yaml index fbdb5f30..4fb25d07 100644 --- a/openapi/commons/paths/trainAnnotator.yaml +++ b/openapi/commons/paths/trainAnnotator.yaml @@ -1,15 +1,15 @@ post: tags: - Training - summary: Initiate annotator training (async) - description: Start training the tool's annotation model + summary: Initiate tool training (async) + description: Start training the tool's model operationId: trainAnnotator responses: '201': description: Training initialized links: GetTrainingStatus: - operationId: annotatorTrainingStatus + operationId: toolTrainingStatus '404': $ref: ../components/responses/NotFound.yaml '500': From 4161b41fd643ee9353f6de98bd6233b1ff64d636 Mon Sep 17 00:00:00 2001 From: Connor Boyle Date: Fri, 2 Jul 2021 19:21:22 -0700 Subject: [PATCH 25/25] Rename trainAnnotator to trainTool --- openapi/commons/paths/{trainAnnotator.yaml => trainTool.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename openapi/commons/paths/{trainAnnotator.yaml => trainTool.yaml} (100%) diff --git a/openapi/commons/paths/trainAnnotator.yaml b/openapi/commons/paths/trainTool.yaml similarity index 100% rename from openapi/commons/paths/trainAnnotator.yaml rename to openapi/commons/paths/trainTool.yaml