guishe commited on
Commit
9a1641d
1 Parent(s): 63e4092

Add training details info

Browse files
Files changed (1) hide show
  1. README.md +150 -47
README.md CHANGED
@@ -1,4 +1,7 @@
1
  ---
 
 
 
2
  library_name: span-marker
3
  tags:
4
  - span-marker
@@ -6,34 +9,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 +156,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 +170,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 +182,37 @@ 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.4.0
@@ -111,21 +232,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:
3
+ - en
4
+ license: cc-by-nc-sa-4.0
5
  library_name: span-marker
6
  tags:
7
  - span-marker
 
9
  - ner
10
  - named-entity-recognition
11
  - generated_from_span_marker_trainer
12
+ datasets:
13
+ - DFKI-SLT/few-nerd
14
  metrics:
15
  - precision
16
  - recall
17
  - f1
18
+ widget:
19
+ - text: The WPC led the international peace movement in the decade after the Second
20
+ World War, but its failure to speak out against the Soviet suppression of the
21
+ 1956 Hungarian uprising and the resumption of Soviet nuclear tests in 1961 marginalised
22
+ it, and in the 1960s it was eclipsed by the newer, non-aligned peace organizations
23
+ like the Campaign for Nuclear Disarmament.
24
+ - text: Most of the Steven Seagal movie "Under Siege "(co-starring Tommy Lee Jones)
25
+ was filmed on the, which is docked on Mobile Bay at Battleship Memorial Park and
26
+ open to the public.
27
+ - text: 'The Central African CFA franc (French: "franc CFA "or simply "franc ", ISO
28
+ 4217 code: XAF) is the currency of six independent states in Central Africa: Cameroon,
29
+ Central African Republic, Chad, Republic of the Congo, Equatorial Guinea and Gabon.'
30
+ - text: Brenner conducted post-doctoral research at Brandeis University with Gregory
31
+ Petsko and then took his first academic position at Thomas Jefferson University
32
+ in 1996, moving to Dartmouth Medical School in 2003, where he served as Associate
33
+ Director for Basic Sciences at Norris Cotton Cancer Center.
34
+ - text: On Friday, October 27, 2017, the Senate of Spain (Senado) voted 214 to 47
35
+ to invoke Article 155 of the Spanish Constitution over Catalonia after the Catalan
36
+ Parliament declared the independence.
37
  pipeline_tag: token-classification
38
+ base_model: BAAI/bge-base-en-v1.5
39
+ model-index:
40
+ - name: SpanMarker with BAAI/bge-base-en-v1.5 on FewNERD
41
+ results:
42
+ - task:
43
+ type: token-classification
44
+ name: Named Entity Recognition
45
+ dataset:
46
+ name: FewNERD
47
+ type: DFKI-SLT/few-nerd
48
+ split: eval
49
+ metrics:
50
+ - type: f1
51
+ value: 0.6726393599802055
52
+ name: F1
53
+ - type: precision
54
+ value: 0.6740082644628099
55
+ name: Precision
56
+ - type: recall
57
+ value: 0.6712760046916476
58
+ name: Recall
59
  ---
60
 
61
+ # SpanMarker with BAAI/bge-base-en-v1.5 on FewNERD
62
 
63
+ 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 [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) as the underlying encoder.
64
 
65
  ## Model Details
66
 
67
  ### Model Description
68
  - **Model Type:** SpanMarker
69
+ - **Encoder:** [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5)
70
  - **Maximum Sequence Length:** 256 tokens
71
  - **Maximum Entity Length:** 8 words
