Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +43 -0
- pytorch_model.bin +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
|
README.md
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- flair
|
4 |
+
- entity-mention-linker
|
5 |
+
---
|
6 |
+
|
7 |
+
## biosyn-sapbert-regel-bto
|
8 |
+
|
9 |
+
Biomedical Entity Mention Linking for DISEASE with MONDO Disease Ontology
|
10 |
+
|
11 |
+
- Model: [dmis-lab/biosyn-sapbert-bc5cdr-disease](https://huggingface.co/dmis-lab/biosyn-sapbert-bc5cdr-disease)
|
12 |
+
- Dictionary: [Brenda Tissue Ontology](https://mondo.monarchinitiative.org/)
|
13 |
+
|
14 |
+
### Demo: How to use in Flair
|
15 |
+
|
16 |
+
Requires:
|
17 |
+
|
18 |
+
- **[Flair](https://github.com/flairNLP/flair/)>=0.14.0** (`pip install flair` or `pip install git+https://github.com/flairNLP/flair.git`)
|
19 |
+
|
20 |
+
```python
|
21 |
+
from flair.data import Sentence
|
22 |
+
from flair.models import Classifier, EntityMentionLinker
|
23 |
+
from flair.tokenization import SciSpacyTokenizer
|
24 |
+
|
25 |
+
sentence = Sentence(
|
26 |
+
"The mutation in the ABCD1 gene causes X-linked adrenoleukodystrophy, "
|
27 |
+
"a neurodegenerative disease, which is exacerbated by exposure to high "
|
28 |
+
"levels of mercury in dolphin populations.",
|
29 |
+
use_tokenizer=SciSpacyTokenizer()
|
30 |
+
)
|
31 |
+
# load hunflair to detect the entity mentions we want to link.
|
32 |
+
tagger = Classifier.load("hunflair2")
|
33 |
+
tagger.predict(sentence)
|
34 |
+
|
35 |
+
# load the linker and dictionary
|
36 |
+
linker = EntityMentionLinker.load("regel-corpus/biosyn-sapbert-regel-mondo")
|
37 |
+
linker.predict(sentence)
|
38 |
+
|
39 |
+
# print the results for each entity mention:
|
40 |
+
for span in sentence.get_spans(tagger.label_type):
|
41 |
+
for link in span.get_labels(linker.label_type):
|
42 |
+
print(f"{span.text} -> {link.value}")
|
43 |
+
```
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c1a1ba3a76239315fe91ef8e73938a9da971819139ca8d77dd505f252c39ba5f
|
3 |
+
size 671848435
|