Edit model card

numind/NuNER-v1.0 fine-tuned on FewNERD-fine-supervised

This is a NuNER model fine-tuned on the FewNERD dataset that can be used for Named Entity Recognition. NuNER model uses RoBERTa-base as the backbone encoder and it was trained on the NuNER dataset, 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.

Model Details

The model was fine-tuned as a regular BERT-based model for NER task using HuggingFace Trainer class.

Model Labels

Label Examples
art_broadcastprogram "Corazones", "The Gale Storm Show : Oh , Susanna", "Street Cents"
art_film "Shawshank Redemption", "L'Atlantide", "Bosch"
art_music "Hollywood Studio Symphony", "Atkinson , Danko and Ford ( with Brockie and Hilton )", "Champion Lover"
art_other "The Today Show", "Venus de Milo", "Aphrodite of Milos"
art_painting "Production/Reproduction", "Touit", "Cofiwch Dryweryn"
art_writtenart "The Seven Year Itch", "Imelda de ' Lambertazzi", "Time"
building_airport "Sheremetyevo International Airport", "Newark Liberty International Airport", "Luton Airport"
building_hospital "Yeungnam University Hospital", "Hokkaido University Hospital", "Memorial Sloan-Kettering Cancer Center"
building_hotel "The Standard Hotel", "Flamingo Hotel", "Radisson Blu Sea Plaza Hotel"
building_library "British Library", "Bayerische Staatsbibliothek", "Berlin State Library"
building_other "Henry Ford Museum", "Alpha Recording Studios", "Communiplex"
building_restaurant "Carnegie Deli", "Fatburger", "Trumbull"
building_sportsfacility "Boston Garden", "Sports Center", "Glenn Warner Soccer Facility"
building_theater "Sanders Theatre", "National Paris Opera", "Pittsburgh Civic Light Opera"
event_attack/battle/war/militaryconflict "Easter Offensive", "Jurist", "Vietnam War"
event_disaster "the 1912 North Mount Lyell Disaster", "1990s North Korean famine", "1693 Sicily earthquake"
event_election "Elections to the European Parliament", "March 1898 elections", "1982 Mitcham and Morden by-election"
event_other "Union for a Popular Movement", "Masaryk Democratic Movement", "Eastwood Scoring Stage"
event_protest "Iranian Constitutional Revolution", "French Revolution", "Russian Revolution"
event_sportsevent "World Cup", "National Champions", "Stanley Cup"
location_GPE "Croatian", "Mediterranean Basin", "the Republic of Croatia"
location_bodiesofwater "Arthur Kill", "Atatürk Dam Lake", "Norfolk coast"
location_island "new Samsat district", "Laccadives", "Staten Island"
location_mountain "Salamander Glacier", "Miteirya Ridge", "Ruweisat Ridge"
location_other "Victoria line", "Northern City Line", "Cartuther"
location_park "Painted Desert Community Complex Historic District", "Gramercy Park", "Shenandoah National Park"
location_road/railway/highway/transit "NJT", "Newark-Elizabeth Rail Link", "Friern Barnet Road"
organization_company "Texas Chicken", "Dixy Chicken", "Church 's Chicken"
organization_education "MIT", "Belfast Royal Academy and the Ulster College of Physical Education", "Barnard College"
organization_government/governmentagency "Congregazione dei Nobili", "Diet", "Supreme Court"
organization_media/newspaper "Clash", "Al Jazeera", "TimeOut Melbourne"
organization_other "Defence Sector C", "IAEA", "4th Army"
organization_politicalparty "Al Wafa ' Islamic", "Shimpotō", "Kenseitō"
organization_religion "UPCUSA", "Christian", "Jewish"
organization_showorganization "Lizzy", "Bochumer Symphoniker", "Mr. Mister"
organization_sportsleague "China League One", "NHL", "First Division"
organization_sportsteam "Arsenal", "Luc Alphand Aventures", "Tottenham"
other_astronomything "Algol", "`` Caput Larvae ''", "Zodiac"
other_award "Order of the Republic of Guinea and Nigeria", "Grand Commander of the Order of the Niger", "GCON"
other_biologything "N-terminal lipid", "Amphiphysin", "BAR"
other_chemicalthing "uranium", "carbon dioxide", "sulfur"
other_currency "$", "lac crore", "Travancore Rupee"
other_disease "bladder cancer", "French Dysentery Epidemic of 1779", "hypothyroidism"
other_educationaldegree "BSc ( Hons ) in physics", "Bachelor", "Master"
other_god "Raijin", "Fujin", "El"
other_language "Breton-speaking", "Latin", "English"
other_law "Leahy–Smith America Invents Act ( AIA", "United States Freedom Support Act", "Thirty Years ' Peace"
other_livingthing "monkeys", "patchouli", "insects"
other_medical "amitriptyline", "Pediatrics", "pediatrician"
person_actor "Tchéky Karyo", "Edmund Payne", "Ellaline Terriss"
person_artist/author "Hicks", "Gaetano Donizett", "George Axelrod"
person_athlete "Tozawa", "Neville", "Jaguar"
person_director "Richard Quine", "Bob Swaim", "Frank Darabont"
person_other "Campbell", "Holden", "Richard Benson"
person_politician "William", "Rivière", "Emeric"
person_scholar "Wurdack", "Stalmine", "Stedman"
person_soldier "Joachim Ziegler", "Helmuth Weidling", "Krukenberg"
product_airplane "Spey-equipped FGR.2s", "EC135T2 CPDS", "Luton"
product_car "Phantom", "100EX", "Corvettes - GT1 C6R"
product_food "red grape", "yakiniku", "V. labrusca"
product_game "Hardcore RPG", "Splinter Cell", "Airforce Delta"
product_other "X11", "PDP-1", "Fairbottom Bobs"
product_ship "Essex", "Congress", "HMS `` Chinkara ''"
product_software "AmiPDF", "Wikipedia", "Apdf"
product_train "55022", "Royal Scots Grey", "High Speed Trains"
product_weapon "AR-15 's", "ZU-23-2MR Wróbel II", "ZU-23-2M Wróbel"

