Skip to content

Commit

Permalink
Release 1.0.1 (#34)
Browse files Browse the repository at this point in the history
* Update README and package.json

* Re-generate tool for API version 1.0.1

* Update API and tool version in Tool object
  • Loading branch information
tschaffter authored Feb 26, 2021
1 parent 2996548 commit 8f30afb
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 15 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![GitHub License](https://img.shields.io/github/license/nlpsandbox/physical-address-annotator-example.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/physical-address-annotator-example/blob/develop/LICENSE)
[![Docker Pulls](https://img.shields.io/docker/pulls/nlpsandbox/physical-address-annotator-example.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/nlpsandbox/physical-address-annotator-example)
[![Discord](https://img.shields.io/discord/770484164393828373.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Discord&logo=discord)](https://discord.gg/Zb4ymtF "Realtime support / chat with the community and the team")
[![nlpsandbox.io](https://img.shields.io/badge/OpenAPI-nlpsandbox.io-blue?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=data:image/svg%2bxml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+Cjxzdmcgd2lkdGg9IjMxIiBoZWlnaHQ9IjMxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogPGcgY2xhc3M9ImxheWVyIj4KICA8dGl0bGU+U3luYXBzZSBMb2dvPC90aXRsZT4KICA8ZyBpZD0ic3ZnXzkiPgogICA8cmVjdCBmaWxsPSIjNUM5NEI5IiBoZWlnaHQ9IjIuNDg2MDUiIGlkPSJzdmdfMSIgdHJhbnNmb3JtPSJtYXRyaXgoMC43ODU4MTUgLTA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E0MjI0NWMwLjIyMTc4NCwtMC42MDc2OTUgMC4xODM2MzksLTEuMzA0MDk4IC0wLjE2NTg5OCwtMS45MDU1OGMtMC4zMzA5MDUsLTAuNTcwNDMxIC0wLjg3NDcxOSwtMC45NDEyNTMgLTEuNDczNTM5LC0xLjA3MDc3N2MtMC41MzQwNTgsLTAuMTE1MzI1IC0xLjExMjQ3NCwtMC4wMzk5MTYgLTEuNjI0MzU3LDAuMjU3Mjc3Yy0wLjU0NzM2NiwwLjMxNzU5NyAtMC45MTM3NTUsMC44Mjc2OTkgLTEuMDYxOTAxLDEuMzkzNjk3Yy0wLjE0NDYwNCwwLjU1NTM0MiAtMC4wNzg5NjEsMS4xNjQ4MDkgMC4yMzA2NTEsMS42OTg4NjZjMC42MjYzMjcsMS4wNzg3NjIgMi4wMTI5MiwxLjQ0MzM3OSAzLjA5Nzg5NiwwLjgxNDM5OWMwLjQ3OTk0MiwtMC4yNzg1NjEgMC44MjA2MDQsLTAuNzA1Mjc5IDAuOTk3MTQ5LC0xLjE4Nzg4M3oiIGZpbGw9IiM2MkFDNjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgaWQ9InN2Z184Ii8+CiAgPC9nPgogPC9nPgo8L3N2Zz4=&label=)](https://www.nlpsandbox.io/tools/physical-address-annotator/leaderboards "View the performance of this NLP Tool on nlpsandbox.io")

Example implementation of the [NLP Sandbox Physical Address Annotator]

Expand All @@ -19,8 +18,8 @@ physical address annotations found in the clinical note.

### Specification

- Physical Address Annotator API version: 1.0.0
- Tool version: 1.0.0
- Physical Address Annotator API version: 1.0.1
- Tool version: 1.0.1
- Docker image: [nlpsandbox/physical-address-annotator-example]

## Model
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.8"

services:
physical-address-annotator:
image: nlpsandbox/physical-address-annotator-example:1.0.0
image: nlpsandbox/physical-address-annotator-example:1.0.1
build:
context: server
dockerfile: Dockerfile
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"scripts": {
"generate:server": "openapi-generator-cli generate -g python-flask -o server -i $npm_config_specification",
"generate:server:latest": "openapi-generator-cli generate -g python-flask -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/physical-address-annotator/latest/openapi.json",
"lint": "cd server && flake8",
"test": "cd server && tox"
}
Expand Down
4 changes: 2 additions & 2 deletions server/openapi_server/controllers/tool_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_tool(): # noqa: E501
"""
tool = Tool(
name="physical-address-annotator-example",
version="1.0.0",
version="1.0.1",
license=License.APACHE_2_0,
repository="github:nlpsandbox/physical-address-annotator-example",
description="Example implementation of the NLP Sandbox Physical " +
Expand All @@ -22,7 +22,7 @@ def get_tool(): # noqa: E501
author_email="[email protected]",
url="https://github.com/nlpsandbox/physical-address-annotator-example",
tool_type="nlpsandbox:physical-address-annotator",
tool_api_version="1.0.0"
tool_api_version="1.0.1"
)
return tool, 200

Expand Down
1 change: 1 addition & 0 deletions server/openapi_server/models/license.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class License(Model):
NCSA = "ncsa"
UNLICENSE = "unlicense"
ZLIB = "zlib"
NONE = "none"
def __init__(self): # noqa: E501
"""License - a model defined in OpenAPI
Expand Down
2 changes: 2 additions & 0 deletions server/openapi_server/models/text_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def confidence(self, confidence):
:param confidence: The confidence of this TextAnnotation.
:type confidence: float
"""
if confidence is None:
raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501
if confidence is not None and confidence > 100: # noqa: E501
raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501
if confidence is not None and confidence < 0: # noqa: E501
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ def confidence(self, confidence):
:param confidence: The confidence of this TextPhysicalAddressAnnotation.
:type confidence: float
"""
if confidence is None:
raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501
if confidence is not None and confidence > 100: # noqa: E501
raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501
if confidence is not None and confidence < 0: # noqa: E501
Expand Down
29 changes: 20 additions & 9 deletions server/openapi_server/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,28 @@ info:
name: The NLP Sandbox Team
url: https://nlpsandbox.io
description: |
# Overview
# Introduction
The Physical Address Annotator is one of the first type of NLP Tools that can be benchmarked on [nlpsandbox.io](https://nlpsandbox.io). A Physical Address Annotator takes as input a clinical note and outputs a list of predicted physical address annotations found in the clinical note. This OpenAPI document describes the specification of a Physical Address 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).
# Getting Started
The GitHub repository [nlpsandbox/physical-address-annotator-example](https://github.com/nlpsandbox/physical-address-annotator-example) provides a simple example implementation of a Python-Flask Physical Address Annotator. By the end of the tutorial available in this repository, you will have built a Docker image for a simple Physical Address Annotator. You will then be able to submit this image to [nlpsandbox.io](https://nlpsandbox.io) to benchmark its performance.
# Benchmarking Requirements
The following conditions must be met by your Physical Address Annotator if you want to benchmark 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 output of this tool must be reproducible: a given input should always
generate the same output.
This NLP tool detects references of physical addresses in the clinical note
given as input and returns a list of physical address annotations.
- This tool must not attempt to connect to remote server for reproducibility,
robustness, and security reasons. When benchmarked on [nlpsandbox.io](https://nlpsandbox.io),
this tool will not be able to connect to remote servers.
# Examples
- [NLP Sandbox Physical Address Annotator (Python)](https://github.com/nlpsandbox/physical-address-annotator-example)
- [Physical Address Annotator Example (Python)](https://github.com/nlpsandbox/physical-address-annotator-example)
license:
name: Apache 2.0
url: https://github.com/nlpsandbox/nlpsandbox-schemas/blob/develop/LICENSE
title: NLP Sandbox Physical Address Annotator API
version: 1.0.0
version: 1.0.1
x-logo:
url: https://nlpsandbox.github.io/nlpsandbox-schemas/logo.png
servers:
Expand Down Expand Up @@ -290,6 +299,7 @@ components:
minimum: 0
type: number
required:
- confidence
- length
- start
- text
Expand Down Expand Up @@ -366,6 +376,7 @@ components:
- ncsa
- unlicense
- zlib
- none
example: apache-2.0
type: string
ToolType:
Expand All @@ -387,7 +398,7 @@ components:
authorEmail: [email protected]
url: https://example.com
toolType: nlpsandbox:date-annotator
toolApiVersion: 1.0.0
toolApiVersion: 1.0.1
properties:
name:
description: The tool name
Expand Down Expand Up @@ -457,7 +468,7 @@ components:
authorEmail: [email protected]
url: https://example.com
toolType: nlpsandbox:date-annotator
toolApiVersion: 1.0.0
toolApiVersion: 1.0.1
- name: awesome-nlp-tool
version: 1.0.6
license: apache-2.0
Expand All @@ -467,7 +478,7 @@ components:
authorEmail: [email protected]
url: https://example.com
toolType: nlpsandbox:date-annotator
toolApiVersion: 1.0.0
toolApiVersion: 1.0.1
properties:
toolDependencies:
description: A list of tools
Expand Down

0 comments on commit 8f30afb

Please sign in to comment.