Add model card
Browse files
README.md
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
language: es
|
4 |
+
tags:
|
5 |
+
- biomedical
|
6 |
+
- spanish
|
7 |
+
- entity-linking
|
8 |
+
- sapbert
|
9 |
+
- bi-encoder
|
10 |
+
- umls
|
11 |
+
- knowledge-graph
|
12 |
+
- clinical
|
13 |
+
---
|
14 |
+
|
15 |
+
# ClinLinker-KB-P
|
16 |
+
|
17 |
+
**ClinLinker-KB-P** enhances ClinLinker by leveraging hierarchical relations from the UMLS knowledge graph. It includes not only synonyms but also their **parent concepts** as positive training pairs, enabling more robust semantic generalization.
|
18 |
+
|
19 |
+
## 馃 Training Details
|
20 |
+
|
21 |
+
- Base model: `PlanTL-GOB-ES/roberta-base-biomedical-clinical-es`
|
22 |
+
- Data: UMLS Spanish concepts + `parent_of` relations
|
23 |
+
- Strategy: Contrastive training with concept parents as positives
|
24 |
+
|
25 |
+
## 馃摎 Citation
|
26 |
+
|
27 |
+
> Gallego, Fernando, et al. "Clinlinker-Kb: Clinical Entity Linking in Spanish with Knowledge-Graph Enhanced Biencoders." Available at SSRN 4939986.
|
28 |
+
|
29 |
+
## 馃挕 Recommended Usage
|
30 |
+
|
31 |
+
We recommend using this model together with:
|
32 |
+
|
33 |
+
- [Faiss](https://github.com/facebookresearch/faiss)
|
34 |
+
- Or the `FaissEncoder` from [ICB-UMA/KnowledgeGraph](https://github.com/ICB-UMA/KnowledgeGraph)
|
35 |
+
|
36 |
+
## 馃摎 Citation
|
37 |
+
|
38 |
+
> Gallego, Fernando and L贸pez-Garc铆a, Guillermo and Gasco, Luis and Krallinger, Martin and Veredas, Francisco J., Clinlinker-Kb: Clinical Entity Linking in Spanish with Knowledge-Graph Enhanced Biencoders. Available at SSRN:http://dx.doi.org/10.2139/ssrn.4939986
|
39 |
+
|
40 |
+
## 馃挕 Recommended Usage
|
41 |
+
|
42 |
+
We recommend using this model together with:
|
43 |
+
|
44 |
+
- [Faiss](https://github.com/facebookresearch/faiss) for similarity search
|
45 |
+
- Or the `FaissEncoder` utility available at [ICB-UMA/KnowledgeGraph](https://github.com/ICB-UMA/KnowledgeGraph)
|
46 |
+
|
47 |
+
## 馃И Example: Encoding a Spanish Mention
|
48 |
+
|
49 |
+
```python
|
50 |
+
from transformers import AutoTokenizer, AutoModel
|
51 |
+
import torch
|
52 |
+
|
53 |
+
tokenizer = AutoTokenizer.from_pretrained("ICB-UMA/ClinLinker-KB-P")
|
54 |
+
model = AutoModel.from_pretrained("ICB-UMA/ClinLinker-KB-P")
|
55 |
+
|
56 |
+
mention = "insuficiencia renal aguda"
|
57 |
+
inputs = tokenizer(mention, return_tensors="pt", padding=True, truncation=True)
|
58 |
+
with torch.no_grad():
|
59 |
+
outputs = model(**inputs)
|
60 |
+
embedding = outputs.last_hidden_state[:, 0, :] # CLS token
|
61 |
+
|
62 |
+
print(embedding.shape)
|
63 |
+
|