Downloads · 30 days
5
1% of all-time downloads
tomaarsen/span-marker-xlm-roberta-large-verbs
span-marker-xlm-roberta-large-verbs 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 apache-2.0.
This is a SpanMarker model that can be used for identifying verbs in text. In particular, this SpanMarker model uses xlm-roberta-large as the underlying encoder. See spanmarkerverbstrain.ipynb for the training script…
Downloads · 30 days
5
1% of all-time downloads
All-time downloads
571
Public
Parameters
560M
4.5 GB on disk
Likes
2
Public
Click a slice to open those files.
.bin2.2 GB · 50%
How the weights are stored.
F32560M · 100%
From the Hugging Face model README
This is a SpanMarker model that can be used for identifying verbs in text. In particular, this SpanMarker model uses xlm-roberta-large as the underlying encoder. See span_marker_verbs_train.ipynb for the training script used to create this model.
Note that this model is an experiment about the feasibility of SpanMarker as a POS tagger. I would generally recommend using spaCy or NLTK instead, as these are more computationally efficient approaches.
To use this model for inference, first install the span_marker library:
pip install span_marker
You can then run inference with this model like so:
from span_marker import SpanMarkerModel
# Download from the 🤗 Hub
model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-xlm-roberta-large-verbs")
# Run inference
entities = model.predict("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.")
See the SpanMarker repository for documentation and additional information on this library.
It achieves the following results on the evaluation set:
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
|---|---|---|---|---|---|---|---|
| 0.036 | 0.61 | 1000 | 0.0151 | 0.9911 | 0.9733 | 0.9821 | 0.9956 |
| 0.0126 | 1.22 | 2000 | 0.0131 | 0.9856 | 0.9864 | 0.9860 | 0.9965 |
| 0.0175 | 1.83 | 3000 | 0.0154 | 0.9735 | 0.9894 | 0.9814 | 0.9953 |
| 0.0115 | 2.45 | 4000 | 0.0172 | 0.9821 | 0.9871 | 0.9845 | 0.9962 |
Warning: This model works best when punctuation is separated from the prior words, so
# ✅
model.predict("He plays J. Robert Oppenheimer , an American theoretical physicist .")
# ❌
model.predict("He plays J. Robert Oppenheimer, an American theoretical physicist.")
# You can also supply a list of words directly: ✅
model.predict(["He", "plays", "J.", "Robert", "Oppenheimer", ",", "an", "American", "theoretical", "physicist", "."])
The same may be beneficial for some languages, such as splitting "l'ocean Atlantique" into "l' ocean Atlantique".