Downloads · 30 days
496
0% of all-time downloads
ugaray96/biobert_ncbi_disease_ner
biobert_ncbi_disease_ner is a token classification model from ugaray96. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as openrail.
This model is a fine-tuned version of BioBERT on the NCBI disease dataset for named entity recognition (NER) of diseases. It can be used to extract disease mentions from unstructured text in the medical and biological…
Downloads · 30 days
496
0% of all-time downloads
All-time downloads
148K
Public
Parameters
108M
1.7 GB on disk
Likes
20
Public
Click a slice to open those files.
.h5431 MB · 25%
How the weights are stored.
F32108M · 100%
From the Hugging Face model README
This model is a fine-tuned version of BioBERT on the NCBI disease dataset for named entity recognition (NER) of diseases. It can be used to extract disease mentions from unstructured text in the medical and biological domains.
This model is intended for use in extracting disease mentions from unstructured text in the medical and biological domains. It can be used to improve information retrieval and knowledge extraction in these fields.
This model was trained on the NCBI disease dataset, which consists of 793 PubMed abstracts with 6892 disease mentions.
You can use this model with the Hugging Face Transformers library. Here’s an example of how to load the model and use it to extract disease mentions from text:
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
tokenizer = AutoTokenizer.from_pretrained("ugaray96/biobert_ncbi_disease_ner")
model = AutoModelForTokenClassification.from_pretrained(
"ugaray96/biobert_ncbi_disease_ner"
)
ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer)
text = "The patient was diagnosed with lung cancer and started chemotherapy. They also have a history of diabetes and heart disease."
result = ner_pipeline(text)
diseases = []
for entity in result:
if entity["entity"] == "Disease":
diseases.append(entity["word"])
elif entity["entity"] == "Disease Continuation" and diseases:
diseases[-1] += f" {entity['word']}"
print(f"Diseases: {', '.join(diseases)}")
This should output: Diseases: lung cancer, diabetes, heart disease