HuggingFace Transformers with biomedical LMs (BioBERT, PubMedBERT, BioGPT, BioMedLM) for scientific NLP: NER (genes, diseases, chemicals), relation extraction, QA, text classification, abstract summarization. Covers loading, biomedical tokenization, inference pipelines, fine-tuning. Alternatives: spaCy en_core_sci_lg (rule-based NER), Stanza (biomedical models), NLTK.
SkillScore95Maintained
Automatic
◆AI Engineer pack
Last verified 8/23/2026
What it changes
Passed 21 of 22 test cases with the skill, and 19 of 22 without it.
Without skill86%
With skill95%
Checks it passed that the model alone missed
Uses "sultan/BioM-ELECTRA-Large-SQuAD2" as the model identifier.
Computes sentence embeddings by pooling output hidden states from the transformer model.
Imports tokenizer and model from the transformers library rather than sentence-transformers.
and 1 more in the full report
2 fixed19 passed either way1 still failing0 broke
Pass-rate lift
+9 pp
Tokens
+227%
Agent turns
0%
Response time
-3%
Model gemini-3.6-flashMeasured 8/23/2026v121 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 2
Prompt
Can you write a Python script that ranks candidate research sentences by semantic similarity against a reference query? Use a PubMed-trained biomedical transformer model to generate sentence-level embeddings, compute cosine similarity between the query and each sentence, and print the ranked results along with their similarity scores.
What was checked, without and with the skill
Checked
Without skill
With skill
Uses "microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext" as the pre-trained model identifier.
Missed
Passed
Imports tokenizer and model from the transformers library rather than sentence-transformers.
Missed
Passed
Computes sentence embeddings by pooling output hidden states from the transformer model.
Missed
Passed
case-01 · gemini-3.6-flash · 8/23/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md469 linessingle file
Transformers for Biomedical NLP
Overview
HuggingFace Transformers provides a unified API to load, run, and fine-tune 500+ biomedical language models. The key biomedical models — BioBERT (trained on PubMed abstracts + PMC full text), PubMedBERT (trained from scratch on PubMed), BioGPT (generative, trained on PubMed), and BioMedLM — significantly outperform general-purpose BERT on biomedical NER, relation extraction, and question answering. The pipeline() abstraction handles tokenization, inference, and postprocessing in one call. Fine-tuning on task-specific labeled data (e.g., BC5CDR for chemical/disease NER) takes under an hour on a single GPU. The datasets library provides direct access to standard biomedical benchmarks.
When to Use
Extracting gene names, disease mentions, drug names, or chemical entities from biomedical abstracts (NER)
Classifying abstracts by topic, sentiment of clinical outcomes, or PICO elements for systematic reviews
Answering specific questions from biomedical literature using extractive QA (BioASQ format)
Generating hypotheses or summaries from biomedical text using BioGPT or BioMedLM
Fine-tuning a pre-trained biomedical model on a custom labeled dataset (e.g., your lab's annotations)
Embedding biomedical sentences for semantic similarity search across literature
Use spaCy + en_core_sci_lg for fast rule-augmented NER; use Stanza for dependency parsing
from transformers import pipeline
# Named entity recognition with BioBERT
ner = pipeline("ner", model="allenai/scibert_scivocab_cased",
aggregation_strategy="simple")
text = "BRCA1 mutations are associated with increased risk of breast cancer and ovarian cancer."
entities = ner(text)
for ent in entities: