BioEL: A comprehensive package for training, evaluating, and benchmarking biomedical entity linking models.
Installation
conda create -n bioel python=3.9
conda activate bioel
pip install -e .
Development Instructions
- Install as in editable package using
pipas shown above. - Add any new dependencies to
setup.py. - Add tests to
tests/directory.
Ontologies
Ontologies included in the package :
-
UMLS : UMLS is licensed by the National Library of Medicine and requires a free account to download. You can sign up for an account at https://uts.nlm.nih.gov/uts/signup-login. Once your account has been approved, you can download the UMLS metathesaurus at https://www.nlm.nih.gov/research/umls/licensedcontent/umlsknowledgesources.html.
-
MeSH : MeSH is derived from UMLS
-
NCBI Gene (Entrez) ontololgy. It can be downloaded at https://ftp.ncbi.nih.gov/gene/DATA/ (gene_info.gz)
-
MEDIC (MErged DIsease voCabulary) : It can be downloaded at https://ctdbase.org/downloads/
Resolving abbreviations
As a preprocessing step, we resolve abbreviations in the text using Ab3P, an abbreviation detector created for biomedical text. We ran abbreviation detection on the text of all documents in our benchmark, the results of which are stored in a large dictionary in data/abbreviations.json. In order to reproduce our abbreviation detection/resolution pipeline, please run the following:
from bioel.utils.solve_abbreviation.solve_abbreviation import create_abbrev
create_abbrev(output_dir, all_dataset)
# output_path : path where to create abbreviations.json
# all_dataset : datasets for which you want the abbreviations.
Example usage
# Import modules
from bioel.model import BioEL_Model
from bioel.evaluate import Evaluate
# load model
krissbert = BioEL_Model.load_krissbert(
name="krissbert", params_file=params,
)
# Look at data/params.json for more information about the parameters
krissbert.training() # train
krissbert.inference() # inference
abbreviations_path = "data/abbreviations.json"
dataset_names = ["ncbi_disease"]
model_names = ["krissbert"]
path_to_result = {
"ncbi_disease": {
"krissbert": "results/ncbi_disease.json"
}
}
# Results
evaluator = Evaluate(dataset_names, model_names, path_to_result, abbreviations_path)
evaluator.load_results()
evaluator.process_datasets()
evaluator.evaluate()
evaluator.plot_results()
ArboEL
ArboEL operates in two stages: First, you need to train the biencoder (load_arboel_biencoder). Then, you use the candidate results from the biencoder to train the crossencoder (load_arboel_crossencoder) and perform evaluation with the crossencoder.
BioBART/BioGenEL
BioBART and BioGenEL share the same entity linking module:
-
In order to finetune from BioBART set the
model_load_pathparameter in the .json config file toGanjinZero/biobart-v2-large, it will load the pretrained weights from HuggingFace. -
In order the finetune from BioGenEL's Knowledge base guided pretrained weights, you first must download the pretrained weights from this link: https://drive.google.com/file/d/1TqvQRau1WPYE9hKfemKZr-9ptE-7USAH/view?usp=sharing and then set the
model_load_pathparameter in the .json config file to the path where you stored the pretrained weights.
Metadata
Release files for bioel-package-pathology-dynamics 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bioel_package_pathology_dynamics-0.0.1.tar.gz | 171.7 kB | Without provenance | Details for bioel_package_pathology_dynamics-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bioel_package_pathology_dynamics-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for bioel_package_pathology_dynamics-0.0.1-py3-none-any.whl |
Total release size: 364.7 kB
Release files / bioel_package_pathology_dynamics-0.0.1.tar.gz
| Download URL | bioel_package_pathology_dynamics-0.0.1.tar.gz |
|---|---|
| Size | 171.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27d1014a347fb2e58ac62c859dc836965bbb429255625763056341b13c55a557
|
|
BLAKE2b-256 checksum How to use checksums |
93b6a30981145ed800bee8e8790fcef8c49675ede2c2edc7fb824270bbd8553c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Release files / bioel_package_pathology_dynamics-0.0.1-py3-none-any.whl
| Download URL | bioel_package_pathology_dynamics-0.0.1-py3-none-any.whl |
|---|---|
| Size | 192.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97ef5488477991b7e5f337e5e80155e1cb424e9cbc44db4cab448fe611e13111
|
|
BLAKE2b-256 checksum How to use checksums |
a2ae694d00372938d2e5c17b0bf8356dde5580736de3e00135925c0da95d8330
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Security for bioel-package-pathology-dynamics 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.