guishe commited on
Commit
826bd48
1 Parent(s): 108bd5c

Add training details

Browse files
Files changed (1) hide show
  1. README.md +154 -46
README.md CHANGED
@@ -1,4 +1,6 @@
1
  ---
 
 
2
  library_name: span-marker
3
  tags:
4
  - span-marker
@@ -6,34 +8,145 @@ tags:
6
  - ner
7
  - named-entity-recognition
8
  - generated_from_span_marker_trainer
 
 
9
  metrics:
10
  - precision
11
  - recall
12
  - f1
13
- widget: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  pipeline_tag: token-classification
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ---
16
 
17
- # SpanMarker
18
 
19
- This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that can be used for Named Entity Recognition.
20
 
21
  ## Model Details
22
 
23
  ### Model Description
24
  - **Model Type:** SpanMarker
25
- <!-- - **Encoder:** [Unknown](https://huggingface.co/unknown) -->
26
  - **Maximum Sequence Length:** 256 tokens
27
  - **Maximum Entity Length:** 8 words
28
- <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
29
- <!-- - **Language:** Unknown -->
30
- <!-- - **License:** Unknown -->
31
 
32
  ### Model Sources
33
 
34
  - **Repository:** [SpanMarker on GitHub](https://github.com/tomaarsen/SpanMarkerNER)
35
  - **Thesis:** [SpanMarker For Named Entity Recognition](https://raw.githubusercontent.com/tomaarsen/SpanMarkerNER/main/thesis.pdf)
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  ## Uses
38
 
39
  ### Direct Use for Inference
@@ -42,9 +155,9 @@ This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that ca
42
  from span_marker import SpanMarkerModel
43
 
44
  # Download from the 🤗 Hub
45
- model = SpanMarkerModel.from_pretrained("span_marker_model_id")
46
  # Run inference
47
- entities = model.predict("None")
48
  ```
49
 
50
  ### Downstream Use
@@ -56,7 +169,7 @@ You can finetune this model on your own dataset.
56
  from span_marker import SpanMarkerModel, Trainer
57
 
58
  # Download from the 🤗 Hub
59
- model = SpanMarkerModel.from_pretrained("span_marker_model_id")
60
 
61
  # Specify a Dataset with "tokens" and "ner_tag" columns
62
  dataset = load_dataset("conll2003") # For example CoNLL2003
@@ -68,30 +181,43 @@ trainer = Trainer(
68
  eval_dataset=dataset["validation"],
69
  )
70
  trainer.train()
71
- trainer.save_model("span_marker_model_id-finetuned")
72
  ```
73
  </details>
74
 
75
- <!--
76
- ### Out-of-Scope Use
77
-
78
- *List how the model may foreseeably be misused and address what users ought not to do with the model.*
79
- -->
80
-
81
- <!--
82
- ## Bias, Risks and Limitations
83
-
84
- *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
85
- -->
86
-
87
- <!--
88
- ### Recommendations
89
-
90
- *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
91
- -->
92
 
93
  ## Training Details
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  ### Framework Versions
96
  - Python: 3.10.8
97
  - SpanMarker: 1.5.0
@@ -111,21 +237,3 @@ trainer.save_model("span_marker_model_id-finetuned")
111
  url = {https://github.com/tomaarsen/SpanMarkerNER}
112
  }
113
  ```
114
-
115
- <!--
116
- ## Glossary
117
-
118
- *Clearly define terms in order to be accessible across audiences.*
119
- -->
120
-
121
- <!--
122
- ## Model Card Authors
123
-
124
- *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
125
- -->
126
-
127
- <!--
128
- ## Model Card Contact
129
-
130
- *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
131
- -->
 
1
  ---
2
+ language: en
3
+ license: cc-by-nc-sa-4.0
4
  library_name: span-marker
5
  tags:
6
  - span-marker
 
8
  - ner
9
  - named-entity-recognition
10
  - generated_from_span_marker_trainer
11
+ datasets:
12
+ - DFKI-SLT/few-nerd
13
  metrics:
14
  - precision
15
  - recall
16
  - f1
17
+ widget:
18
+ - text: The WPC led the international peace movement in the decade after the Second
19
+ World War, but its failure to speak out against the Soviet suppression of the
20
+ 1956 Hungarian uprising and the resumption of Soviet nuclear tests in 1961 marginalised
21
+ it, and in the 1960s it was eclipsed by the newer, non-aligned peace organizations
22
+ like the Campaign for Nuclear Disarmament.
23
+ - text: Most of the Steven Seagal movie "Under Siege "(co-starring Tommy Lee Jones)
24
+ was filmed on the, which is docked on Mobile Bay at Battleship Memorial Park and
25
+ open to the public.
26
+ - text: 'The Central African CFA franc (French: "franc CFA "or simply "franc ", ISO
27
+ 4217 code: XAF) is the currency of six independent states in Central Africa: Cameroon,
28
+ Central African Republic, Chad, Republic of the Congo, Equatorial Guinea and Gabon.'
29
+ - text: Brenner conducted post-doctoral research at Brandeis University with Gregory
30
+ Petsko and then took his first academic position at Thomas Jefferson University
31
+ in 1996, moving to Dartmouth Medical School in 2003, where he served as Associate
32
+ Director for Basic Sciences at Norris Cotton Cancer Center.
33
+ - text: On Friday, October 27, 2017, the Senate of Spain (Senado) voted 214 to 47
34
+ to invoke Article 155 of the Spanish Constitution over Catalonia after the Catalan
35
+ Parliament declared the independence.
36
  pipeline_tag: token-classification
37
+ base_model: numind/generic-entity_recognition-v1
38
+ model-index:
39
+ - name: SpanMarker with numind/generic-entity_recognition-v1 on FewNERD
40
+ results:
41
+ - task:
42
+ type: token-classification
43
+ name: Named Entity Recognition
44
+ dataset:
45
+ name: FewNERD
46
+ type: DFKI-SLT/few-nerd
47
+ split: eval
48
+ metrics:
49
+ - type: f1
50
+ value: 0.7039859923782059
51
+ name: F1
52
+ - type: precision
53
+ value: 0.7047408904377952
54
+ name: Precision
55
+ - type: recall
56
+ value: 0.7032327098380559
57
+ name: Recall
58
  ---
59
 
60
+ # SpanMarker with numind/generic-entity_recognition-v1 on FewNERD
61
 
62
+ This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model trained on the [FewNERD](https://huggingface.co/datasets/DFKI-SLT/few-nerd) dataset that can be used for Named Entity Recognition. This SpanMarker model uses [numind/generic-entity_recognition-v1](https://huggingface.co/numind/generic-entity_recognition-v1) as the underlying encoder.
63
 
64
  ## Model Details
65
 
66
  ### Model Description
67
  - **Model Type:** SpanMarker
68
+ - **Encoder:** [numind/generic-entity_recognition-v1](https://huggingface.co/numind/generic-entity_recognition-v1)
69
  - **Maximum Sequence Length:** 256 tokens
70
  - **Maximum Entity Length:** 8 words
71
+ - **Training Dataset:** [FewNERD](https://huggingface.co/datasets/DFKI-SLT/few-nerd)
72
+ - **Language:** en
73
+ - **License:** cc-by-nc-sa-4.0
74
 
75
  ### Model Sources
76
 
77
  - **Repository:** [SpanMarker on GitHub](https://github.com/tomaarsen/SpanMarkerNER)
78
  - **Thesis:** [SpanMarker For Named Entity Recognition](https://raw.githubusercontent.com/tomaarsen/SpanMarkerNER/main/thesis.pdf)
79
 
80
+ ### Model Labels
81
+ | Label | Examples |
82
+ |:-----------------------------------------|:---------------------------------------------------------------------------------------------------------|
83
+ | art-broadcastprogram | "Corazones", "The Gale Storm Show : Oh , Susanna", "Street Cents" |
84
+ | art-film | "Shawshank Redemption", "L'Atlantide", "Bosch" |
85
+ | art-music | "Hollywood Studio Symphony", "Atkinson , Danko and Ford ( with Brockie and Hilton )", "Champion Lover" |
86
+ | art-other | "The Today Show", "Venus de Milo", "Aphrodite of Milos" |
87
+ | art-painting | "Production/Reproduction", "Touit", "Cofiwch Dryweryn" |
88
+ | art-writtenart | "The Seven Year Itch", "Imelda de ' Lambertazzi", "Time" |
89
+ | building-airport | "Sheremetyevo International Airport", "Newark Liberty International Airport", "Luton Airport" |
90
+ | building-hospital | "Yeungnam University Hospital", "Hokkaido University Hospital", "Memorial Sloan-Kettering Cancer Center" |
91
+ | building-hotel | "The Standard Hotel", "Flamingo Hotel", "Radisson Blu Sea Plaza Hotel" |
92
+ | building-library | "British Library", "Bayerische Staatsbibliothek", "Berlin State Library" |
93
+ | building-other | "Henry Ford Museum", "Alpha Recording Studios", "Communiplex" |
94
+ | building-restaurant | "Carnegie Deli", "Fatburger", "Trumbull" |
95
+ | building-sportsfacility | "Boston Garden", "Sports Center", "Glenn Warner Soccer Facility" |
96
+ | building-theater | "Sanders Theatre", "National Paris Opera", "Pittsburgh Civic Light Opera" |
97
+ | event-attack/battle/war/militaryconflict | "Easter Offensive", "Jurist", "Vietnam War" |
98
+ | event-disaster | "the 1912 North Mount Lyell Disaster", "1990s North Korean famine", "1693 Sicily earthquake" |
99
+ | event-election | "Elections to the European Parliament", "March 1898 elections", "1982 Mitcham and Morden by-election" |
100
+ | event-other | "Union for a Popular Movement", "Masaryk Democratic Movement", "Eastwood Scoring Stage" |
101
+ | event-protest | "Iranian Constitutional Revolution", "French Revolution", "Russian Revolution" |
102
+ | event-sportsevent | "World Cup", "National Champions", "Stanley Cup" |
103
+ | location-GPE | "Croatian", "Mediterranean Basin", "the Republic of Croatia" |
104
+ | location-bodiesofwater | "Arthur Kill", "Atatürk Dam Lake", "Norfolk coast" |
105
+ | location-island | "new Samsat district", "Laccadives", "Staten Island" |
106
+ | location-mountain | "Salamander Glacier", "Miteirya Ridge", "Ruweisat Ridge" |
107
+ | location-other | "Victoria line", "Northern City Line", "Cartuther" |
108
+ | location-park | "Painted Desert Community Complex Historic District", "Gramercy Park", "Shenandoah National Park" |
109
+ | location-road/railway/highway/transit | "NJT", "Newark-Elizabeth Rail Link", "Friern Barnet Road" |
110
+ | organization-company | "Texas Chicken", "Dixy Chicken", "Church 's Chicken" |
111
+ | organization-education | "MIT", "Belfast Royal Academy and the Ulster College of Physical Education", "Barnard College" |
112
+ | organization-government/governmentagency | "Congregazione dei Nobili", "Diet", "Supreme Court" |
113
+ | organization-media/newspaper | "Clash", "Al Jazeera", "TimeOut Melbourne" |
114
+ | organization-other | "Defence Sector C", "IAEA", "4th Army" |
115
+ | organization-politicalparty | "Al Wafa ' Islamic", "Shimpotō", "Kenseitō" |
116
+ | organization-religion | "UPCUSA", "Christian", "Jewish" |
117
+ | organization-showorganization | "Lizzy", "Bochumer Symphoniker", "Mr. Mister" |
118
+ | organization-sportsleague | "China League One", "NHL", "First Division" |
119
+ | organization-sportsteam | "Arsenal", "Luc Alphand Aventures", "Tottenham" |
120
+ | other-astronomything | "Algol", "`` Caput Larvae ''", "Zodiac" |
121
+ | other-award | "Order of the Republic of Guinea and Nigeria", "Grand Commander of the Order of the Niger", "GCON" |
122
+ | other-biologything | "N-terminal lipid", "Amphiphysin", "BAR" |
123
+ | other-chemicalthing | "uranium", "carbon dioxide", "sulfur" |
124
+ | other-currency | "$", "lac crore", "Travancore Rupee" |
125
+ | other-disease | "bladder cancer", "French Dysentery Epidemic of 1779", "hypothyroidism" |
126
+ | other-educationaldegree | "BSc ( Hons ) in physics", "Bachelor", "Master" |
127
+ | other-god | "Raijin", "Fujin", "El" |
128
+ | other-language | "Breton-speaking", "Latin", "English" |
129
+ | other-law | "Leahy–Smith America Invents Act ( AIA", "United States Freedom Support Act", "Thirty Years ' Peace" |
130
+ | other-livingthing | "monkeys", "patchouli", "insects" |
131
+ | other-medical | "amitriptyline", "Pediatrics", "pediatrician" |
132
+ | person-actor | "Tchéky Karyo", "Edmund Payne", "Ellaline Terriss" |
133
+ | person-artist/author | "Hicks", "Gaetano Donizett", "George Axelrod" |
134
+ | person-athlete | "Tozawa", "Neville", "Jaguar" |
135
+ | person-director | "Richard Quine", "Bob Swaim", "Frank Darabont" |
136
+ | person-other | "Campbell", "Holden", "Richard Benson" |
137
+ | person-politician | "William", "Rivière", "Emeric" |
138
+ | person-scholar | "Wurdack", "Stalmine", "Stedman" |
139
+ | person-soldier | "Joachim Ziegler", "Helmuth Weidling", "Krukenberg" |
140
+ | product-airplane | "Spey-equipped FGR.2s", "EC135T2 CPDS", "Luton" |
141
+ | product-car | "Phantom", "100EX", "Corvettes - GT1 C6R" |
142
+ | product-food | "red grape", "yakiniku", "V. labrusca" |
143
+ | product-game | "Hardcore RPG", "Splinter Cell", "Airforce Delta" |
144
+ | product-other | "X11", "PDP-1", "Fairbottom Bobs" |
145
+ | product-ship | "Essex", "Congress", "HMS `` Chinkara ''" |
146
+ | product-software | "AmiPDF", "Wikipedia", "Apdf" |
147
+ | product-train | "55022", "Royal Scots Grey", "High Speed Trains" |
148
+ | product-weapon | "AR-15 's", "ZU-23-2MR Wróbel II", "ZU-23-2M Wróbel" |
149
+
150
  ## Uses
151
 
152
  ### Direct Use for Inference
 
155
  from span_marker import SpanMarkerModel
156
 
157
  # Download from the 🤗 Hub
158
+ model = SpanMarkerModel.from_pretrained("guishe/span-marker-generic-entity_recognition-v1-fewnerd-fine-super")
159
  # Run inference
160
+ entities = model.predict("Most of the Steven Seagal movie \"Under Siege \"(co-starring Tommy Lee Jones) was filmed on the, which is docked on Mobile Bay at Battleship Memorial Park and open to the public.")
161
  ```
162
 
163
  ### Downstream Use
 
169
  from span_marker import SpanMarkerModel, Trainer
170
 
171
  # Download from the 🤗 Hub
172
+ model = SpanMarkerModel.from_pretrained("guishe/span-marker-generic-entity_recognition-v1-fewnerd-fine-super")
173
 
174
  # Specify a Dataset with "tokens" and "ner_tag" columns
175
  dataset = load_dataset("conll2003") # For example CoNLL2003
 
181
  eval_dataset=dataset["validation"],
182
  )
183
  trainer.train()
184
+ trainer.save_model("guishe/span-marker-generic-entity_recognition-v1-fewnerd-fine-super-finetuned")
185
  ```
186
  </details>
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
 
189
  ## Training Details
190
 
191
+ ### Training Set Metrics
192
+ | Training set | Min | Median | Max |
193
+ |:----------------------|:----|:--------|:----|
194
+ | Sentence length | 1 | 24.4945 | 267 |
195
+ | Entities per sentence | 0 | 2.5832 | 88 |
196
+
197
+ ### Training Hyperparameters
198
+ - learning_rate: 1e-05
199
+ - train_batch_size: 16
200
+ - eval_batch_size: 16
201
+ - seed: 42
202
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
203
+ - lr_scheduler_type: linear
204
+ - lr_scheduler_warmup_ratio: 0.1
205
+ - num_epochs: 3
206
+
207
+ ### Training Results
208
+ | Epoch | Step | Validation Loss | Validation Precision | Validation Recall | Validation F1 | Validation Accuracy |
209
+ |:------:|:-----:|:---------------:|:--------------------:|:-----------------:|:-------------:|:-------------------:|
210
+ | 0.2980 | 3000 | 0.0290 | 0.6503 | 0.6402 | 0.6452 | 0.9109 |
211
+ | 0.5961 | 6000 | 0.0250 | 0.6749 | 0.6794 | 0.6772 | 0.9202 |
212
+ | 0.8941 | 9000 | 0.0236 | 0.6908 | 0.6871 | 0.6889 | 0.9229 |
213
+ | 1.1921 | 12000 | 0.0234 | 0.6853 | 0.7007 | 0.6929 | 0.9239 |
214
+ | 1.4902 | 15000 | 0.0227 | 0.6966 | 0.6929 | 0.6948 | 0.9241 |
215
+ | 1.7882 | 18000 | 0.0221 | 0.7073 | 0.6922 | 0.6997 | 0.9250 |
216
+ | 2.0862 | 21000 | 0.0223 | 0.7003 | 0.6993 | 0.6998 | 0.9252 |
217
+ | 2.3843 | 24000 | 0.0222 | 0.6971 | 0.7027 | 0.6999 | 0.9254 |
218
+ | 2.6823 | 27000 | 0.0219 | 0.7044 | 0.7004 | 0.7024 | 0.9259 |
219
+ | 2.9803 | 30000 | 0.0219 | 0.7047 | 0.7032 | 0.7040 | 0.9261 |
220
+
221
  ### Framework Versions
222
  - Python: 3.10.8
223
  - SpanMarker: 1.5.0
 
237
  url = {https://github.com/tomaarsen/SpanMarkerNER}
238
  }
239
  ```