Instructions to use kiwiki196/bc5cdr-extract-gemma-4-e2b-it-short with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use kiwiki196/bc5cdr-extract-gemma-4-e2b-it-short with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-E2B-it") model = PeftModel.from_pretrained(base_model, "kiwiki196/bc5cdr-extract-gemma-4-e2b-it-short") - Notebooks
- Google Colab
- Kaggle
kiwiki196/bc5cdr-extract-gemma-4-e2b-it-short
LoRA adapter fine-tuning google/gemma-4-E2B-it to extract chemical and disease
mentions from biomedical sentences (BC5CDR) as JSON.
Required system prompt
PROMPT_VARIANT = "short" (22 tokens). Inference
must use this exact prompt — a different one silently degrades output:
Extract chemical and disease mentions as JSON.
Output format
JSON list, one entry per occurrence, in order of appearance:
[{"text": "...", "type": "Chemical"}, {"text": "...", "type": "Disease"}]
Training
| examples | 5228 |
| epochs | 1 |
| effective batch | 32 |
| LoRA r / alpha / dropout | 16 / 32 / 0.05 |
| quantization | 4-bit NF4 (double quant) |
| wall-clock | 56.1 min |
Evaluation
Micro P/R/F1 over de-duplicated, lowercased (mention, type) pairs on
300 held-out test sentences:
| precision | recall | F1 | invalid JSON |
|---|---|---|---|
| 0.634 | 0.605 | 0.619 | 0.7% |
Sentence-level, so not comparable to document-level BC5CDR figures.
- Downloads last month
- 24