ugaray96 commited on
Commit
f457475
1 Parent(s): c758102

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +49 -0
README.md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: openrail
3
+ datasets:
4
+ - ncbi_disease
5
+ language:
6
+ - en
7
+ tags:
8
+ - disease
9
+ - biology
10
+ - medical
11
+ ---
12
+
13
+ # Model Description
14
+ 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.
15
+
16
+ # Intended Use
17
+ 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.
18
+
19
+ # Training Data
20
+ 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.
21
+
22
+ # How to use
23
+ 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:
24
+
25
+ ```python
26
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
27
+ from transformers import pipeline
28
+
29
+ tokenizer = AutoTokenizer.from_pretrained("ugaray96/biobert_ncbi_disease_ner")
30
+ model = AutoModelForTokenClassification.from_pretrained(
31
+ "ugaray96/biobert_ncbi_disease_ner"
32
+ )
33
+
34
+ ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer)
35
+
36
+ text = "The patient was diagnosed with lung cancer and started chemotherapy. They also have a history of diabetes and heart disease."
37
+ result = ner_pipeline(text)
38
+
39
+ diseases = []
40
+ for entity in result:
41
+ if entity["entity"] == "Disease":
42
+ diseases.append(entity["word"])
43
+ elif entity["entity"] == "Disease Continuation" and diseases:
44
+ diseases[-1] += f" {entity['word']}"
45
+
46
+ print(f"Diseases: {', '.join(diseases)}")
47
+ ```
48
+
49
+ This should output: `Diseases: lung cancer, diabetes, heart disease`