Downloads · 30 days
41
0% of all-time downloads
tomaarsen/span-marker-bert-base-uncased-bionlp
span-marker-bert-base-uncased-bionlp is a token classification model from tomaarsen. Use it when you need labels on individual words, such as names. It is set up for span-marker. The card lists the license as other.
This is a SpanMarker model trained on the BioNLP2004 dataset that can be used for Named Entity Recognition. This SpanMarker model uses bert-base-uncased as the underlying encoder. See train.py for the training script.
Downloads · 30 days
41
0% of all-time downloads
All-time downloads
26.3K
Public
Parameters
109M
876 MB on disk
Likes
5
Public
Click a slice to open those files.
.bin438 MB · 50%
How the weights are stored.
F32109M · 100%
From the Hugging Face model README
This is a SpanMarker model trained on the BioNLP2004 dataset that can be used for Named Entity Recognition. This SpanMarker model uses bert-base-uncased as the underlying encoder. See train.py for the training script.
| Label | Examples |
|---|---|
| DNA | "immunoglobulin heavy-chain enhancer", "enhancer", "immunoglobulin heavy-chain ( IgH ) enhancer" |
| RNA | "GATA-1 mRNA", "c-myb mRNA", "antisense myb RNA" |
| cell_line | "monocytic U937 cells", "TNF-treated HUVECs", "HUVECs" |
| cell_type | "B cells", "non-B cells", "human red blood cells" |
| protein | "ICAM-1", "VCAM-1", "NADPH oxidase" |
| Label | Precision | Recall | F1 |
|---|---|---|---|
| all | 0.7290 | 0.7983 | 0.7621 |
| DNA | 0.7174 | 0.7505 | 0.7336 |
| RNA | 0.6977 | 0.7692 | 0.7317 |
| cell_line | 0.5831 | 0.7020 | 0.6370 |
| cell_type | 0.8222 | 0.7381 | 0.7779 |
| protein | 0.7196 | 0.8407 | 0.7755 |
from span_marker import SpanMarkerModel
# Download from the 🤗 Hub
model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-bert-base-uncased-bionlp")
# Run inference
entities = model.predict("In erythroid cells most of the transcription activity was contained in a 150 bp promoter fragment with binding sites for transcription factors AP2, Sp1 and the erythroid-specific GATA-1.")
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>from span_marker import SpanMarkerModel, Trainer
# Download from the 🤗 Hub
model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-bert-base-uncased-bionlp")
# Specify a Dataset with "tokens" and "ner_tag" columns
dataset = load_dataset("conll2003") # For example CoNLL2003
# Initialize a Trainer using the pretrained model & dataset
trainer = Trainer(
model=model,
train_dataset=dataset["train"],
eval_dataset=dataset["validation"],
)
trainer.train()
trainer.save_model("tomaarsen/span-marker-bert-base-uncased-bionlp-finetuned")
</details>
| Training set | Min | Median | Max |
|---|---|---|---|
| Sentence length | 2 | 26.5790 | 166 |
| Entities per sentence | 0 | 2.7528 | 23 |
| Epoch | Step | Validation Loss | Validation Precision | Validation Recall | Validation F1 | Validation Accuracy |
|---|---|---|---|---|---|---|
| 0.4505 | 300 | 0.0210 | 0.7497 | 0.7659 | 0.7577 | 0.9254 |
| 0.9009 | 600 | 0.0162 | 0.8048 | 0.8217 | 0.8131 | 0.9432 |
| 1.3514 | 900 | 0.0154 | 0.8126 | 0.8249 | 0.8187 | 0.9434 |
| 1.8018 | 1200 | 0.0149 | 0.8148 | 0.8451 | 0.8296 | 0.9481 |
| 2.2523 | 1500 | 0.0150 | 0.8297 | 0.8438 | 0.8367 | 0.9501 |
| 2.7027 | 1800 | 0.0145 | 0.8280 | 0.8443 | 0.8361 | 0.9501 |
Carbon emissions were measured using CodeCarbon.