Views
No views yet
| Class | Description | Examples |
|---|---|---|
| PER (person) | People | Ray Charles, Jessica Alba, Leonardo DiCaprio, Roger Federer, Anna Massey. |
| ORG (organization) | Associations, companies, agencies, institutions, nationalities and religious or political groups | University of Edinburgh, San Francisco Giants, Google, Democratic Party. |
| LOC (location) | Physical locations (e.g. mountains, bodies of water), geopolitical entities (e.g. cities, states), and facilities (e.g. bridges, buildings, airports). | Rome, Lake Paiku, Chrysler Building, Mount Rushmore, Mississippi River. |
| ANIM (animal) | Breeds of dogs, cats and other animals, including their scientific names. | Maine Coon, African Wild Dog, Great White Shark, New Zealand Bellbird. |
| BIO (biological) | Genus of fungus, bacteria and protoctists, families of viruses, and other biological entities. | Herpes Simplex Virus, Escherichia Coli, Salmonella, Bacillus Anthracis. |
| CEL (celestial) | Planets, stars, asteroids, comets, nebulae, galaxies and other astronomical objects. | Sun, Neptune, Asteroid 187 Lamberta, Proxima Centauri, V838 Monocerotis. |
| DIS (disease) | Physical, mental, infectious, non-infectious, deficiency, inherited, degenerative, social and self-inflicted diseases. | Alzheimer’s Disease, Cystic Fibrosis, Dilated Cardiomyopathy, Arthritis. |
| EVE (event) | Sport events, battles, wars and other events. | American Civil War, 2003 Wimbledon Championships, Cannes Film Festival. |
| FOOD (food) | Foods and drinks. | Carbonara, Sangiovese, Cheddar Beer Fondue, Pizza Margherita. |
| INST (instrument) | Technological instruments, mechanical instruments, musical instruments, and other tools. | Spitzer Space Telescope, Commodore 64, Skype, Apple Watch, Fender Stratocaster. |
| MEDIA (media) | Titles of films, books, magazines, songs and albums, fictional characters and languages. | Forbes, American Psycho, Kiss Me Once, Twin Peaks, Disney Adventures. |
| PLANT (plant) | Types of trees, flowers, and other plants, including their scientific names. | Salix, Quercus Petraea, Douglas Fir, Forsythia, Artemisia Maritima. |
| MYTH (mythological) | Mythological and religious entities. | Apollo, Persephone, Aphrodite, Saint Peter, Pope Gregory I, Hercules. |
| TIME (time) | Specific and well-defined time intervals, such as eras, historical periods, centuries, years and important days. No months and days of the week. | Renaissance, Middle Ages, Christmas, Great Depression, 17th Century, 2012. |
| VEHI (vehicle) | Cars, motorcycles and other vehicles. | Ferrari Testarossa, Suzuki Jimny, Honda CR-X, Boeing 747, Fairey Fulmar. |
1from transformers import AutoTokenizer, AutoModelForTokenClassification
2from transformers import pipeline
3
4tokenizer = AutoTokenizer.from_pretrained("jayant-yadav/roberta-base-multinerd")
5model = AutoModelForTokenClassification.from_pretrained("jayant-yadav/roberta-base-multinerd")
6
7nlp = pipeline("ner", model=model, tokenizer=tokenizer)
8example = "My name is Wolfgang and I live in Berlin"
9
10ner_results = nlp(example)
11print(ner_results)train_dataset = train_dataset.filter(lambda x: x['lang'] == 'en')seqeval metric was used: metric = load_metric("seqeval").| Entity | Precision | Recall | F1 score | Support |
|---|---|---|---|---|
| ANIM | 0.71 | 0.77 | 0.739 | 1604 |
| BIO | 0.5 | 0.125 | 0.2 | 8 |
| CEL | 0.738 | 0.756 | 0.746 | 41 |
| DIS | 0.737 | 0.772 | 0.754 | 759 |
| EVE | 0.952 | 0.968 | 0.960 | 352 |
| FOOD | 0.679 | 0.545 | 0.605 | 566 |
| INST | 0.75 | 0.75 | 0.75 | 12 |
| LOC | 0.994 | 0.991 | 0.993 | 12024 |
| MEDIA | 0.940 | 0.969 | 0.954 | 458 |
| ORG | 0.977 | 0.981 | 0.979 | 3309 |
| PER | 0.992 | 0.995 | 0.993 | 5265 |
| PLANT | 0.617 | 0.730 | 0.669 | 894 |
| MYTH | 0.647 | 0.687 | 0.666 | 32 |
| TIME | 0.825 | 0.820 | 0.822 | 289 |
| VEHI | 0.812 | 0.812 | 0.812 | 32 |
| Overall | 0.939 | 0.947 | 0.943 |