Skip to content
/ saber Public
forked from BaderLab/saber

Saber is a deep-learning based tool for information extraction in the biomedical domain. Pull requests are welcome! Note: this is a work in progress. Many things are broken, and the codebase is not stable.

License

Notifications You must be signed in to change notification settings

opscidia/saber

 
 

Repository files navigation

Saber

Travis CI Codacy Status Coverage Status PRs Welcome License Colab Slack

Saber (Sequence Annotator for Biomedical Entities and Relations) is a deep-learning based tool for information extraction in the biomedical domain.

InstallationQuickstartDocumentation

Installation

Note! This is a work in progress. Many things are broken, and the codebase is not stable.

To install Saber, you will need python3.6.

Latest PyPI stable release

PyPI-Status PyPI-Downloads Libraries-Dependents

(saber) $ pip install saber

The install from PyPI is currently broken, please install using the instructions below.

Latest development release on GitHub

GitHub-Status GitHub-Stars GitHub-Forks GitHub-Commits GitHub-Updated

Pull and install straight from GitHub

(saber) $ pip install git+https://github.com/BaderLab/saber.git

or install by cloning the repository

(saber) $ git clone https://github.com/BaderLab/saber.git
(saber) $ cd saber

and then using either pip

(saber) $ pip install -e .

or setuptools

(saber) $ python setup.py install

See the documentation for more detailed installation instructions.

Quickstart

If your goal is to use Saber to annotate biomedical text, then you can either use the web-service or a pre-trained model. If you simply want to check Saber out, without installing anything locally, try the Google Colaboratory notebook.

Google Colaboratory

The fastest way to check out Saber is by following along with the Google Colaboratory notebook (Colab). In order to be able to run the cells, select "Open in Playground" or, alternatively, save a copy to your own Google Drive account (File > Save a copy in Drive).

Web-service

To use Saber as a local web-service, run

(saber) $ python -m saber.cli.app

or, if you prefer, you can pull & run the Saber image from Docker Hub

# Pull Saber image from Docker Hub
$ docker pull pathwaycommons/saber
# Run docker (use `-dt` instead of `-it` to run container in background)
$ docker run -it --rm -p 5000:5000 --name saber pathwaycommons/saber

There are currently two endpoints, /annotate/text and /annotate/pmid. Both expect a POST request with a JSON payload, e.g.,

{
  "text": "The phosphorylation of Hdm2 by MK2 promotes the ubiquitination of p53."
}

or

{
  "pmid": 11835401
}

For example, running the web-service locally and using cURL

$ curl -X POST 'http://localhost:5000/annotate/text' \
--data '{"text": "The phosphorylation of Hdm2 by MK2 promotes the ubiquitination of p53."}'

Documentation for the Saber web-service API can be found here.

Pre-trained models

First, import the Saber class. This is the interface to Saber

from saber.saber import Saber

then create a Saber object

saber = Saber()

and then load the model of our choice

saber.load('PRGE')

To annotate text with the model, just call the Saber.annotate() method

saber.annotate("The phosphorylation of Hdm2 by MK2 promotes the ubiquitination of p53.")

See the documentation for more details on using pre-trained models.

Documentation

Documentation for the Saber package can be found here. The web-service API has its own documentation here.

You can also call help() on any Saber method for more information

from saber import Saber

saber = Saber()

help(saber.annotate)

or pass the --help flag to any of the command-line interfaces

python -m src.cli.train --help

Feel free to open an issue or reach out to us on our slack channel (Slack) for more help.

About

Saber is a deep-learning based tool for information extraction in the biomedical domain. Pull requests are welcome! Note: this is a work in progress. Many things are broken, and the codebase is not stable.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 92.3%
  • Jupyter Notebook 7.6%
  • Dockerfile 0.1%