Downloads · 30 days
5
7% of all-time downloads
jeffwuu32/bc5cdr-ner-gemma-4-E2B-it
bc5cdr-ner-gemma-4-E2B-it is a machine learning model from jeffwuu32. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
LoRA adapter for NER span extraction on BC5CDR, fine-tuned from the open-weights google/gemma-4-E2B-it.
Downloads · 30 days
5
7% of all-time downloads
All-time downloads
76
Public
Repo size
1.7 GB
Likes
0
Public
Click a slice to open those files.
.safetensors1.6 GB · 98%
From the Hugging Face model README
LoRA adapter for NER span extraction on BC5CDR, fine-tuned from the open-weights google/gemma-4-E2B-it.
For reproducing results, refer to this GitHub repository.
from transformers import AutoModelForMultimodalLM, AutoProcessor
from peft import PeftModel
base = AutoModelForMultimodalLM.from_pretrained("google/gemma-4-E2B-it", device_map="auto")
model = PeftModel.from_pretrained(base, "jeffwuu32/bc5cdr-ner-gemma-4-E2B-it")
processor = AutoProcessor.from_pretrained("jeffwuu32/bc5cdr-ner-gemma-4-E2B-it")
This loads the weights only. See the repo for complete generation setup.
Inference uses the following system prompt:
Extract text naming Chemical or Disease from the input. The text has positional markers already embedded (`<unused0>N<unused1>`, e.g. `<unused0>58<unused1>`) — each marker's id is arbitrary, not a reading-order count, so markers do not necessarily appear in ascending numeric order. These markers are not part of the content; never extract one as a match.
Copy each match verbatim from the input, including any irregular internal whitespace or embedded line breaks. Include negated, uncertain, and hedged mentions, but not the negation/hedging words themselves. Do not include anything outside the categories above.
Before every match, write the id of the nearest `<unused0>N<unused1>` marker before it, followed by `<unused2>` — repeat this prefix before EVERY match, even consecutive matches under the same marker; never omit or dedupe it — then the match text, then its `<CATEGORY_TOKEN>`, as `N<unused2>TEXT<CATEGORY_TOKEN>` (text first, category token last — not the other way around, and no other characters — never write markup like `<span>`). `<CATEGORY_TOKEN>` is one of: `<unused3>` Chemical or `<unused4>` Disease. Tag every occurrence separately, even repeats of the same text — do not deduplicate. Output only this, with no explanation or markdown fences.
| category | P | R | F1 |
|---|---|---|---|
| micro | 0.692 | 0.733 | 0.712 |
| macro | 0.688 | 0.728 | 0.707 |
| Chemical | 0.721 | 0.779 | 0.749 |
| Disease | 0.656 | 0.677 | 0.666 |
| category | P | R | F1 |
|---|---|---|---|
| micro | 0.728 | 0.771 | 0.749 |
| macro | 0.728 | 0.775 | 0.750 |
| Chemical | 0.736 | 0.822 | 0.777 |
| Disease | 0.720 | 0.727 | 0.723 |
Li et al., "BioCreative V CDR task corpus: a resource for chemical disease relation extraction," Database, 2016.