generated from nlpsandbox/date-annotator-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Run npm run generate:server:latest * Update schemas and annotator version * Update npm scripts * Update tool description
- Loading branch information
1 parent
882c936
commit b098e59
Showing
9 changed files
with
94 additions
and
44 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1 @@ | ||
1.1.2 | ||
1.2.0 |
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
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
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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from openapi_server.models.tool import Tool # noqa: E501 | ||
from openapi_server.models.tool_dependencies import ToolDependencies # noqa: E501 | ||
from openapi_server.models.tool_type import ToolType | ||
from openapi_server.models.license import License | ||
|
||
|
||
|
@@ -13,15 +14,16 @@ def get_tool(): # noqa: E501 | |
""" | ||
tool = Tool( | ||
name="id-annotator-example", | ||
version="1.1.2", | ||
version="1.2.0", | ||
license=License.APACHE_2_0, | ||
repository="github:nlpsandbox/id-annotator-example", | ||
description="Example implementation of the NLP Sandbox ID Annotator", | ||
description="Example implementation of the NLP Sandbox ID Annotator " + | ||
" API", | ||
author="NLP Sandbox Team", | ||
author_email="[email protected]", | ||
url="https://github.com/nlpsandbox/id-annotator-example", | ||
type="nlpsandbox:id-annotator", | ||
api_version="1.1.2" | ||
type=ToolType.ID_ANNOTATOR, | ||
api_version="1.2.0" | ||
) | ||
return tool, 200 | ||
|
||
|
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
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
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,49 @@ | ||
# coding: utf-8 | ||
|
||
from __future__ import absolute_import | ||
from datetime import date, datetime # noqa: F401 | ||
|
||
from typing import List, Dict # noqa: F401 | ||
|
||
from openapi_server.models.base_model_ import Model | ||
from openapi_server import util | ||
|
||
|
||
class ToolType(Model): | ||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
Do not edit the class manually. | ||
""" | ||
|
||
""" | ||
allowed enum values | ||
""" | ||
CONTACT_ANNOTATOR = "nlpsandbox:contact-annotator" | ||
COVID_SYMPTOM_ANNOTATOR = "nlpsandbox:covid-symptom-annotator" | ||
DATA_NODE = "nlpsandbox:data-node" | ||
DATE_ANNOTATOR = "nlpsandbox:date-annotator" | ||
ID_ANNOTATOR = "nlpsandbox:id-annotator" | ||
LOCATION_ANNOTATOR = "nlpsandbox:location-annotator" | ||
PERSON_NAME_ANNOTATOR = "nlpsandbox:person-name-annotator" | ||
PHI_ANNOTATOR = "nlpsandbox:phi-annotator" | ||
PHI_DEIDENTIFIER = "nlpsandbox:phi-deidentifier" | ||
def __init__(self): # noqa: E501 | ||
"""ToolType - a model defined in OpenAPI | ||
""" | ||
self.openapi_types = { | ||
} | ||
|
||
self.attribute_map = { | ||
} | ||
|
||
@classmethod | ||
def from_dict(cls, dikt) -> 'ToolType': | ||
"""Returns the dict as a model | ||
:param dikt: A dict. | ||
:type: dict | ||
:return: The ToolType of this ToolType. # noqa: E501 | ||
:rtype: ToolType | ||
""" | ||
return util.deserialize_model(dikt, cls) |
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 |
---|---|---|
|
@@ -6,13 +6,13 @@ info: | |
url: https://nlpsandbox.io | ||
description: | | ||
# Introduction | ||
An ID Annotator takes as input a clinical note and outputs a list of predicted ID annotations found in the clinical note. This OpenAPI document describes the specification of a ID Annotator. This specification includes the schemas of the input and output data, and the conditions that this annotator must meet if you want to benchmark its performance on [nlpsandbox.io](https://nlpsandbox.io). | ||
An ID annotator takes as input a clinical note and outputs a list of predicted ID annotations found in the clinical note. This OpenAPI document describes the specification of the NLP Sandbox ID Annotator API. This specification includes the schemas of the input and output data, and the requirements that this annotator must meet if you want to benchmark its performance on [nlpsandbox.io](https://nlpsandbox.io). | ||
# Getting Started | ||
The GitHub repository (will be added later) [nlpsandbox/id-annotator-example](https://github.com/nlpsandbox/id-annotator-example) provides a simple example implementation of a Python-Flask ID Annotator. By the end of the tutorial available in the README, you will have built a Docker image for a simple ID Annotator. You will then be able to submit this image to [nlpsandbox.io](https://nlpsandbox.io) to benchmark its performance. | ||
The GitHub repository [nlpsandbox/id-annotator-example](https://github.com/nlpsandbox/id-annotator-example) provides an example implementation of the NLP Sandbox ID Annotator API in Python-Flask. By the end of the tutorial available in the README, you will have built a Docker image for this NLP Sandbox tool. You will then be able to submit this image to [nlpsandbox.io](https://nlpsandbox.io) to benchmark its performance. | ||
# Benchmarking Requirements | ||
Your NLP Sandbox tool must meet the following conditions before evaluating its performance on [nlpsandbox.io](https://nlpsandbox.io). | ||
Your NLP Sandbox tool must meet the following requirements before evaluating its performance on [nlpsandbox.io](https://nlpsandbox.io). | ||
- The endpoint `/` must redirect to `/api/v1/tool`. | ||
- The endpoint `/ui` must redirect to the web interface (UI). | ||
- The endpoint `/ui` must redirect to the Swagger User Interface (UI). | ||
- The output of this tool must be reproducible: a given input should always | ||
generate the same output. | ||
|
@@ -22,14 +22,14 @@ info: | |
connect to remote servers. | ||
# Examples | ||
- [ID Annotator Example (Python)](https://github.com/nlpsandbox/id-annotator-example) | ||
- [NLP Sandbox ID Annotator Example (Python)](https://github.com/nlpsandbox/id-annotator-example) | ||
license: | ||
name: Apache 2.0 | ||
url: https://github.com/nlpsandbox/nlpsandbox-schemas/blob/develop/LICENSE | ||
url: https://github.com/nlpsandbox/nlpsandbox-schemas/blob/main/LICENSE | ||
title: NLP Sandbox ID Annotator API | ||
version: 1.1.2 | ||
version: 1.2.0 | ||
x-logo: | ||
url: https://nlpsandbox.github.io/nlpsandbox-schemas/logo.png | ||
url: https://github.com/nlpsandbox/nlpsandbox-schemas/raw/main/docs/logo.png | ||
servers: | ||
- url: http://example.com/api/v1 | ||
- url: https://example.com/api/v1 | ||
|
@@ -395,10 +395,18 @@ components: | |
type: string | ||
ToolType: | ||
description: The type of this tool | ||
enum: | ||
- nlpsandbox:contact-annotator | ||
- nlpsandbox:covid-symptom-annotator | ||
- nlpsandbox:data-node | ||
- nlpsandbox:date-annotator | ||
- nlpsandbox:id-annotator | ||
- nlpsandbox:location-annotator | ||
- nlpsandbox:person-name-annotator | ||
- nlpsandbox:phi-annotator | ||
- nlpsandbox:phi-deidentifier | ||
example: nlpsandbox:date-annotator | ||
maxLength: 60 | ||
minLength: 3 | ||
pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*(:)[a-z0-9]+(?:-[a-z0-9]+)*$ | ||
title: ToolType | ||
type: string | ||
Tool: | ||
description: Information about an NLP tool | ||
|
@@ -412,7 +420,7 @@ components: | |
authorEmail: [email protected] | ||
url: https://example.com | ||
type: nlpsandbox:date-annotator | ||
apiVersion: 1.1.2 | ||
apiVersion: 1.2.0 | ||
properties: | ||
name: | ||
description: The tool name | ||
|
@@ -432,7 +440,7 @@ components: | |
type: string | ||
description: | ||
description: A short, one-sentence summary of the tool | ||
maxLength: 100 | ||
maxLength: 280 | ||
type: string | ||
author: | ||
description: The author of the tool | ||
|
@@ -446,12 +454,7 @@ components: | |
format: uri | ||
type: string | ||
type: | ||
description: The type of this tool | ||
example: nlpsandbox:date-annotator | ||
maxLength: 60 | ||
minLength: 3 | ||
pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*(:)[a-z0-9]+(?:-[a-z0-9]+)*$ | ||
type: string | ||
$ref: '#/components/schemas/ToolType' | ||
apiVersion: | ||
description: The version of the tool OpenAPI specification | ||
minLength: 1 | ||
|
@@ -483,7 +486,7 @@ components: | |
authorEmail: [email protected] | ||
url: https://example.com | ||
type: nlpsandbox:date-annotator | ||
apiVersion: 1.1.2 | ||
apiVersion: 1.2.0 | ||
- name: awesome-nlp-tool | ||
version: 1.0.6 | ||
license: apache-2.0 | ||
|
@@ -493,7 +496,7 @@ components: | |
authorEmail: [email protected] | ||
url: https://example.com | ||
type: nlpsandbox:date-annotator | ||
apiVersion: 1.1.2 | ||
apiVersion: 1.2.0 | ||
properties: | ||
tools: | ||
description: A list of tools | ||
|