72
+ - **Training Dataset:** [FewNERD](https://huggingface.co/datasets/DFKI-SLT/few-nerd)
73
+ - **Language:** en
74
+ - **License:** cc-by-nc-sa-4.0
75
 
76
  ### Model Sources
77
 
78
  - **Repository:** [SpanMarker on GitHub](https://github.com/tomaarsen/SpanMarkerNER)
79
  - **Thesis:** [SpanMarker For Named Entity Recognition](https://raw.githubusercontent.com/tomaarsen/SpanMarkerNER/main/thesis.pdf)
80
 
81
+ ### Model Labels
82
+ | Label | Examples |
83
+ |:-----------------------------------------|:---------------------------------------------------------------------------------------------------------|
84
+ | art-broadcastprogram | "Corazones", "The Gale Storm Show : Oh , Susanna", "Street Cents" |
85
+ | art-film | "L'Atlantide", "Bosch", "Shawshank Redemption" |
86
+ | art-music | "Atkinson , Danko and Ford ( with Brockie and Hilton )", "Hollywood Studio Symphony", "Champion Lover" |
87
+ | art-other | "Venus de Milo", "The Today Show", "Aphrodite of Milos" |
88
+ | art-painting | "Cofiwch Dryweryn", "Touit", "Production/Reproduction" |
89
+ | art-writtenart | "Time", "The Seven Year Itch", "Imelda de ' Lambertazzi" |
90
+ | building-airport | "Newark Liberty International Airport", "Luton Airport", "Sheremetyevo International Airport" |
91
+ | building-hospital | "Hokkaido University Hospital", "Memorial Sloan-Kettering Cancer Center", "Yeungnam University Hospital" |
92
+ | building-hotel | "Radisson Blu Sea Plaza Hotel", "Flamingo Hotel", "The Standard Hotel" |
93
+ | building-library | "Bayerische Staatsbibliothek", "British Library", "Berlin State Library" |
94
+ | building-other | "Communiplex", "Alpha Recording Studios", "Henry Ford Museum" |
95
+ | building-restaurant | "Carnegie Deli", "Fatburger", "Trumbull" |
96
+ | building-sportsfacility | "Boston Garden", "Glenn Warner Soccer Facility", "Sports Center" |
97
+ | building-theater | "Pittsburgh Civic Light Opera", "National Paris Opera", "Sanders Theatre" |
98
+ | event-attack/battle/war/militaryconflict | "Jurist", "Vietnam War", "Easter Offensive" |
99
+ | event-disaster | "1693 Sicily earthquake", "the 1912 North Mount Lyell Disaster", "1990s North Korean famine" |
100
+ | event-election | "Elections to the European Parliament", "March 1898 elections", "1982 Mitcham and Morden by-election" |
101
+ | event-other | "Eastwood Scoring Stage", "Masaryk Democratic Movement", "Union for a Popular Movement" |
102
+ | event-protest | "French Revolution", "Iranian Constitutional Revolution", "Russian Revolution" |
103
+ | event-sportsevent | "Stanley Cup", "National Champions", "World Cup" |
104
+ | location-GPE | "Croatian", "the Republic of Croatia", "Mediterranean Basin" |
105
+ | location-bodiesofwater | "Norfolk coast", "Atatürk Dam Lake", "Arthur Kill" |
106
+ | location-island | "Staten Island", "Laccadives", "new Samsat district" |
107
+ | location-mountain | "Ruweisat Ridge", "Salamander Glacier", "Miteirya Ridge" |
108
+ | location-other | "Victoria line", "Northern City Line", "Cartuther" |
109
+ | location-park | "Shenandoah National Park", "Gramercy Park", "Painted Desert Community Complex Historic District" |
110
+ | location-road/railway/highway/transit | "NJT", "Friern Barnet Road", "Newark-Elizabeth Rail Link" |
111
+ | organization-company | "Texas Chicken", "Dixy Chicken", "Church 's Chicken" |
112
+ | organization-education | "Barnard College", "MIT", "Belfast Royal Academy and the Ulster College of Physical Education" |
113
+ | organization-government/governmentagency | "Diet", "Congregazione dei Nobili", "Supreme Court" |
114
+ | organization-media/newspaper | "Clash", "TimeOut Melbourne", "Al Jazeera" |
115
+ | organization-other | "Defence Sector C", "IAEA", "4th Army" |
116
+ | organization-politicalparty | "Al Wafa ' Islamic", "Kenseitō", "Shimpotō" |
117
+ | organization-religion | "Christian", "Jewish", "UPCUSA" |
118
+ | organization-showorganization | "Lizzy", "Mr. Mister", "Bochumer Symphoniker" |
119
+ | organization-sportsleague | "First Division", "China League One", "NHL" |
120
+ | organization-sportsteam | "Arsenal", "Tottenham", "Luc Alphand Aventures" |
121
+ | other-astronomything | "Algol", "`` Caput Larvae ''", "Zodiac" |
122
+ | other-award | "Grand Commander of the Order of the Niger", "Order of the Republic of Guinea and Nigeria", "GCON" |
123
+ | other-biologything | "BAR", "N-terminal lipid", "Amphiphysin" |
124
+ | other-chemicalthing | "uranium", "carbon dioxide", "sulfur" |
125
+ | other-currency | "lac crore", "$", "Travancore Rupee" |
126
+ | other-disease | "French Dysentery Epidemic of 1779", "hypothyroidism", "bladder cancer" |
127
+ | other-educationaldegree | "Bachelor", "Master", "BSc ( Hons ) in physics" |
128
+ | other-god | "El", "Fujin", "Raijin" |
129
+ | other-language | "English", "Latin", "Breton-speaking" |
130
+ | other-law | "Thirty Years ' Peace", "Leahy–Smith America Invents Act ( AIA", "United States Freedom Support Act" |
131
+ | other-livingthing | "monkeys", "insects", "patchouli" |
132
+ | other-medical | "amitriptyline", "Pediatrics", "pediatrician" |
133
+ | person-actor | "Ellaline Terriss", "Edmund Payne", "Tchéky Karyo" |
134
+ | person-artist/author | "Hicks", "George Axelrod", "Gaetano Donizett" |
135
+ | person-athlete | "Jaguar", "Tozawa", "Neville" |
136
+ | person-director | "Bob Swaim", "Richard Quine", "Frank Darabont" |
137
+ | person-other | "Richard Benson", "Holden", "Campbell" |
138
+ | person-politician | "Emeric", "William", "Rivière" |
139
+ | person-scholar | "Stalmine", "Wurdack", "Stedman" |
140
+ | person-soldier | "Krukenberg", "Joachim Ziegler", "Helmuth Weidling" |
141
+ | product-airplane | "EC135T2 CPDS", "Spey-equipped FGR.2s", "Luton" |
142
+ | product-car | "100EX", "Phantom", "Corvettes - GT1 C6R" |
143
+ | product-food | "red grape", "V. labrusca", "yakiniku" |
144
+ | product-game | "Splinter Cell", "Hardcore RPG", "Airforce Delta" |
145
+ | product-other | "X11", "PDP-1", "Fairbottom Bobs" |
146
+ | product-ship | "HMS `` Chinkara ''", "Essex", "Congress" |
147
+ | product-software | "Wikipedia", "AmiPDF", "Apdf" |
148
+ | product-train | "55022", "Royal Scots Grey", "High Speed Trains" |
149
+ | product-weapon | "ZU-23-2M Wróbel", "ZU-23-2MR Wróbel II", "AR-15 's" |
150
+
151
  ## Uses
152
 
153
  ### Direct Use for Inference
 
156
  from span_marker import SpanMarkerModel
157
 
158
  # Download from the 🤗 Hub
159
+ model = SpanMarkerModel.from_pretrained("guishe/span-marker-bge-base-en-v1.5-fewnerd-fine-super")
160
  # Run inference
161
+ 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.")
162
  ```
163
 
164
  ### Downstream Use
 
170
  from span_marker import SpanMarkerModel, Trainer
171
 
172
  # Download from the 🤗 Hub
173
+ model = SpanMarkerModel.from_pretrained("guishe/span-marker-bge-base-en-v1.5-fewnerd-fine-super")
174
 
175
  # Specify a Dataset with "tokens" and "ner_tag" columns
176
  dataset = load_dataset("conll2003") # For example CoNLL2003
 
182
  eval_dataset=dataset["validation"],
183
  )
184
  trainer.train()
185
+ trainer.save_model("guishe/span-marker-bge-base-en-v1.5-fewnerd-fine-super-finetuned")
186
  ```
187
  </details>
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: 32
200
+ - eval_batch_size: 32
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.5964 | 3000 | 0.0324 | 0.6263 | 0.5826 | 0.6037 | 0.8981 |
211
+ | 1.1928 | 6000 | 0.0278 | 0.6620 | 0.6499 | 0.6559 | 0.9132 |
212
+ | 1.7893 | 9000 | 0.0264 | 0.6719 | 0.6614 | 0.6666 | 0.9159 |
213
+ | 2.3857 | 12000 | 0.0260 | 0.6724 | 0.6703 | 0.6714 | 0.9174 |
214
+ | 2.9821 | 15000 | 0.0258 | 0.6740 | 0.6713 | 0.6726 | 0.9177 |
215
+
216
  ### Framework Versions
217
  - Python: 3.10.8
218
  - SpanMarker: 1.4.0
 
232
  url = {https://github.com/tomaarsen/SpanMarkerNER}
233
  }
234
  ```