SpanMarker with bert-base-uncased on Acronym Identification
This is a SpanMarker model trained on the Acronym Identification 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.
Is your data always capitalized correctly? Then consider using the cased variant of this model instead for better performance: tomaarsen/span-marker-bert-base-acronyms.
1from span_marker import SpanMarkerModel
23# Download from the 🤗 Hub4model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-bert-base-uncased-acronyms")5# Run inference6entities = model.predict("compression algorithms like principal component analysis (pca) can reduce noise and complexity.")
Downstream Use
You can finetune this model on your own dataset.
Click to expand
python
1from span_marker import SpanMarkerModel, Trainer
23# Download from the 🤗 Hub4model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-bert-base-uncased-acronyms")56# Specify a Dataset with "tokens" and "ner_tag" columns7dataset = load_dataset("conll2003")# For example CoNLL200389# Initialize a Trainer using the pretrained model & dataset10trainer = Trainer(11 model=model,12 train_dataset=dataset["train"],13 eval_dataset=dataset["validation"],14)15trainer.train()16trainer.save_model("tomaarsen/span-marker-bert-base-uncased-acronyms-finetuned")
Training Details
Training Set Metrics
Training set
Min
Median
Max
Sentence length
4
32.3372
170
Entities per sentence
0
2.6775
24
Training Hyperparameters
learning_rate: 5e-05
train_batch_size: 32
eval_batch_size: 32
seed: 42
optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08