| Field | Value |
|---|---|
| Base model | meta-llama/Llama-3.2-1B-Instruct |
| Task | Biomedical Entity Linking |
| Dataset | QUAERO-EMEA |
| Knowledge base | UMLS 2014AA |
| Input | BigBio-like documents with mention spans and semantic groups |
| Output | Ranked UMLS concept predictions |
| Decoding | Semantic-guided constrained decoding |
| Main metric | Recall@1 |
1import torch
2from transformers import AutoModelForCausalLM
3
4model = AutoModelForCausalLM.from_pretrained(
5 "AnonymousARR42/LongBEL_1B_QUAERO_EMEA",
6 trust_remote_code=True,
7 torch_dtype=torch.bfloat16,
8 device_map="auto",
9)type field.1num_beams = 5
2
3bigbio_pages = [
4 {
5 "id": "001",
6 "document_id": "doc_001",
7 "passages": [
8 {
9 "id": "0",
10 "type": "paragraph",
11 "text": [
12 "Une femme enceinte de 29 ans s'est présentée avec une hypertension sévère, "
13 "des céphalées et une douleur épigastrique. Les analyses biologiques ont montré "
14 "une protéinurie et une légère élévation des enzymes hépatiques. Elle a été "
15 "hospitalisée pendant la nuit avec une suspicion de PET et un traitement urgent "
16 "a été débuté."
17 ],
18 "offsets": [[0, 321]],
19 }
20 ],
21 "entities": [
22 {
23 "id": "T1",
24 "type": "Living Beings",
25 "text": ["femme enceinte"],
26 "offsets": [[4, 18]],
27 },
28 {
29 "id": "T2",
30 "type": "Disorders",
31 "text": ["hypertension sévère"],
32 "offsets": [[54, 73]],
33 },
34 {
35 "id": "T3",
36 "type": "Disorders",
37 "text": ["protéinurie"],
38 "offsets": [[158, 169]],
39 },
40 {
41 "id": "T4",
42 "type": "Disorders",
43 "text": ["PET"],
44 "offsets": [[280, 283]],
45 },
46 ],
47 "events": [],
48 "coreferences": [],
49 "relations": [],
50 }
51]
52
53predictions = model.sample(
54 bigbio_pages=bigbio_pages,
55 num_beams=num_beams,
56)
57
58for i in range(0, len(predictions), num_beams):
59 mention = predictions[i]["mention"]
60 print(f"## Mention {(i // num_beams) + 1}: {mention}")
61
62 for j in range(num_beams):
63 pred = predictions[i + j]
64 print(
65 f" - Beam {j + 1}:\n"
66 f" Predicted concept name: {pred['pred_concept_name']}\n"
67 f" Predicted code: {pred['pred_concept_code']}\n"
68 f" Beam score: {pred['beam_score']:.3f}\n"
69 )1## Mention 1: femme enceinte
2 - Beam 1:
3 Predicted concept name: Femmes enceintes
4 Predicted code: C0033011
5 Beam score: 0.825
6
7 - Beam 2:
8 Predicted concept name: Femmes qui travaillent
9 Predicted code: C0043215
10 Beam score: 0.001
11
12 - Beam 3:
13 Predicted concept name: Femmes en période de post-partum
14 Predicted code: C0032804
15 Beam score: 0.000
16
17 - Beam 4:
18 Predicted concept name: Femmes en péripartum
19 Predicted code: C2936492
20 Beam score: 0.000
21
22 - Beam 5:
23 Predicted concept name: Femme battue
24 Predicted code: C0413330
25 Beam score: 0.000
26
27## Mention 2: hypertension sévère
28 - Beam 1:
29 Predicted concept name: Hypertension pulmonaire
30 Predicted code: C0020542
31 Beam score: 0.016
32
33 - Beam 2:
34 Predicted concept name: Hypertension aggravée
35 Predicted code: C0235750
36 Beam score: 0.009
37
38 - Beam 3:
39 Predicted concept name: Hypertension systolique
40 Predicted code: C0221155
41 Beam score: 0.009
42
43 - Beam 4:
44 Predicted concept name: Hypertension pulmonaire aggravée
45 Predicted code: C0853930
46 Beam score: 0.008
47
48 - Beam 5:
49 Predicted concept name: Hypertension du nouveau-né
50 Predicted code: C0452204
51 Beam score: 0.005
52
53## Mention 3: protéinurie
54 - Beam 1:
55 Predicted concept name: Protéinurie
56 Predicted code: C0033687
57 Beam score: 1.000
58
59 - Beam 2:
60 Predicted concept name: Protéinurie - aggravée
61 Predicted code: C0856146
62 Beam score: 0.004
63
64 - Beam 3:
65 Predicted concept name: Protozoan infection (disorder)
66 Predicted code: C0033740
67 Beam score: 0.003
68
69 - Beam 4:
70 Predicted concept name: Protozoan infection
71 Predicted code: C0033740
72 Beam score: 0.001
73
74 - Beam 5:
75 Predicted concept name: Protozoal infection
76 Predicted code: C0033740
77 Beam score: 0.000
78
79## Mention 4: PET
80 - Beam 1:
81 Predicted concept name: Petrol sniffing
82 Predicted code: C1658398
83 Beam score: 0.000
84
85 - Beam 2:
86 Predicted concept name: Petrol inhalation
87 Predicted code: C1662227
88 Beam score: 0.000
89
90 - Beam 3:
91 Predicted concept name: PET - Pre-eclamptic toxemia
92 Predicted code: C0032914
93 Beam score: 0.000
94
95 - Beam 4:
96 Predicted concept name: Petits reins bilatéraux
97 Predicted code: C0156246
98 Beam score: 0.000
99
100 - Beam 5:
101 Predicted concept name: PET - Pre-eclamptic toxaemia
102 Predicted code: C0032914
103 Beam score: 0.0001predictions, saliency_maps = model.sample(
2 bigbio_pages=bigbio_pages,
3 num_beams=num_beams,
4 with_saliency_maps=True,
5)
6
7model.display_saliency_map(saliency_maps[3])PET:
| Model | MM-ST21PV (English) | QUAERO-EMEA (French) | SympTEMIST (Spanish) | DisTEMIST (Spanish) | MedProcNER (Spanish) |
|---|---|---|---|---|---|
| Context-Free BEL | |||||
| SciSpacy | 53.8 ± 1.0 | 37.1 ± 4.3 | 9.8 ± 1.3 | 21.1 ± 1.9 | 10.3 ± 1.2 |
| SapBERT | 65.6 ± 1.0 | 59.7 ± 3.8 | 34.2 ± 2.0 | 38.6 ± 2.6 | 30.4 ± 2.1 |
| CODER-all | 62.9 ± 1.1 | 66.9 ± 4.0 | 42.2 ± 2.2 | 47.0 ± 2.6 | 42.7 ± 2.1 |
| SapBERT-all | 64.6 ± 1.1 | 67.9 ± 3.9 | 49.8 ± 2.4 | 49.6 ± 2.6 | 45.1 ± 2.2 |
| BERGAMOT | 60.9 ± 1.1 | 63.8 ± 4.9 | 48.0 ± 2.7 | 48.9 ± 2.4 | 42.3 ± 2.2 |
| Local-Context BEL | |||||
| ArboEL | 76.9 ± 0.9 | 63.0 ± 3.9 | 55.4 ± 2.5 | 54.7 ± 2.6 | 59.7 ± 2.6 |
| GENRE / mBART-large | 69.6 ± 1.0 | 69.3 ± 5.4 | 59.8 ± 2.7 | 58.7 ± 2.7 | 66.0 ± 2.3 |
| GENRE / Llama-1B | 73.1 ± 1.0 | 75.1 ± 3.6 | 60.5 ± 2.4 | 62.5 ± 2.3 | 67.4 ± 2.1 |
| GENRE / Llama-8B | 75.0 ± 0.9 | 73.8 ± 4.0 | 61.7 ± 2.5 | 63.2 ± 2.5 | 68.3 ± 2.2 |
| Global-Context BEL: LongBEL | |||||
| ⭐ LongBEL-1B | 77.6 ± 0.9 | 74.5 ± 3.7 | 59.8 ± 2.5 | 61.9 ± 2.4 | 66.6 ± 2.1 |
| LongBEL-1B + Ensemble | 78.6 ± 0.8 | 77.2 ± 3.0 | 61.8 ± 2.5 | 64.3 ± 2.2 | 69.0 ± 2.0 |
| LongBEL-8B | 79.3 ± 0.8 | 75.4 ± 3.4 | 62.0 ± 2.6 | 63.6 ± 2.1 | 69.0 ± 2.1 |
| LongBEL-8B + Ensemble | 80.0 ± 0.8 | 77.6 ± 3.0 | 63.3 ± 2.5 | 65.8 ± 2.2 | 71.0 ± 2.0 |
| Model | Model memory | Candidate memory | Speed |
|---|---|---|---|
| GENRE-Llama-1B baseline | 2.4 GB | 5.4 GB | 69.6 mentions/s |
| LongBEL-1B | 2.4 GB | 5.4 GB | 48.5 mentions/s |