CoolFace
Modelpublic

tomaarsen/span-marker-bert-base-orgs

sourceHugging Facecc-by-sa-4.0updated 3y agoView on Hugging Face
1likes222downloads
Model Card

SpanMarker with bert-base-cased on FewNERD, CoNLL2003, and OntoNotes v5

This is a SpanMarker model trained on the FewNERD, CoNLL2003, and OntoNotes v5 dataset that can be used for Named Entity Recognition. This SpanMarker model uses bert-base-cased as the underlying encoder.

Model Details

Model Description

Model Sources

Model Labels

LabelExamples
ORG"Texas Chicken", "IAEA", "Church 's Chicken"

Evaluation

Metrics

LabelPrecisionRecallF1
all0.79580.79360.7947
ORG0.79580.79360.7947

Uses

Direct Use for Inference

python
from span_marker import SpanMarkerModel

# Download from the 🤗 Hub
model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-bert-base-orgs")
# Run inference
entities = model.predict("Postponed: East Fife v Clydebank, St Johnstone v")

Downstream Use

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

python
from span_marker import SpanMarkerModel, Trainer

# Download from the 🤗 Hub
model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-bert-base-orgs")

# 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-orgs-finetuned")

</details>

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Set Metrics

Training setMinMedianMax
Sentence length123.5706263
Entities per sentence00.786539

Training Hyperparameters

  • learning_rate: 5e-05
  • trainbatchsize: 32
  • evalbatchsize: 32
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lrschedulertype: linear
  • lrschedulerwarmup_ratio: 0.1
  • num_epochs: 3

Training Results

EpochStepValidation LossValidation PrecisionValidation RecallValidation F1Validation Accuracy
0.713130000.00610.79780.78300.79040.9764
1.426260000.00590.81700.78430.80040.9774
2.139390000.00610.82210.79380.80770.9772
2.8524120000.00620.82110.80030.81060.9780

Environmental Impact

Carbon emissions were measured using CodeCarbon.

  • Carbon Emitted: 0.248 kg of CO2
  • Hours Used: 1.766 hours

Training Hardware

  • On Cloud: No
  • GPU Model: 1 x NVIDIA GeForce RTX 3090
  • CPU Model: 13th Gen Intel(R) Core(TM) i7-13700K
  • RAM Size: 31.78 GB

Framework Versions

  • Python: 3.9.16
  • SpanMarker: 1.5.1.dev
  • Transformers: 4.30.0
  • PyTorch: 2.0.1+cu118
  • Datasets: 2.14.0
  • Tokenizers: 0.13.3

Citation

BibTeX

@software{Aarsen_SpanMarker,
    author = {Aarsen, Tom},
    license = {Apache-2.0},
    title = {{SpanMarker for Named Entity Recognition}},
    url = {https://github.com/tomaarsen/SpanMarkerNER}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->