Release 2.0.0

A guide to scienceio 2.0.0. (Feb 2023)

New Endpoints

ScienceIO has released two new endpoints related to protected health information (PHI):

The structure-ontologies endpoint is still in beta, and therefore still not yet supported by the SDK

Schema Changes

ScienceIO is working to standardize some of our underlying schemas.

Nesting

You may notice a change in the layout of your JSON responses, depending on which endpoint you call. These changes are limited to how we nest the dictionaries in the response, with the exception of the other changes described in this section.

spans vs. annotations

In the JSON response, spans is now annotations.

score

The JSON response from our two new PHI endpoints includes a score to indicate the confidence our model has in selecting the appropriate label. The score ranges from 0 (least confident) to 1.000 (most confident), and is based on a Softmax layer score.

label

The JSON response from our two new PHI endpoints includes labels (plural) to designate the beginning of a piece of PHI that was identified. Within that dictionary, the response uses label (singular) to indicate the type of PHI.

text vs. input_text

SDK users do not need to make any edits to their code for this change; simply update the SDK.

HTTP users may need to edit the last line of code, depending on the endpoint being called. In this release:

  • If calling the structure or structure-ontologies endpoints, leave the last line as text.
curl https://api.aws.science.io/v2/structure \
  --request POST \
  --header "Content-type: application/json" \
  --header "x-api-id: $SCIENCEIO_KEY_ID" \
  --header "x-api-secret: $SCIENCEIO_KEY_SECRET" \
  --data '{ "text": "Patient: John Doe\nAddress: 112 First Ave, New York, NY\nPhone: 555-555-1212\nAdmission date: December 13, 2022\nDiagnosis: UTI\nPhysician: Dr. Jane Smith\nNPI: 1234567890\nPhysician number: 555-555-9876\nClinical note: Mr. Doe is a 75-year-old male with a history of urinary tract infections. He presented to the Pearson clinic today with symptoms of dysuria and frequency. A urine culture was performed by Dr. Jones and showed significant growth of Escherichia coli.The patient was started on a course of oral antibiotics and will follow up with the clinic in one week for a repeat urine culture.If no improvement, patient will be referred to St. Joseph Hospital."}'
  • If calling the identify-phi or redact-phi endpoints, change the last line to input_text.
curl https://api.aws.science.io/v2/identify-phi \
  --request POST \
  --header "Content-type: application/json" \
  --header "x-api-id: $SCIENCEIO_KEY_ID" \
  --header "x-api-secret: $SCIENCEIO_KEY_SECRET" \
  --data '{ "input_text": "Patient: John Doe\nAddress: 112 First Ave, New York, NY\nPhone: 555-555-1212\nAdmission date: December 13, 2022\nDiagnosis: UTI\nPhysician: Dr. Jane Smith\nNPI: 1234567890\nPhysician number: 555-555-9876\nClinical note: Mr. Doe is a 75-year-old male with a history of urinary tract infections. He presented to the Pearson clinic today with symptoms of dysuria and frequency. A urine culture was performed by Dr. Jones and showed significant growth of Escherichia coli.The patient was started on a course of oral antibiotics and will follow up with the clinic in one week for a repeat urine culture.If no improvement, patient will be referred to St. Joseph Hospital."}'

This change to input_text will be pushed to all endpoints in future releases.