Skip to content

zmohammad01/NLC_product_classifier-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DISCLAIMER: This application is used for demonstrative and illustrative purposes only and does not constitute an offering that has gone through regulatory review. It is not intended to serve as a medical application. There is no representation as to the accuracy of the output of this application and it is presented without warranty.

Classify medical diagnosis with ICD-10 code

This application was built to demonstrate IBM's Watson Natural Language Classifier (NLC). The data set we will be using, ICD-10-GT-AA.csv, contains a subset of ICD-10 entries. ICD-10 is the 10th revision of the International Statistical Classification of Diseases and Related Health Problems. In short, it is a medical classification list by the World Health Organization (WHO) that contains codes for: diseases, signs and symptoms, abnormal findings, complaints, social circumstances, and external causes of injury or diseases. Hospitals and insurance companies alike could save time and money by levearging Watson to properly tag the most accurate ICD-10 codes.

This application is a Python web application based on the Flask microframework, and based on earlier work done by Ryan Anderson. It uses the Watson Python SDK to create the classifier, list classifiers, and classify the input text. We also make use of the freely available ICD-10 API which, given an ICD-10 code, returns a name and description.

Architecture

Setup the classifier

Here we create the classifier with our ICD-10 dataset.

  1. Download the ICD-10 dataset by right clicking the link and seletcting Save As.
  2. Create an NLC service in IBM Cloud, make a note of the service name used in the catalog, we'll need this later.
  3. Create service credentials by using the menu on the left and selecting the default options.
  4. Upload the data using the command below. Be sure to substitute the username and password. This will take around 3 hours.
curl -i --user "$username":"$password" -F [email protected] -F training_metadata="{\"language\":\"en\",\"name\":\"ICD-10Classifier\"}" "https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers"

Running the application

This application can be run locally or hosted on IBM Cloud, follow the steps below depending on your deployment choice

Run locally

  1. Clone this project: git clone [email protected]:IBM/nlc-icd10-demo.git
  2. cd into this project's root directory
  3. (Optionally) create a virtual environment: virtualenv my-nlc-demo
    1. Activate the virtual environment: ./my-nlc-demo/bin/activate
  4. Run pip install -r requirements.txt to install the app's dependencies
  5. Update the welcome.py with your NLC credentials
  6. Run python welcome.py
  7. Access the running app in a browser at http://localhost:5000

Run on IBM Cloud

  1. Clone this project: git clone [email protected]:IBM/nlc-icd10-demo.git

  2. cd into this project's root directory

  3. Update manifest.yml with the NLC service name (your_nlc_service_name), a unique application name (your_app_name) and unique host value (your_app_host)

    applications:
      - path: .
      memory: 256M
      instances: 1
      domain: mybluemix.net
      name: your_app_name
      host: your_app_host
      disk_quota: 1024M
      services:
      - your_nlc_service_name
      buildpack: python_buildpack
    
  4. Run bluemix app push from the root directory

  5. Access the running app by going to: https://<host-value>.mybluemix.net/

If you've never run the bluemix command before there is some configuration required, refer to the official IBM Cloud CLI docs to get this set up.

Links

License

Apache 2.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 65.1%
  • CSS 20.8%
  • HTML 14.1%