Text Generation
Transformers
Safetensors
Spanish
llama_longbel
biomedical-entity-linking
entity-linking
entity-disambiguation
named-entity-linking
biomedical
healthcare
snomed
spaccc
medprocner
symptemist
distemist
constrained-decoding
causal-lm
llm
conversational
custom_code
Eval Results (legacy)
Instructions to use AnonymousARR42/LongBEL_8B_SPACCC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AnonymousARR42/LongBEL_8B_SPACCC with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AnonymousARR42/LongBEL_8B_SPACCC", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("AnonymousARR42/LongBEL_8B_SPACCC", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AnonymousARR42/LongBEL_8B_SPACCC with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AnonymousARR42/LongBEL_8B_SPACCC" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AnonymousARR42/LongBEL_8B_SPACCC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AnonymousARR42/LongBEL_8B_SPACCC
- SGLang
How to use AnonymousARR42/LongBEL_8B_SPACCC with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "AnonymousARR42/LongBEL_8B_SPACCC" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AnonymousARR42/LongBEL_8B_SPACCC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "AnonymousARR42/LongBEL_8B_SPACCC" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AnonymousARR42/LongBEL_8B_SPACCC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AnonymousARR42/LongBEL_8B_SPACCC with Docker Model Runner:
docker model run hf.co/AnonymousARR42/LongBEL_8B_SPACCC
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -16,6 +16,9 @@ tags:
|
|
| 16 |
- healthcare
|
| 17 |
- snomed
|
| 18 |
- spaccc
|
|
|
|
|
|
|
|
|
|
| 19 |
- text-generation
|
| 20 |
- constrained-decoding
|
| 21 |
- causal-lm
|
|
@@ -40,13 +43,32 @@ model-index:
|
|
| 40 |
type: entity-linking
|
| 41 |
name: Biomedical Entity Linking
|
| 42 |
dataset:
|
| 43 |
-
type:
|
| 44 |
-
name:
|
| 45 |
-
config: spaccc_bigbio_kb
|
| 46 |
metrics:
|
| 47 |
- type: recall
|
| 48 |
name: Recall@1
|
| 49 |
-
value: 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
---
|
| 51 |
|
| 52 |
# LongBEL: Long-Context and Document-Consistent Biomedical Entity Linking
|
|
@@ -110,37 +132,30 @@ bigbio_pages = [
|
|
| 110 |
"type": "paragraph",
|
| 111 |
"text": [
|
| 112 |
"Una mujer embarazada de 29 años consultó por hipertensión grave, "
|
| 113 |
-
"cefalea y dolor epigástrico. Las pruebas de laboratorio mostraron proteinuria "
|
| 114 |
-
"
|
| 115 |
-
"por sospecha de PET y se inició tratamiento urgente."
|
| 116 |
],
|
| 117 |
-
"offsets": [[0,
|
| 118 |
}
|
| 119 |
],
|
| 120 |
"entities": [
|
| 121 |
{
|
| 122 |
"id": "T1",
|
| 123 |
-
"type": "
|
| 124 |
-
"text": ["mujer embarazada"],
|
| 125 |
-
"offsets": [[4, 20]],
|
| 126 |
-
},
|
| 127 |
-
{
|
| 128 |
-
"id": "T2",
|
| 129 |
-
"type": "Disorders",
|
| 130 |
"text": ["hipertensión grave"],
|
| 131 |
"offsets": [[45, 63]],
|
| 132 |
},
|
| 133 |
{
|
| 134 |
-
"id": "
|
| 135 |
-
"type": "
|
| 136 |
"text": ["proteinuria"],
|
| 137 |
"offsets": [[131, 142]],
|
| 138 |
},
|
| 139 |
{
|
| 140 |
-
"id": "
|
| 141 |
-
"type": "
|
| 142 |
"text": ["PET"],
|
| 143 |
-
"offsets": [[
|
| 144 |
},
|
| 145 |
],
|
| 146 |
"events": [],
|
|
@@ -172,114 +187,108 @@ for i in range(0, len(predictions), num_beams):
|
|
| 172 |
**Example Output:**
|
| 173 |
|
| 174 |
```text
|
| 175 |
-
## Mention 1:
|
| 176 |
- Beam 1:
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
|
| 181 |
- Beam 2:
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
|
| 186 |
- Beam 3:
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
|
| 191 |
- Beam 4:
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
|
| 196 |
- Beam 5:
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
|
| 201 |
-
## Mention 2:
|
| 202 |
- Beam 1:
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
|
| 207 |
- Beam 2:
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
|
| 212 |
- Beam 3:
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
|
| 217 |
- Beam 4:
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
|
| 222 |
- Beam 5:
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
|
| 227 |
-
## Mention 3:
|
| 228 |
- Beam 1:
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
|
| 233 |
- Beam 2:
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
|
| 238 |
- Beam 3:
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
|
| 243 |
- Beam 4:
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
|
| 248 |
- Beam 5:
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
|
|
|
| 252 |
|
| 253 |
-
##
|
| 254 |
-
- Beam 1:
|
| 255 |
-
- Predicted concept name:PET - Pre-eclamptic toxemia
|
| 256 |
-
- Predicted code: C0032914
|
| 257 |
-
- Beam score: 0.075
|
| 258 |
|
| 259 |
-
|
| 260 |
-
- Predicted concept name:PET - Pre-eclamptic toxaemia
|
| 261 |
-
- Predicted code: C0032914
|
| 262 |
-
- Beam score: 0.039
|
| 263 |
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
|
|
|
|
|
|
| 268 |
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
- Predicted code: C0032914
|
| 272 |
-
- Beam score: 0.023
|
| 273 |
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
|
| 280 |
## Evaluation
|
| 281 |
|
| 282 |
-
Entity linking performance is reported using Recall@1 with bootstrap confidence intervals. The best result is shown in **bold**, and the second-best result is <u>underlined</u>.
|
| 283 |
|
| 284 |
| Model | MM-ST21PV<br>(English) | QUAERO-EMEA<br>(French) | SympTEMIST<br>(Spanish) | DisTEMIST<br>(Spanish) | MedProcNER<br>(Spanish) |
|
| 285 |
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
@@ -297,7 +306,7 @@ Entity linking performance is reported using Recall@1 with bootstrap confidence
|
|
| 297 |
| **Global-Context BEL: LongBEL** ||||| |
|
| 298 |
| LongBEL-1B| 77.6 ± 0.9 | 74.5 ± 3.7 | 59.8 ± 2.5 | 61.9 ± 2.4 | 66.6 ± 2.1 |
|
| 299 |
| LongBEL-1B + Ensemble | 78.6 ± 0.8 | <u>77.2 ± 3.0</u> | 61.8 ± 2.5 | <u>64.3 ± 2.2</u> | <u>69.0 ± 2.0</u> |
|
| 300 |
-
| **LongBEL-8B** | <u>79.3 ± 0.8</u> | 75.4 ± 3.4 | <u>62.0 ± 2.6</u> | 63.6 ± 2.1 | <u>69.0 ± 2.1</u> |
|
| 301 |
| LongBEL-8B + Ensemble | **80.0 ± 0.8** | **77.6 ± 3.0** | **63.3 ± 2.5** | **65.8 ± 2.2** | **71.0 ± 2.0** |
|
| 302 |
|
| 303 |
The score reported for this checkpoint is the **single LongBEL-8B model**. The ensemble result requires fusing several LongBEL input configurations and is not produced by this checkpoint alone.
|
|
@@ -328,16 +337,3 @@ This model is intended for research use. It should not be used for clinical deci
|
|
| 328 |
Code and evaluation scripts are available in this [GitHub repository](https://anonymous.4open.science/r/LongBEL-31AD).
|
| 329 |
|
| 330 |
Trained model checkpoints and processed datasets are available in the anonymous Hugging Face collection associated with LongBEL.
|
| 331 |
-
|
| 332 |
-
<!-- ## Citation
|
| 333 |
-
|
| 334 |
-
If you use this model, please cite the LongBEL paper.
|
| 335 |
-
|
| 336 |
-
```bibtex
|
| 337 |
-
@inproceedings{longbel2026,
|
| 338 |
-
title = {LongBEL: Long-Context and Document-Consistent Biomedical Entity Linking},
|
| 339 |
-
author = {Anonymous},
|
| 340 |
-
booktitle = {Anonymous submission},
|
| 341 |
-
year = {2026}
|
| 342 |
-
}
|
| 343 |
-
``` -->
|
|
|
|
| 16 |
- healthcare
|
| 17 |
- snomed
|
| 18 |
- spaccc
|
| 19 |
+
- medprocner
|
| 20 |
+
- symptemist
|
| 21 |
+
- distemist
|
| 22 |
- text-generation
|
| 23 |
- constrained-decoding
|
| 24 |
- causal-lm
|
|
|
|
| 43 |
type: entity-linking
|
| 44 |
name: Biomedical Entity Linking
|
| 45 |
dataset:
|
| 46 |
+
type: AnonymousARR42/SPACCC
|
| 47 |
+
name: SympTEMIST
|
|
|
|
| 48 |
metrics:
|
| 49 |
- type: recall
|
| 50 |
name: Recall@1
|
| 51 |
+
value: 0.620
|
| 52 |
+
- task:
|
| 53 |
+
type: entity-linking
|
| 54 |
+
name: Biomedical Entity Linking
|
| 55 |
+
dataset:
|
| 56 |
+
type: AnonymousARR42/SPACCC
|
| 57 |
+
name: DisTEMIST
|
| 58 |
+
metrics:
|
| 59 |
+
- type: recall
|
| 60 |
+
name: Recall@1
|
| 61 |
+
value: 0.636
|
| 62 |
+
- task:
|
| 63 |
+
type: entity-linking
|
| 64 |
+
name: Biomedical Entity Linking
|
| 65 |
+
dataset:
|
| 66 |
+
type: AnonymousARR42/SPACCC
|
| 67 |
+
name: MedProcNER
|
| 68 |
+
metrics:
|
| 69 |
+
- type: recall
|
| 70 |
+
name: Recall@1
|
| 71 |
+
value: 0.690
|
| 72 |
---
|
| 73 |
|
| 74 |
# LongBEL: Long-Context and Document-Consistent Biomedical Entity Linking
|
|
|
|
| 132 |
"type": "paragraph",
|
| 133 |
"text": [
|
| 134 |
"Una mujer embarazada de 29 años consultó por hipertensión grave, "
|
| 135 |
+
"cefalea y dolor epigástrico. Las pruebas de laboratorio mostraron proteinuria. "
|
| 136 |
+
"Fue ingresada durante la noche por sospecha de PET y se inició tratamiento urgente."
|
|
|
|
| 137 |
],
|
| 138 |
+
"offsets": [[0, 227]],
|
| 139 |
}
|
| 140 |
],
|
| 141 |
"entities": [
|
| 142 |
{
|
| 143 |
"id": "T1",
|
| 144 |
+
"type": "ENFERMEDAD",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
"text": ["hipertensión grave"],
|
| 146 |
"offsets": [[45, 63]],
|
| 147 |
},
|
| 148 |
{
|
| 149 |
+
"id": "T2",
|
| 150 |
+
"type": "ENFERMEDAD",
|
| 151 |
"text": ["proteinuria"],
|
| 152 |
"offsets": [[131, 142]],
|
| 153 |
},
|
| 154 |
{
|
| 155 |
+
"id": "T3",
|
| 156 |
+
"type": "ENFERMEDAD",
|
| 157 |
"text": ["PET"],
|
| 158 |
+
"offsets": [[191, 194]],
|
| 159 |
},
|
| 160 |
],
|
| 161 |
"events": [],
|
|
|
|
| 187 |
**Example Output:**
|
| 188 |
|
| 189 |
```text
|
| 190 |
+
## Mention 1: hipertensión grave
|
| 191 |
- Beam 1:
|
| 192 |
+
Predicted concept name: hipertensión arterial
|
| 193 |
+
Predicted code: 38341003
|
| 194 |
+
Beam score: 0.993
|
| 195 |
|
| 196 |
- Beam 2:
|
| 197 |
+
Predicted concept name: degeneración vascular hipertensiva
|
| 198 |
+
Predicted code: 38341003
|
| 199 |
+
Beam score: 0.249
|
| 200 |
|
| 201 |
- Beam 3:
|
| 202 |
+
Predicted concept name: hipertensión arterial maligna
|
| 203 |
+
Predicted code: 70272006
|
| 204 |
+
Beam score: 0.046
|
| 205 |
|
| 206 |
- Beam 4:
|
| 207 |
+
Predicted concept name: degeneración macular senil
|
| 208 |
+
Predicted code: 267718000
|
| 209 |
+
Beam score: 0.004
|
| 210 |
|
| 211 |
- Beam 5:
|
| 212 |
+
Predicted concept name: hipertensión maligna secundaria, SAI
|
| 213 |
+
Predicted code: 194784007
|
| 214 |
+
Beam score: 0.001
|
| 215 |
|
| 216 |
+
## Mention 2: proteinuria
|
| 217 |
- Beam 1:
|
| 218 |
+
Predicted concept name: proteinuria de causa desconocida
|
| 219 |
+
Predicted code: 231860006
|
| 220 |
+
Beam score: 0.000
|
| 221 |
|
| 222 |
- Beam 2:
|
| 223 |
+
Predicted concept name: proteína de la membrana mitocondrial asociada con neurodegeneración
|
| 224 |
+
Predicted code: 709415008
|
| 225 |
+
Beam score: 0.000
|
| 226 |
|
| 227 |
- Beam 3:
|
| 228 |
+
Predicted concept name: proteinuria aislada concomitante con glomerulonefritis membranoproliferativa tipo III y debida a ella
|
| 229 |
+
Predicted code: 368931000119104
|
| 230 |
+
Beam score: 0.000
|
| 231 |
|
| 232 |
- Beam 4:
|
| 233 |
+
Predicted concept name: proteinosis alveolar pulmonar congénita
|
| 234 |
+
Predicted code: 707442002
|
| 235 |
+
Beam score: 0.000
|
| 236 |
|
| 237 |
- Beam 5:
|
| 238 |
+
Predicted concept name: proteinosis alveolar pulmonar
|
| 239 |
+
Predicted code: 10501004
|
| 240 |
+
Beam score: 0.000
|
| 241 |
|
| 242 |
+
## Mention 3: PET
|
| 243 |
- Beam 1:
|
| 244 |
+
Predicted concept name: preeclampsia
|
| 245 |
+
Predicted code: 398254007
|
| 246 |
+
Beam score: 0.285
|
| 247 |
|
| 248 |
- Beam 2:
|
| 249 |
+
Predicted concept name: preeclampsia en el puerperio
|
| 250 |
+
Predicted code: 765182005
|
| 251 |
+
Beam score: 0.068
|
| 252 |
|
| 253 |
- Beam 3:
|
| 254 |
+
Predicted concept name: púrpura trombocitopénica
|
| 255 |
+
Predicted code: 302873008
|
| 256 |
+
Beam score: 0.000
|
| 257 |
|
| 258 |
- Beam 4:
|
| 259 |
+
Predicted concept name: púrpura de la vulva
|
| 260 |
+
Predicted code: 289487000
|
| 261 |
+
Beam score: 0.000
|
| 262 |
|
| 263 |
- Beam 5:
|
| 264 |
+
Predicted concept name: pústula maligna
|
| 265 |
+
Predicted code: 84980006
|
| 266 |
+
Beam score: 0.000
|
| 267 |
+
```
|
| 268 |
|
| 269 |
+
### Saliency map example
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
|
| 271 |
+
The model can also return token-level saliency maps during inference.
|
|
|
|
|
|
|
|
|
|
| 272 |
|
| 273 |
+
```python
|
| 274 |
+
predictions, saliency_maps = model.sample(
|
| 275 |
+
bigbio_pages=bigbio_pages,
|
| 276 |
+
num_beams=num_beams,
|
| 277 |
+
with_saliency_maps=True,
|
| 278 |
+
)
|
| 279 |
|
| 280 |
+
model.display_saliency_map(saliency_maps[2])
|
| 281 |
+
````
|
|
|
|
|
|
|
| 282 |
|
| 283 |
+
Example saliency map for the mention `PET`:
|
| 284 |
+
|
| 285 |
+
<p align="center">
|
| 286 |
+
<img src="saliency_map.png" alt="Saliency map for PET prediction" width="900">
|
| 287 |
+
</p>
|
| 288 |
|
| 289 |
## Evaluation
|
| 290 |
|
| 291 |
+
Entity linking performance is reported using Recall@1 with bootstrap confidence intervals. The best result is shown in **bold**, and the second-best result is <u>underlined</u> and ⭐ marks the main LongBEL-8B model.
|
| 292 |
|
| 293 |
| Model | MM-ST21PV<br>(English) | QUAERO-EMEA<br>(French) | SympTEMIST<br>(Spanish) | DisTEMIST<br>(Spanish) | MedProcNER<br>(Spanish) |
|
| 294 |
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
|
|
| 306 |
| **Global-Context BEL: LongBEL** ||||| |
|
| 307 |
| LongBEL-1B| 77.6 ± 0.9 | 74.5 ± 3.7 | 59.8 ± 2.5 | 61.9 ± 2.4 | 66.6 ± 2.1 |
|
| 308 |
| LongBEL-1B + Ensemble | 78.6 ± 0.8 | <u>77.2 ± 3.0</u> | 61.8 ± 2.5 | <u>64.3 ± 2.2</u> | <u>69.0 ± 2.0</u> |
|
| 309 |
+
| **⭐ LongBEL-8B** | <u>79.3 ± 0.8</u> | 75.4 ± 3.4 | <u>62.0 ± 2.6</u> | 63.6 ± 2.1 | <u>69.0 ± 2.1</u> |
|
| 310 |
| LongBEL-8B + Ensemble | **80.0 ± 0.8** | **77.6 ± 3.0** | **63.3 ± 2.5** | **65.8 ± 2.2** | **71.0 ± 2.0** |
|
| 311 |
|
| 312 |
The score reported for this checkpoint is the **single LongBEL-8B model**. The ensemble result requires fusing several LongBEL input configurations and is not produced by this checkpoint alone.
|
|
|
|
| 337 |
Code and evaluation scripts are available in this [GitHub repository](https://anonymous.4open.science/r/LongBEL-31AD).
|
| 338 |
|
| 339 |
Trained model checkpoints and processed datasets are available in the anonymous Hugging Face collection associated with LongBEL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|