Saber (Sequence Annotator for Biomedical Entities and Relations) is a deep-learning based tool for information extraction in the biomedical domain.
Installation • Quickstart • Documentation
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
.
(saber) $ pip install saber
The install from PyPI is currently broken, please install using the instructions below.
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.
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.
The fastest way to check out Saber is by following along with the Google Colaboratory notebook (). 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).
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.
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 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 () for more help.