File size: 2,054 Bytes
f457475
 
 
 
 
 
 
 
 
 
71c5931
 
0101c30
 
f457475
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
license: openrail
datasets:
- ncbi_disease
language:
- en
tags:
- disease
- biology
- medical
widget:
- text: "The patient was diagnosed with lung cancer and started chemotherapy."
- text: "The patient has a history of heart disease and high blood pressure."
- text: "The patient was diagnosed with diabetes and prescribed insulin therapy."
---

# Model Description
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.

# Intended Use
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.

# Training Data
This model was trained on the [NCBI disease dataset](https://huggingface.co/datasets/ncbi_disease), which consists of 793 PubMed abstracts with 6892 disease mentions.

# How to use
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:

```python
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`