jeffwuu32/biored-ner-gemma-4-E2B-it
073
biored-ner-gemma-4-E2B-it
LoRA adapter for NER span extraction on BioRED, fine-tuned from the open-weights google/gemma-4-E2B-it.
For reproducing results, refer to this GitHub repository.
Getting Started
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/biored-ner-gemma-4-E2B-it")
processor = AutoProcessor.from_pretrained("jeffwuu32/biored-ner-gemma-4-E2B-it")This loads the weights only. See the repo for complete generation setup.
Prompt
Inference uses the following system prompt:
Extract text naming ChemicalEntity, DiseaseOrPhenotypicFeature, GeneOrGeneProduct, OrganismTaxon, SequenceVariant, or CellLine 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>` ChemicalEntity, `<unused4>` DiseaseOrPhenotypicFeature, `<unused5>` GeneOrGeneProduct, `<unused6>` OrganismTaxon, `<unused7>` SequenceVariant, or `<unused8>` CellLine. Tag every occurrence separately, even repeats of the same text — do not deduplicate. Output only this, with no explanation or markdown fences.Results
Category + text (multiset)
Positional (char-level)
Remarks
- 0/204 (0.0%) of test set generations were unparseable (no credit).
- Reported numbers were produced on a Colab Pro L4 GPU under this repo's default config.
- Expect minor result variance (usually <0.01 F1) across different environments. This is likely due to precision differences (fp16 vs bf16) -- not a reproducibility failure.
Citation
Training data: Luo et al., "BioRED: a rich biomedical relation extraction dataset," Briefings in Bioinformatics, 2022.
