Package: gilda
Gilda: Grounding Integrating Learned DisambiguationGilda is a Python package and REST service that grounds (i.e., finds
appropriate identifiers in namespaces for) named entities in biomedical text.Gyori BM, Hoyt CT, Steppi A (2022). Gilda: biomedical entity text normalization with machine-learned disambiguation as a service. Bioinformatics Advances, 2022; vbac034https://doi.org/10.1093/bioadv/vbac034.InstallationGilda is deployed as a web service athttp://grounding.indra.bio/(see
Usage instructions below), however, it can also be used locally as a Python
package.The recommended method to install Gilda is through PyPI aspipinstallgildaNote that Gilda uses a single large resource file for grounding, which is
automatically downloaded into the~/.data/gilda/<version>folder during
runtime (seepystowfor options to
configure the location of this folder).Given some additional dependencies, the grounding resource file can
also be regenerated locally by runningpython -m gilda.generate_terms.Documentation and notebooksDocumentation for Gilda is availablehere.
We also provide several interactive Jupyter notebooks to help use and customize Gilda:Gilda Introductionprovides an interactive tutorial for using Gilda.Custom Groundersshows several examples of how Gilda can be instantiated with custom
grounding resources.Model Trainingprovides interactive sample code for training
new disambiguation models.UsageGilda can either be used as a REST web service or used programmatically
via its Python API. An introduction Jupyter notebook for using Gilda
is available athttps://github.com/indralab/gilda/blob/master/notebooks/gilda_introduction.ipynbUse as a Python packageFor using Gilda as a Python package, the documentation athttp://gilda.readthedocs.orgprovides detailed descriptions of each module of
Gilda and their usage. A basic usage example for named entity normalization (NEN),
orgroundingis as follows:importgildascored_matches=gilda.ground('ER',context='Calcium is released from the ER.')Gilda also implements a simple dictionary-based named entity recognition (NER)
algorithm that can be used as follows:importgildaresults=gilda.annotate('Calcium is released from the ER.')Use as a web serviceThe REST service accepts POST requests with a JSON header on the/groundendpoint. There is a public REST service running athttp://grounding.indra.biobut the service can also be run locally aspython-mgilda.appwhich, by default, launches the server atlocalhost:8001(for local usage
replace the URL in the examples below with this address).Below is an example request usingcurl:curl-XPOST-H"Content-Type: application/json"-d'{"text": "kras"}'http://grounding.indra.bio/groundThe same request using Python's request package would be as follows:importrequestsrequests.post('http://grounding.indra.bio/ground',json={'text':'kras'})The web service also supports multiple inputs in a single request on theground_multiendpoint, for instanceimportrequestsrequests.post('http://grounding.indra.bio/ground_multi',json=[{'text':'braf'},{'text':'ER','context':'endoplasmic reticulum (ER) is a cellular component'}])Resource usageGilda loads grounding terms into memory when first used. If memory usage
is an issue, the following options are recommended.Run a single instance of Gilda as a local web service that one or more
other processes send requests to.Create a custom Grounder instance that only loads a subset of terms
appropriate for a narrow use case.Gilda also offers an optional sqlite back-end which significantly decreases
memory usage and results in minor drop in the number of strings grounder per
unit time. The sqlite back-end database can be built as follows with an
optional[db_path]argument, which if used, should use the .db extension. If
not specified, the .db file is generated in Gilda's default resource folder.python-mgilda.resources.sqlite_adapter[db_path]A Grounder instance can then be instantiated as follows:fromgilda.grounderimportGroundergr=Grounder(db_path)matches=gr.ground('kras')Run web service with DockerAfter cloning the repository locally, you can build and run a Docker image
of Gilda using the following commands:$dockerbuild-tgilda:latest.
$dockerrun-d-p8001:8001gilda:latestAlternatively, you can usedocker-composeto do both the initial build and
run the container based on thedocker-compose.ymlconfiguration:$docker-composeupCitation@article{gyori2022gilda,author={Gyori, Benjamin M and Hoyt, Charles Tapley and Steppi, Albert},title="{{Gilda: biomedical entity text normalization with machine-learned disambiguation as a service}}",journal={Bioinformatics Advances},year={2022},month={05},issn={2635-0041},doi={10.1093/bioadv/vbac034},url={https://doi.org/10.1093/bioadv/vbac034},note={vbac034}}FundingThe development of Gilda was funded under the DARPA Communicating with Computers
program (ARO grant W911NF-15-1-0544) and the DARPA Young Faculty Award
(ARO grant W911NF-20-1-0255).