This is a named entity recognition model fine-tuned from the
microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext model. It predicts spans with 2 possible labels. The labels are
DiseaseClass and SpecificDisease.
The code used for training this model can be found at
https://github.com/Glasgow-AI4BioMed/bioner along with links to other biomedical NER models trained on well-known biomedical corpora. The source dataset information is below.
The code below will load up the model and apply it to the provided text. It uses a simple aggregation strategy to post-process the individual tokens into larger multi-token entities where needed.
1from transformers import pipeline
2
3# Load the model as part of an NER pipeline
4ner_pipeline = pipeline("token-classification",
5 model="Glasgow-AI4BioMed/bioner_ncbi_disease",
6 aggregation_strategy="max")
7
8# Apply it to some text
9ner_pipeline("Tuberculous is an infectious disease.")
10
11# Output:
12# [ {"entity_group": "SpecificDisease", "score": 0.99873, "word": "tuberculous", "start": 0, "end": 11},
13# {"entity_group": "DiseaseClass", "score": 0.99418, "word": "infectious disease", "start": 18, "end": 36} ]
The dataset should be cited with: Doğan, Rezarta Islamaj, Robert Leaman, and Zhiyong Lu. "NCBI disease corpus: a resource for disease name recognition and concept normalization." Journal of biomedical informatics 47 (2014): 1-10. DOI:
10.1016/j.jbi.2013.12.006
Preprocessing: The training/validation/test split was maintained from the original dataset. The annotations were filtered down to only 'DiseaseClass' and 'SpecificDisease'. The preprocessing script for this dataset is
prepare_ncbi_disease.py.
The span-level performance on the test split for the different labels are shown in the tables below. The full performance results are available in the model repo in Markdown format for viewing and JSON format for easier loading. These include the performance at token level (with individual B- and I- labels as the token classifier uses IOB2 token labelling).
Hyperparameter tuning was done with
optuna and the
hyperparameter_search functionality. 100 trials were run. Early stopping was applied during training. The best performing model was selected using the macro F1 performance on the validation set. The selected hyperparameters are in the table below.