Uses

Direct Use for Inference

>>> from transformers import pipeline

>>> 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."""

>>> classifier = pipeline(
    "ner",
    model="guishe/nuner-v1_fewnerd_fine_super",
    aggregation_strategy="simple",
)
>>> classifier(text)

[{'entity_group': 'location_GPE',
  'score': 0.9424858,
  'word': ' Washington',
  'start': 82,
  'end': 92},
 {'entity_group': 'organization_media/newspaper',
  'score': 0.83160853,
  'word': 'CNN',
  'start': 94,
  'end': 97},
 {'entity_group': 'product_other',
  'score': 0.80409557,
  'word': ' iPhone',
  'start': 157,
  'end': 163},
 {'entity_group': 'product_other',
  'score': 0.7345743,
  'word': ' Android',
  'start': 168,
  'end': 175},
 {'entity_group': 'location_GPE',
  'score': 0.70951134,
  'word': ' US',
  'start': 263,
  'end': 265},
 {'entity_group': 'organization_company',
  'score': 0.9712124,
  'word': ' Apple',
  'start': 288,
  'end': 293},
 {'entity_group': 'organization_company',
  'score': 0.9634242,
  'word': ' Google',
  'start': 298,
  'end': 304},
 {'entity_group': 'location_GPE',
  'score': 0.9451448,
  'word': ' US',
  'start': 348,
  'end': 350},
 {'entity_group': 'organization_company',
  'score': 0.96848464,
  'word': ' Apple',
  'start': 449,
  'end': 454},
 {'entity_group': 'organization_company',
  'score': 0.964712,
  'word': ' Google',
  'start': 459,
  'end': 465},
 {'entity_group': 'location_GPE',
  'score': 0.7764447,
  'word': ' Oregon',
  'start': 649,
  'end': 655},
 {'entity_group': 'organization_politicalparty',
  'score': 0.7019166,
  'word': ' Democratic',
  'start': 656,
  'end': 666},
 {'entity_group': 'person_politician',
  'score': 0.902996,
  'word': ' Ron Wyden',
  'start': 672,
  'end': 681},
 {'entity_group': 'person_politician',
  'score': 0.82849455,
  'word': ' Wyden',
  'start': 704,
  'end': 709}]

Training Details

Training Set Metrics

Training set Min Median Max
Sentence length 1 24.4945 267
Entities per sentence 0 2.5832 88

Training Hyperparameters

  • learning_rate: 3e-5
  • train_batch_size: 32
  • eval_batch_size: 16
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • lr_scheduler_warmup_ratio: 0.1
  • weight_decay: 0.01
  • num_epochs: 3

Training Results

Epoch Validation Loss Validation Precision Validation Recall Validation F1 Validation Accuracy
1 0.2447 0.6678 0.6924 0.6799 0.9274
2 0.2345 0.6779 0.7113 0.6942 0.9303
3 0.2321 0.6821 0.7144 0.6979 0.9312

Framework Versions

  • Python: 3.10.8
  • Transformers: 4.36.0
  • PyTorch: 2.0.0+cu117
  • Datasets: 2.18.0
  • Tokenizers: 0.15.2

Citation

BibTeX

@misc{bogdanov2024nuner,
      title={NuNER: Entity Recognition Encoder Pre-training via LLM-Annotated Data}, 
      author={Sergei Bogdanov and Alexandre Constantin and Timothée Bernard and Benoit Crabbé and Etienne Bernard},
      year={2024},
      eprint={2402.15343},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
Downloads last month
14
Safetensors
Model size
124M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for guishe/nuner-v1_fewnerd_fine_super

Base model

numind/NuNER-v1.0
Finetuned
(4)
this model

Dataset used to train guishe/nuner-v1_fewnerd_fine_super

Collection including guishe/nuner-v1_fewnerd_fine_super

Evaluation results