guishe commited on
Commit
2f0b4ac
1 Parent(s): 4313d72

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +259 -0
README.md ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: cc-by-sa-4.0
4
+ library_name: tranformers
5
+ tags:
6
+ - token-classification
7
+ - ner
8
+ - named-entity-recognition
9
+ datasets:
10
+ - DFKI-SLT/few-nerd
11
+ metrics:
12
+ - precision
13
+ - recall
14
+ - f1
15
+ widget:
16
+ - text: Concern and scepticism surround Niger uranium mining waste storage plans. Towering mounds dot the desert landscape in northern Niger's Arlit region, but they are heaps of partially radioactive waste left from four decades of operations at one of the world's biggest uranium mines. An ambitious 10-year scheme costing $160 million is underway to secure the waste and avoid risks to health and the environment, but many local people are worried or sceptical. France's nuclear giant Areva, now called Orano, worked the area under a subsidiary, the Akouta Mining Company (Cominak). Cominak closed the site in 2021 after extracting 75,000 tonnes of uranium, much of which went to fuelling the scores of nuclear reactors that provide the backbone of France's electricity supply. Cominak's director general Mahaman Sani Abdoulaye showcased the rehabilitation project to the first French journalists to visit the site since 2010, when seven Areva employees were kidnapped by jihadists.
17
+ - text: SE Michigan counties allege insulin gouging; Localities file lawsuit against pharmaceutical makers. Four metro Detroit counties filed federal lawsuits Wednesday against some of the nation's biggest pharmaceutical manufacturers and pharmacy benefit managers alleging illegal price fixing for insulin products. Macomb, Monroe, Wayne and Washtenaw counties filed the lawsuits in U.S. District Court in New Jersey against more than a dozen companies, including Lilly, Sanofi Aventis, Novo Nordisk, Express Scripts, Optum Rx and CVS Caremark, per their attorneys. "These are the first such lawsuits that have been filed in the state of Michigan and probably more to come," said attorney Melvin Butch Hollowell of the Miller Law Firm. He described the allegations during a news conference, saying that nationally "the pharmacies and manufacturers get together. They control about 90% of the market each, of the insulin market. They talk to each other secretly. And they jack up the prices through anticompetitive means. And what we've seen is over the past 20 years, when we talk about jacking up the prices, they jack them up 1,500% in the last 20 years. 1,500%."
18
+ - text: Foreign governments may be spying on your smartphone notifications, senator says. Washington (CNN) — Foreign governments have reportedly attempted to spy on iPhone and Android users through the mobile app notifications they receive on their smartphones - and the US government has forced Apple and Google to keep quiet about it, according to a top US senator. Through legal demands sent to the tech giants, governments have allegedly tried to force Apple and Google to turn over sensitive information that could include the contents of a notification - such as previews of a text message displayed on a lock screen, or an update about app activity, Oregon Democratic Sen. Ron Wyden said in a new report. Wyden's report reflects the latest example of long-running tensions between tech companies and governments over law enforcement demands, which have stretched on for more than a decade. Governments around the world have particularly battled with tech companies over encryption, which provides critical protections to users and businesses while in some cases preventing law enforcement from pursuing investigations into messages sent over the internet.
19
+ - text: Tech giants ‘could severely disable UK spooks from stopping online harms’. Silicon Valley tech giants’ actions could “severely disable” UK spooks from preventing harm caused by online paedophiles and fraudsters, Suella Braverman has suggested. The Conservative former home secretary named Facebook owner Meta , and Apple, and their use of technologies such as end-to-end encryption as a threat to attempts to tackle digital crimes. She claimed the choice to back these technologies without “safeguards” could “enable and indeed facilitate some of the worst atrocities that our brave men and women in law enforcement agencies deal with every day”, as MPs began considering changes to investigatory powers laws. The Investigatory Powers (Amendment) Bill includes measures to make it easier for agencies to examine and retain bulk datasets, such as publicly available online telephone records, and would allow intelligence agencies to use internet connection records to aid detection of their targets. We know that the terrorists, the serious organised criminals, and fraudsters, and the online paedophiles, all take advantage of the dark web and encrypted spaces
20
+ - text: Camargo Corrêa asks Toffoli to suspend the fine agreed with Lava Jato. The Camargo Corrêa group has asked Justice Dias Toffoli to suspend the R$1.4 billion fine it agreed to pay in its leniency agreement under Operation Car Wash. The company asked for an extension of the minister's decisions that benefited J&F and Odebrecht. Like the other companies, it claimed that it suffered undue pressure from members of the Federal Public Prosecutor's Office (MPF) to close the deal. Much of the request is based on messages exchanged between prosecutors from the Curitiba task force and former judge Sergio Moro - Camargo Corrêa requested full access to the material, seized in Operation Spoofing, which arrested the hackers who broke into cell phones. The dialogues, according to the group's defense, indicate that the executives did not freely agree to the deal, since they were the targets of lawsuits and pre-trial detentions.
21
+ pipeline_tag: token-classification
22
+ base_model: numind/NuNER-v1.0
23
+ model-index:
24
+ - name: numind/NuNER-v1.0 fine-tuned on FewNERD-fine-supervised
25
+ results:
26
+ - task:
27
+ type: token-classification
28
+ name: Named Entity Recognition
29
+ dataset:
30
+ name: FewNERD
31
+ type: DFKI-SLT/few-nerd
32
+ split: eval
33
+ metrics:
34
+ - type: f1
35
+ value: 0.6938826894412441
36
+ name: F1
37
+ - type: precision
38
+ value: 0.6775065885222044
39
+ name: Precision
40
+ - type: recall
41
+ value: 0.7110700573834785
42
+ name: Recall
43
+ ---
44
+
45
+ # numind/NuNER-v1.0 fine-tuned on FewNERD-fine-supervised
46
+
47
+ This is a [NuNER](https://arxiv.org/abs/2402.15343) model fine-tuned on the [FewNERD](https://huggingface.co/datasets/DFKI-SLT/few-nerd) dataset that can be used for Named Entity Recognition. NuNER model uses [RoBERTa-base](https://huggingface.co/FacebookAI/roberta-base) as the backbone encoder and it was trained on the [NuNER dataset](https://huggingface.co/datasets/numind/NuNER), which is a large and diverse dataset synthetically labeled by gpt-3.5-turbo-0301 of 1M sentences. This further pre-training phase allowed the generation of high quality token embeddings, a good starting point for fine-tuning on more specialized datasets.
48
+
49
+ ## Model Details
50
+
51
+ The model was fine-tuned as a regular BERT-based model for NER task using HuggingFace Trainer class.
52
+
53
+ ### Model Labels
54
+
55
+ | Label | Examples |
56
+ |:-----------------------------------------|:---------------------------------------------------------------------------------------------------------|
57
+ | art-broadcastprogram | "Corazones", "The Gale Storm Show : Oh , Susanna", "Street Cents" |
58
+ | art-film | "Shawshank Redemption", "L'Atlantide", "Bosch" |
59
+ | art-music | "Hollywood Studio Symphony", "Atkinson , Danko and Ford ( with Brockie and Hilton )", "Champion Lover" |
60
+ | art-other | "The Today Show", "Venus de Milo", "Aphrodite of Milos" |
61
+ | art-painting | "Production/Reproduction", "Touit", "Cofiwch Dryweryn" |
62
+ | art-writtenart | "The Seven Year Itch", "Imelda de ' Lambertazzi", "Time" |
63
+ | building-airport | "Sheremetyevo International Airport", "Newark Liberty International Airport", "Luton Airport" |
64
+ | building-hospital | "Yeungnam University Hospital", "Hokkaido University Hospital", "Memorial Sloan-Kettering Cancer Center" |
65
+ | building-hotel | "The Standard Hotel", "Flamingo Hotel", "Radisson Blu Sea Plaza Hotel" |
66
+ | building-library | "British Library", "Bayerische Staatsbibliothek", "Berlin State Library" |
67
+ | building-other | "Henry Ford Museum", "Alpha Recording Studios", "Communiplex" |
68
+ | building-restaurant | "Carnegie Deli", "Fatburger", "Trumbull" |
69
+ | building-sportsfacility | "Boston Garden", "Sports Center", "Glenn Warner Soccer Facility" |
70
+ | building-theater | "Sanders Theatre", "National Paris Opera", "Pittsburgh Civic Light Opera" |
71
+ | event-attack/battle/war/militaryconflict | "Easter Offensive", "Jurist", "Vietnam War" |
72
+ | event-disaster | "the 1912 North Mount Lyell Disaster", "1990s North Korean famine", "1693 Sicily earthquake" |
73
+ | event-election | "Elections to the European Parliament", "March 1898 elections", "1982 Mitcham and Morden by-election" |
74
+ | event-other | "Union for a Popular Movement", "Masaryk Democratic Movement", "Eastwood Scoring Stage" |
75
+ | event-protest | "Iranian Constitutional Revolution", "French Revolution", "Russian Revolution" |
76
+ | event-sportsevent | "World Cup", "National Champions", "Stanley Cup" |
77
+ | location-GPE | "Croatian", "Mediterranean Basin", "the Republic of Croatia" |
78
+ | location-bodiesofwater | "Arthur Kill", "Atatürk Dam Lake", "Norfolk coast" |
79
+ | location-island | "new Samsat district", "Laccadives", "Staten Island" |
80
+ | location-mountain | "Salamander Glacier", "Miteirya Ridge", "Ruweisat Ridge" |
81
+ | location-other | "Victoria line", "Northern City Line", "Cartuther" |
82
+ | location-park | "Painted Desert Community Complex Historic District", "Gramercy Park", "Shenandoah National Park" |
83
+ | location-road/railway/highway/transit | "NJT", "Newark-Elizabeth Rail Link", "Friern Barnet Road" |
84
+ | organization-company | "Texas Chicken", "Dixy Chicken", "Church 's Chicken" |
85
+ | organization-education | "MIT", "Belfast Royal Academy and the Ulster College of Physical Education", "Barnard College" |
86
+ | organization-government/governmentagency | "Congregazione dei Nobili", "Diet", "Supreme Court" |
87
+ | organization-media/newspaper | "Clash", "Al Jazeera", "TimeOut Melbourne" |
88
+ | organization-other | "Defence Sector C", "IAEA", "4th Army" |
89
+ | organization-politicalparty | "Al Wafa ' Islamic", "Shimpotō", "Kenseitō" |
90
+ | organization-religion | "UPCUSA", "Christian", "Jewish" |
91
+ | organization-showorganization | "Lizzy", "Bochumer Symphoniker", "Mr. Mister" |
92
+ | organization-sportsleague | "China League One", "NHL", "First Division" |
93
+ | organization-sportsteam | "Arsenal", "Luc Alphand Aventures", "Tottenham" |
94
+ | other-astronomything | "Algol", "`` Caput Larvae ''", "Zodiac" |
95
+ | other-award | "Order of the Republic of Guinea and Nigeria", "Grand Commander of the Order of the Niger", "GCON" |
96
+ | other-biologything | "N-terminal lipid", "Amphiphysin", "BAR" |
97
+ | other-chemicalthing | "uranium", "carbon dioxide", "sulfur" |
98
+ | other-currency | "$", "lac crore", "Travancore Rupee" |
99
+ | other-disease | "bladder cancer", "French Dysentery Epidemic of 1779", "hypothyroidism" |
100
+ | other-educationaldegree | "BSc ( Hons ) in physics", "Bachelor", "Master" |
101
+ | other-god | "Raijin", "Fujin", "El" |
102
+ | other-language | "Breton-speaking", "Latin", "English" |
103
+ | other-law | "Leahy–Smith America Invents Act ( AIA", "United States Freedom Support Act", "Thirty Years ' Peace" |
104
+ | other-livingthing | "monkeys", "patchouli", "insects" |
105
+ | other-medical | "amitriptyline", "Pediatrics", "pediatrician" |
106
+ | person-actor | "Tchéky Karyo", "Edmund Payne", "Ellaline Terriss" |
107
+ | person-artist/author | "Hicks", "Gaetano Donizett", "George Axelrod" |
108
+ | person-athlete | "Tozawa", "Neville", "Jaguar" |
109
+ | person-director | "Richard Quine", "Bob Swaim", "Frank Darabont" |
110
+ | person-other | "Campbell", "Holden", "Richard Benson" |
111
+ | person-politician | "William", "Rivière", "Emeric" |
112
+ | person-scholar | "Wurdack", "Stalmine", "Stedman" |
113
+ | person-soldier | "Joachim Ziegler", "Helmuth Weidling", "Krukenberg" |
114
+ | product-airplane | "Spey-equipped FGR.2s", "EC135T2 CPDS", "Luton" |
115
+ | product-car | "Phantom", "100EX", "Corvettes - GT1 C6R" |
116
+ | product-food | "red grape", "yakiniku", "V. labrusca" |
117
+ | product-game | "Hardcore RPG", "Splinter Cell", "Airforce Delta" |
118
+ | product-other | "X11", "PDP-1", "Fairbottom Bobs" |
119
+ | product-ship | "Essex", "Congress", "HMS `` Chinkara ''" |
120
+ | product-software | "AmiPDF", "Wikipedia", "Apdf" |
121
+ | product-train | "55022", "Royal Scots Grey", "High Speed Trains" |
122
+ | product-weapon | "AR-15 's", "ZU-23-2MR Wróbel II", "ZU-23-2M Wróbel" |
123
+
124
+ ## Uses
125
+
126
+ ### Direct Use for Inference
127
+
128
+ ```python
129
+ >>> from transformers import pipeline
130
+
131
+ >>> text = """Foreign governments may be spying on your smartphone notifications, senator says. Washington (CNN) — Foreign governments have reportedly attempted to spy on iPhone and Android users through the mobile app notifications they receive on their smartphones - and the US government has forced Apple and Google to keep quiet about it, according to a top US senator. Through legal demands sent to the tech giants, governments have allegedly tried to force Apple and Google to turn over sensitive information that could include the contents of a notification - such as previews of a text message displayed on a lock screen, or an update about app activity, Oregon Democratic Sen. Ron Wyden said in a new report. Wyden's report reflects the latest example of long-running tensions between tech companies and governments over law enforcement demands, which have stretched on for more than a decade. Governments around the world have particularly battled with tech companies over encryption, which provides critical protections to users and businesses while in some cases preventing law enforcement from pursuing investigations into messages sent over the internet."""
132
+
133
+ >>> classifier = pipeline(
134
+ "ner",
135
+ model="guishe/nuner-v1_fewnerd_fine_super",
136
+ grouped_entities=True
137
+ )
138
+ >>> classifier(text)
139
+
140
+ [{'entity_group': 'GPE',
141
+ 'score': 0.9424858,
142
+ 'word': ' Washington',
143
+ 'start': 82,
144
+ 'end': 92},
145
+ {'entity_group': 'media/newspaper',
146
+ 'score': 0.8316084,
147
+ 'word': 'CNN',
148
+ 'start': 94,
149
+ 'end': 97},
150
+ {'entity_group': 'other',
151
+ 'score': 0.80409575,
152
+ 'word': ' iPhone',
153
+ 'start': 157,
154
+ 'end': 163},
155
+ {'entity_group': 'other',
156
+ 'score': 0.73457426,
157
+ 'word': ' Android',
158
+ 'start': 168,
159
+ 'end': 175},
160
+ {'entity_group': 'GPE',
161
+ 'score': 0.7095115,
162
+ 'word': ' US',
163
+ 'start': 263,
164
+ 'end': 265},
165
+ {'entity_group': 'company',
166
+ 'score': 0.9712124,
167
+ 'word': ' Apple',
168
+ 'start': 288,
169
+ 'end': 293},
170
+ {'entity_group': 'company',
171
+ 'score': 0.9634242,
172
+ 'word': ' Google',
173
+ 'start': 298,
174
+ 'end': 304},
175
+ {'entity_group': 'GPE',
176
+ 'score': 0.9451448,
177
+ 'word': ' US',
178
+ 'start': 348,
179
+ 'end': 350},
180
+ {'entity_group': 'company',
181
+ 'score': 0.96848464,
182
+ 'word': ' Apple',
183
+ 'start': 449,
184
+ 'end': 454},
185
+ {'entity_group': 'company',
186
+ 'score': 0.964712,
187
+ 'word': ' Google',
188
+ 'start': 459,
189
+ 'end': 465},
190
+ {'entity_group': 'GPE',
191
+ 'score': 0.77644503,
192
+ 'word': ' Oregon',
193
+ 'start': 649,
194
+ 'end': 655},
195
+ {'entity_group': 'politicalparty',
196
+ 'score': 0.70191574,
197
+ 'word': ' Democratic',
198
+ 'start': 656,
199
+ 'end': 666},
200
+ {'entity_group': 'politician',
201
+ 'score': 0.902996,
202
+ 'word': ' Ron Wyden',
203
+ 'start': 672,
204
+ 'end': 681},
205
+ {'entity_group': 'politician',
206
+ 'score': 0.82849467,
207
+ 'word': ' Wyden',
208
+ 'start': 704,
209
+ 'end': 709}]
210
+ ```
211
+
212
+
213
+ ## Training Details
214
+
215
+ ### Training Set Metrics
216
+ | Training set | Min | Median | Max |
217
+ |:----------------------|:----|:--------|:----|
218
+ | Sentence length | 1 | 24.4945 | 267 |
219
+ | Entities per sentence | 0 | 2.5832 | 88 |
220
+
221
+ ### Training Hyperparameters
222
+ - learning_rate: 3e-5
223
+ - train_batch_size: 32
224
+ - eval_batch_size: 16
225
+ - seed: 42
226
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
227
+ - lr_scheduler_type: linear
228
+ - lr_scheduler_warmup_ratio: 0.1
229
+ - weight_decay: 0.01
230
+ - num_epochs: 3
231
+
232
+
233
+ ### Training Results
234
+ | Epoch | Validation Loss | Validation Precision | Validation Recall | Validation F1 | Validation Accuracy |
235
+ |:------:|:---------------:|:--------------------:|:-----------------:|:-------------:|:-------------------:|
236
+ | 1 | 0.2447 | 0.6678 | 0.6924 | 0.6799 | 0.9274 |
237
+ | 2 | 0.2345 | 0.6779 | 0.7113 | 0.6942 | 0.9303 |
238
+ | 3 | 0.2321 | 0.6821 | 0.7144 | 0.6979 | 0.9312 |
239
+
240
+ ### Framework Versions
241
+ - Python: 3.10.8
242
+ - Transformers: 4.36.0
243
+ - PyTorch: 2.0.0+cu117
244
+ - Datasets: 2.18.0
245
+ - Tokenizers: 0.15.2
246
+
247
+ ## Citation
248
+
249
+ ### BibTeX
250
+ ```
251
+ @misc{bogdanov2024nuner,
252
+ title={NuNER: Entity Recognition Encoder Pre-training via LLM-Annotated Data},
253
+ author={Sergei Bogdanov and Alexandre Constantin and Timothée Bernard and Benoit Crabbé and Etienne Bernard},
254
+ year={2024},
255
+ eprint={2402.15343},
256
+ archivePrefix={arXiv},
257
+ primaryClass={cs.CL}
258
+ }
259
+ ```