Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +32 -2
- crag_model.onnx +3 -0
- crag_model.onnx.data +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 |
+
crag_model.onnx.data filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -12,8 +12,8 @@ tags:
|
|
| 12 |
- dual-encoder
|
| 13 |
- clinical-nlp
|
| 14 |
datasets:
|
|
|
|
| 15 |
- bigbio/mimicause
|
| 16 |
-
- ade-benchmark-corpus/ade_corpus_v2
|
| 17 |
metrics:
|
| 18 |
- f1
|
| 19 |
- precision
|
|
@@ -234,6 +234,36 @@ The model was trained on a combination of:
|
|
| 234 |
| Loss Function | InfoNCE (τ=0.07) | Focal (γ=2.0, α=0.75) |
|
| 235 |
| Hard Negatives | 50% | - |
|
| 236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
|
| 238 |
## Limitations
|
| 239 |
|
|
@@ -258,4 +288,4 @@ If you use this model, please cite:
|
|
| 258 |
|
| 259 |
## License
|
| 260 |
|
| 261 |
-
Apache 2.0
|
|
|
|
| 12 |
- dual-encoder
|
| 13 |
- clinical-nlp
|
| 14 |
datasets:
|
| 15 |
+
- ade_corpus_v2
|
| 16 |
- bigbio/mimicause
|
|
|
|
| 17 |
metrics:
|
| 18 |
- f1
|
| 19 |
- precision
|
|
|
|
| 234 |
| Loss Function | InfoNCE (τ=0.07) | Focal (γ=2.0, α=0.75) |
|
| 235 |
| Hard Negatives | 50% | - |
|
| 236 |
|
| 237 |
+
## Experiment Tracking
|
| 238 |
+
|
| 239 |
+
- **WandB Run**: [68d4wq4u](https://wandb.ai/chrisvoncsefalvay/crag-experiments/runs/68d4wq4u)
|
| 240 |
+
- **Dataset Artifacts**: [HuggingFace Dataset](https://huggingface.co/datasets/chrisvoncsefalvay/crag-experiment-artifacts)
|
| 241 |
+
|
| 242 |
+
## ONNX Export
|
| 243 |
+
|
| 244 |
+
An ONNX export is provided for deployment flexibility:
|
| 245 |
+
|
| 246 |
+
```python
|
| 247 |
+
import onnxruntime as ort
|
| 248 |
+
from huggingface_hub import hf_hub_download
|
| 249 |
+
|
| 250 |
+
# Download ONNX model
|
| 251 |
+
onnx_path = hf_hub_download(
|
| 252 |
+
repo_id="chrisvoncsefalvay/CRAG-dual-encoder-mimicause",
|
| 253 |
+
filename="crag_model.onnx"
|
| 254 |
+
)
|
| 255 |
+
|
| 256 |
+
# Create inference session
|
| 257 |
+
session = ort.InferenceSession(onnx_path)
|
| 258 |
+
|
| 259 |
+
# Run inference (see pytorch example for input preparation)
|
| 260 |
+
outputs = session.run(None, {
|
| 261 |
+
"drug_input_ids": drug_ids,
|
| 262 |
+
"drug_attention_mask": drug_mask,
|
| 263 |
+
"adr_input_ids": adr_ids,
|
| 264 |
+
"adr_attention_mask": adr_mask
|
| 265 |
+
})
|
| 266 |
+
```
|
| 267 |
|
| 268 |
## Limitations
|
| 269 |
|
|
|
|
| 288 |
|
| 289 |
## License
|
| 290 |
|
| 291 |
+
Apache 2.0
|
crag_model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fa84ab29b3086f4c2de91f8d912f4a0e01aa446289e1e1faa406ae72cbb35deb
|
| 3 |
+
size 3041204
|
crag_model.onnx.data
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57e60f287de4c052fe3efe293305d5236079b6b6439c9fd038287db239b17487
|
| 3 |
+
size 950510592
|