File size: 6,985 Bytes
83e24e5 a40ab9f 83e24e5 a40ab9f 83e24e5 a40ab9f 83e24e5 a40ab9f 83e24e5 a40ab9f a760f3b a40ab9f a760f3b 83e24e5 a0b5201 d6e95b9 a40ab9f a760f3b a40ab9f 83e24e5 a40ab9f 83e24e5 a40ab9f 83e24e5 a40ab9f 83e24e5 a40ab9f 83e24e5 a40ab9f 83e24e5 a40ab9f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
---
library_name: span-marker
tags:
- span-marker
- token-classification
- ner
- named-entity-recognition
- generated_from_span_marker_trainer
datasets:
- imvladikon/nemo_corpus
metrics:
- precision
- recall
- f1
widget:
- text: אחר כך הצטרף ל דאלאס מאווריקס מ ה אנ.בי.איי ו חזר לשחק ב אירופה ב ספרד ב מדי
קאחה בילבאו ו חירונה
- text: ב קיץ 1982 ניסה טל ברודי (אז עוזר ה מאמן) להחתימו, אבל בריאנט, ש סבתו יהודיה,
חתם אז ב פורד קאנטו ו זכה עמ היא ב אותה עונה ב גביע אירופה ל אלופות.
- text: יו"ר ועדת ה נוער נתן סלובטיק אמר ש ה שחקנים של אנחנו לא משתלבים ב אירופה.
- text: ב ה סגל ש יתכנס מחר אחר ה צהריים ל מחנה אימונים ב שפיים 17 שחקנים, כולל מוזמן
חדש שירן אדירי מ מכבי תל אביב.
- text: 'תוצאות אחרות: טורינו 2 (מורלו עצמי, מולר) לצה 0; קאליארי 0 לאציו 1 (פסטה,
שער עצמי); פיורנטינה 2 (נאפי, פאציונה) גנואה 2 (אורלאנדו, שקוראווי).'
pipeline_tag: token-classification
model-index:
- name: SpanMarker
results:
- task:
type: token-classification
name: Named Entity Recognition
dataset:
name: Unknown
type: imvladikon/nemo_corpus
split: test
metrics:
- type: f1
value: 0.7338129496402878
name: F1
- type: precision
value: 0.7577142857142857
name: Precision
- type: recall
value: 0.7113733905579399
name: Recall
---
# SpanMarker
This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model trained on the [imvladikon/nemo_corpus](https://huggingface.co/datasets/imvladikon/nemo_corpus) dataset that can be used for Named Entity Recognition.
## Model Details
### Model Description
- **Model Type:** SpanMarker
<!-- - **Encoder:** [Unknown](https://huggingface.co/unknown) -->
- **Maximum Sequence Length:** 512 tokens
- **Maximum Entity Length:** 100 words
- **Training Dataset:** [imvladikon/nemo_corpus](https://huggingface.co/datasets/imvladikon/nemo_corpus)
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->
### Model Sources
- **Repository:** [SpanMarker on GitHub](https://github.com/tomaarsen/SpanMarkerNER)
- **Thesis:** [SpanMarker For Named Entity Recognition](https://raw.githubusercontent.com/tomaarsen/SpanMarkerNER/main/thesis.pdf)
### Model Labels
| Label | Examples |
|:------|:------------------------------------------------|
| ANG | "יידיש", "גרמנית", "אנגלית" |
| DUC | "דינמיט", "סובארו", "מרצדס" |
| EVE | "מצדה", "הצהרת בלפור", "ה שואה" |
| FAC | "ברזילי", "כלא עזה", "תל - ה שומר" |
| GPE | "ה שטחים", "שפרעם", "רצועת עזה" |
| LOC | "שייח רדואן", "גיבאליה", "חאן יונס" |
| ORG | "כך", "ה ארץ", "מרחב ה גליל" |
| PER | "רמי רהב", "נימר חוסיין", "איברהים נימר חוסיין" |
| WOA | "קיטש ו מוות", "קדיש", "ה ארץ" |
## Evaluation
### Metrics
| Label | Precision | Recall | F1 |
|:--------|:----------|:-------|:-------|
| **all** | 0.7577 | 0.7114 | 0.7338 |
| ANG | 0.0 | 0.0 | 0.0 |
| DUC | 0.0 | 0.0 | 0.0 |
| FAC | 0.0 | 0.0 | 0.0 |
| GPE | 0.7085 | 0.8103 | 0.7560 |
| LOC | 0.5714 | 0.1951 | 0.2909 |
| ORG | 0.7460 | 0.6912 | 0.7176 |
| PER | 0.8301 | 0.8052 | 0.8175 |
| WOA | 0.0 | 0.0 | 0.0 |
## Uses
### Direct Use for Inference
```python
from span_marker import SpanMarkerModel
# Download from the 🤗 Hub
model = SpanMarkerModel.from_pretrained("iahlt/span-marker-alephbert-small-nemo-mt-he")
# Run inference
entities = model.predict("יו\"ר ועדת ה נוער נתן סלובטיק אמר ש ה שחקנים של אנחנו לא משתלבים ב אירופה.")
entities
```
### Using spacy
```bash
pip install spacy_udpipe
```
```python
import spacy
from spacy.lang.he import Hebrew
import spacy_udpipe
spacy_udpipe.download("he") # download public udpipe model, but possible to use any your spacy model
nlp = spacy_udpipe.load("he")
nlp.add_pipe("span_marker", config={"model": "iahlt/span-marker-alephbert-small-nemo-mt-he"})
text = "יו\"ר ועדת הנוער נתן סלובטיק אמר שהשחקנים של אנחנו לא משתלבים באירופה."
doc = nlp(text)
print([(entity, entity.label_) for entity in doc.ents])
# [(ועדת הנוער, 'ORG'), (נתן סלובטיק, 'PER'), (אירופה, 'GPE')]
```
## Training Details
### Training Set Metrics
| Training set | Min | Median | Max |
|:----------------------|:----|:--------|:----|
| Sentence length | 1 | 25.4427 | 117 |
| Entities per sentence | 0 | 1.2472 | 20 |
### Training Hyperparameters
- learning_rate: 1e-05
- train_batch_size: 2
- eval_batch_size: 2
- seed: 42
- gradient_accumulation_steps: 2
- total_train_batch_size: 4
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 4
- mixed_precision_training: Native AMP
### Evaluation results
| | 0 |
|:-----------------------|-----------:|
| eval_loss | 0.00487611 |
| eval_overall_precision | 0.822917 |
| eval_overall_recall | 0.791583 |
| eval_overall_f1 | 0.806946 |
| eval_overall_accuracy | 0.969029 |
### Test results
| | 0 |
|:-----------------------|-----------:|
| test_loss | 0.00652107 |
| test_overall_precision | 0.747289 |
| test_overall_recall | 0.73927 |
| test_overall_f1 | 0.743258 |
| test_overall_accuracy | 0.960126 |
### Framework Versions
- Python: 3.10.12
- SpanMarker: 1.5.0
- Transformers: 4.35.2
- PyTorch: 2.1.0+cu118
- Datasets: 2.15.0
- Tokenizers: 0.15.0
## 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.*
--> |