{ "info": { "author": "John Giorgi", "author_email": "johnmgiorgi@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Flask", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only" ], "description": "
\n
\n
\n \n \n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n
Saber (Sequence Annotator for Biomedical Entities and Relations) is a deep-learning based tool for information extraction in the biomedical domain.\n
\n\n\n Installation \u2022\n Quickstart \u2022\n Documentation\n
\n\n## Installation\n\nTo install Saber, you will need `python>=3.5`. If not already installed, `python>=3.5` can be installed via\n\n - The [official installer](https://www.python.org/downloads/)\n - [Homebrew](https://brew.sh), on MacOS (`brew install python3`)\n - [Miniconda3](https://conda.io/miniconda.html) / [Anaconda3](https://www.anaconda.com/download/)\n\n(OPTIONAL) Activate your virtual environment (see [below](#optional-creating-and-activating-virtual-environments) for help)\n\n```sh\n$ conda activate saber\n# Notice your command prompt has changed to indicate that the environment is active\n(saber) $\n```\n\nthen install Saber\n\n```sh\n(saber) $ pip install saber\n```\n\nTo get the latest development version of Saber, install it right from this repository with `pip`\n\n```sh\n(saber) $ pip install https://github.com/BaderLab/saber.git\n```\n\nor by cloning the repository and then using `pip` to install the package\n\n```sh\n(saber) $ git clone https://github.com/BaderLab/saber.git\n(saber) $ cd saber\n(saber) $ pip install .\n```\n\nFor now, you will need to install the required [Spacy](https://spacy.io) model and the [keras-contrib](https://github.com/keras-team/keras-contrib) repository (even if you installed with `pip install saber`)\n\n```sh\n# keras-contrib\n(saber) $ pip install git+https://www.github.com/keras-team/keras-contrib.git\n# NeuralCoref medium model built on top of Spacy, this might take a few minutes to download!\n(saber) $ pip install https://github.com/huggingface/neuralcoref-models/releases/download/en_coref_md-3.0.0/en_coref_md-3.0.0.tar.gz\n```\n\n### (OPTIONAL) Creating and activating virtual environments\n\nWhen using `pip` it is generally recommended to install packages in a virtual environment to avoid modifying system state. To create a virtual environment named `saber`\n\n#### Using virtualenv or venv\n\nUsing [virtualenv](https://virtualenv.pypa.io/en/stable/)\n\n```sh\n$ virtualenv --python=python3 /path/to/new/venv/saber\n```\n\nUsing [venv](https://docs.python.org/3/library/venv.html)\n\n```sh\n$ python3 -m venv /path/to/new/venv/saber\n```\n\nNext, you need to activate the environment\n\n```sh\n$ source /path/to/new/venv/saber/bin/activate\n# Notice your command prompt has changed to indicate that the environment is active\n(saber) $\n```\n\n#### Using Conda\n\nIf you use [Conda](https://conda.io/docs/), you can create an environment named `saber` by running\n\n```sh\n$ conda create -n saber python=3.6\n```\n\nthen activate the environment with\n\n```sh\n$ conda activate saber\n# Again, your command prompt should change to indicate that the environment is active\n(saber) $\n```\n\n## Quickstart\n\nIf your goal is to use Saber to annotate biomedical text, then you can either use the [web-service](#web-service) or a [pre-trained model](#pre-trained-models). If you simply want to check Saber out, without installing anything locally, try the [Google Colaboratory](#google-colaboratory) notebook.\n\n### Google Colaboratory\n\nThe fastest way to check out Saber is by following along with the Google Colaboratory notebook ([](https://colab.research.google.com/drive/1WD7oruVuTo6p_908MQWXRBdLF3Vw2MPo)). 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).\n\n### Web-service\n\nTo use Saber as a **local** web-service, run\n\n```\n(saber) $ python -m saber.cli.app\n```\n\nor, if you prefer, you can pull & run the Saber image from **Docker Hub**\n\n```sh\n# Pull Saber image from Docker Hub\n$ docker pull pathwaycommons/saber\n# Run docker (use `-dt` instead of `-it` to run container in background)\n$ docker run -it --rm -p 5000:5000 --name saber pathwaycommons/saber\n```\n\nThere are currently two endpoints, `/annotate/text` and `/annotate/pmid`. Both expect a `POST` request with a JSON payload, e.g.,\n\n```json\n{\n \"text\": \"The phosphorylation of Hdm2 by MK2 promotes the ubiquitination of p53.\"\n}\n```\n\nor\n\n```json\n{\n \"pmid\": 11835401\n}\n```\n\nFor example, running the web-service locally and using `cURL`\n\n```sh\n$ curl -X POST 'http://localhost:5000/annotate/text' \\\n--data '{\"text\": \"The phosphorylation of Hdm2 by MK2 promotes the ubiquitination of p53.\"}'\n```\n\nDocumentation for the Saber web-service API can be found [here](https://baderlab.github.io/saber-api-docs/).\n\n### Pre-trained models\n\nFirst, import the `Saber` class. This is the interface to Saber\n\n```python\nfrom saber.saber import Saber\n```\n\nTo load a pre-trained model, first create a `Saber` object\n\n```python\nsaber = Saber()\n```\n\nand then load the model of our choice\n\n```python\nsaber.load('PRGE')\n```\n\nYou can see all the pre-trained models in the [web-service API docs](https://baderlab.github.io/saber-api-docs/) or, the [saber/pretrained_models](saber/pretrained_models) folder in this repository, or by running the following line of code\n\n```python\nfrom saber.constants import ENTITIES; print(list(ENTITIES.keys()))\n```\n\nTo annotate text with the model, just call the `Saber.annotate()` method\n\n```python\nsaber.annotate(\"The phosphorylation of Hdm2 by MK2 promotes the ubiquitination of p53.\")\n```\nSee the [documentation](https://baderlab.github.io/saber/quick_start/) for more details.\n\n## Documentation\n\nDocumentation for the Saber API can be found [here](https://baderlab.github.io/saber/). The web-service API has its own documentation [here](https://baderlab.github.io/saber-api-docs/#introduction). Finally, we provide a [jupyter notebook](notebooks/lightning_tour.ipynb) which introduces the main ways of using Saber. See [here](https://baderlab.github.io/saber/guide_to_saber_api/#juypter-notebooks) for help setting up [JupyterLab](https://github.com/jupyterlab/jupyterlab).", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/BaderLab/saber", "keywords": "Natural Language Processing,Named Entity Recognition", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "saber", "package_url": "https://pypi.org/project/saber/", "platform": "", "project_url": "https://pypi.org/project/saber/", "project_urls": { "Homepage": "https://github.com/BaderLab/saber" }, "release_url": "https://pypi.org/project/saber/0.1.0/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Saber: Sequence Annotator for Biomedical Entities and Relations", "version": "0.1.0" }, "last_serial": 4722306, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f04ccdb9c3c477991f728d44f48db027", "sha256": "e373ac8f87ba2ce63a84dc2462821016b8ffc187c81772f9dbe1530c2d959af3" }, "downloads": -1, "filename": "saber-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f04ccdb9c3c477991f728d44f48db027", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 39690193, "upload_time": "2019-01-21T16:31:39", "url": "https://files.pythonhosted.org/packages/6f/57/d6f6d9b6b594194734a68af4b1c07b6d22b1da0425d2247ff897099c3a96/saber-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f04ccdb9c3c477991f728d44f48db027", "sha256": "e373ac8f87ba2ce63a84dc2462821016b8ffc187c81772f9dbe1530c2d959af3" }, "downloads": -1, "filename": "saber-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f04ccdb9c3c477991f728d44f48db027", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 39690193, "upload_time": "2019-01-21T16:31:39", "url": "https://files.pythonhosted.org/packages/6f/57/d6f6d9b6b594194734a68af4b1c07b6d22b1da0425d2247ff897099c3a96/saber-0.1.0.tar.gz" } ] }