Commit ·
59a6d3c
1
Parent(s): e494194
added model card info
Browse files
README.md
CHANGED
|
@@ -44,133 +44,155 @@ library_name: transformers
|
|
| 44 |
---
|
| 45 |
# Model Card for Model ID
|
| 46 |
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
-
This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
|
| 50 |
|
| 51 |
## Model Details
|
| 52 |
|
| 53 |
### Model Description
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
- **Developed by:** [More Information Needed]
|
| 60 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 61 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 62 |
-
- **Model type:** [More Information Needed]
|
| 63 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 64 |
-
- **License:** [More Information Needed]
|
| 65 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 66 |
-
|
| 67 |
-
### Model Sources [optional]
|
| 68 |
|
| 69 |
-
<!-- Provide the basic links for the model. -->
|
| 70 |
|
| 71 |
-
- **
|
| 72 |
-
- **Paper [optional]:** [More Information Needed]
|
| 73 |
-
- **Demo [optional]:** [More Information Needed]
|
| 74 |
|
| 75 |
## Uses
|
| 76 |
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
-
### Direct Use
|
| 80 |
-
|
| 81 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 82 |
-
|
| 83 |
-
[More Information Needed]
|
| 84 |
|
| 85 |
## Bias, Risks, and Limitations
|
| 86 |
|
| 87 |
Only trained on English split of MultiNERD dataset. Therefore will not perform well on other languages.
|
| 88 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
### Recommendations
|
| 93 |
|
| 94 |
-
|
| 95 |
|
| 96 |
-
|
|
|
|
|
|
|
| 97 |
|
| 98 |
-
|
|
|
|
| 99 |
|
| 100 |
-
|
|
|
|
| 101 |
|
| 102 |
-
|
|
|
|
|
|
|
| 103 |
|
| 104 |
## Training Details
|
| 105 |
|
| 106 |
### Training Data
|
| 107 |
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
[More Information Needed]
|
| 111 |
|
| 112 |
### Training Procedure
|
| 113 |
|
| 114 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 115 |
|
| 116 |
#### Preprocessing [optional]
|
| 117 |
|
| 118 |
-
|
| 119 |
|
| 120 |
|
| 121 |
#### Training Hyperparameters
|
| 122 |
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
#### Speeds, Sizes, Times [optional]
|
| 126 |
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
-
[More Information Needed]
|
| 130 |
|
| 131 |
## Evaluation
|
| 132 |
|
| 133 |
-
|
| 134 |
|
| 135 |
### Testing Data & Metrics
|
| 136 |
|
| 137 |
-
#### Testing Data
|
| 138 |
|
| 139 |
-
|
| 140 |
|
| 141 |
-
|
| 142 |
|
| 143 |
|
| 144 |
#### Metrics
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
[More Information Needed]
|
| 149 |
|
| 150 |
### Results
|
| 151 |
|
| 152 |
-
|
| 153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
## Technical Specifications [optional]
|
| 156 |
|
| 157 |
### Model Architecture and Objective
|
| 158 |
Follows the same as RoBERTa-BASE
|
| 159 |
-
[More Information Needed]
|
| 160 |
|
| 161 |
### Compute Infrastructure
|
| 162 |
-
2x T4 GPUs
|
| 163 |
-
[More Information Needed]
|
| 164 |
|
| 165 |
#### Hardware
|
| 166 |
|
| 167 |
-
|
|
|
|
| 168 |
|
| 169 |
#### Software
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
## Model Card Contact
|
| 175 |
-
|
| 176 |
-
[More Information Needed]
|
|
|
|
| 44 |
---
|
| 45 |
# Model Card for Model ID
|
| 46 |
|
| 47 |
+
[roBERTa-base](https://huggingface.co/roberta-base) model was fine-tuned on 50% training English only split of MultiNERD dataset and later evaluated on full test split of the same.
|
| 48 |
+
The finetuning script can be fetched from [fintuning.py](https://github.com/jayant-yadav/RISE-NER/blob/main/finetuning.ipynb).
|
| 49 |
+
|
| 50 |
+
Various other model were tested on the same selection of dataset and the best checkpoint was uploaded. The detailed configuration summary can be found in Appendix section of [report](https://github.com/jayant-yadav/RISE-NER/blob/main/MultiNERD_NER___RISE.pdf).
|
| 51 |
|
|
|
|
| 52 |
|
| 53 |
## Model Details
|
| 54 |
|
| 55 |
### Model Description
|
| 56 |
|
| 57 |
+
Head over to [github repo](https://github.com/jayant-yadav/RISE-NER) for all the scripts used to finetune and evalute token-classification model.
|
| 58 |
+
The model is ready to use on [Kaggle](https://www.kaggle.com/datasets/jayantyadav/multinerd-ner-models/) too!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
|
|
|
| 60 |
|
| 61 |
+
- **Developed by:** Jayant Yadav
|
|
|
|
|
|
|
| 62 |
|
| 63 |
## Uses
|
| 64 |
|
| 65 |
+
Token-classification of the following entities are possible:
|
| 66 |
+
|
| 67 |
+
| Class | Description | Examples |
|
| 68 |
+
|-------|-------------|----------|
|
| 69 |
+
PER (person) | People | Ray Charles, Jessica Alba, Leonardo DiCaprio, Roger Federer, Anna Massey. |
|
| 70 |
+
ORG (organization) | Associations, companies, agencies, institutions, nationalities and religious or political groups | University of Edinburgh, San Francisco Giants, Google, Democratic Party. |
|
| 71 |
+
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. |
|
| 72 |
+
ANIM (animal) | Breeds of dogs, cats and other animals, including their scientific names. | Maine Coon, African Wild Dog, Great White Shark, New Zealand Bellbird. |
|
| 73 |
+
BIO (biological) | Genus of fungus, bacteria and protoctists, families of viruses, and other biological entities. | Herpes Simplex Virus, Escherichia Coli, Salmonella, Bacillus Anthracis. |
|
| 74 |
+
CEL (celestial) | Planets, stars, asteroids, comets, nebulae, galaxies and other astronomical objects. | Sun, Neptune, Asteroid 187 Lamberta, Proxima Centauri, V838 Monocerotis. |
|
| 75 |
+
DIS (disease) | Physical, mental, infectious, non-infectious, deficiency, inherited, degenerative, social and self-inflicted diseases. | Alzheimer’s Disease, Cystic Fibrosis, Dilated Cardiomyopathy, Arthritis. |
|
| 76 |
+
EVE (event) | Sport events, battles, wars and other events. | American Civil War, 2003 Wimbledon Championships, Cannes Film Festival. |
|
| 77 |
+
FOOD (food) | Foods and drinks. | Carbonara, Sangiovese, Cheddar Beer Fondue, Pizza Margherita. |
|
| 78 |
+
INST (instrument) | Technological instruments, mechanical instruments, musical instruments, and other tools. | Spitzer Space Telescope, Commodore 64, Skype, Apple Watch, Fender Stratocaster. |
|
| 79 |
+
MEDIA (media) | Titles of films, books, magazines, songs and albums, fictional characters and languages. | Forbes, American Psycho, Kiss Me Once, Twin Peaks, Disney Adventures. |
|
| 80 |
+
PLANT (plant) | Types of trees, flowers, and other plants, including their scientific names. | Salix, Quercus Petraea, Douglas Fir, Forsythia, Artemisia Maritima. |
|
| 81 |
+
MYTH (mythological) | Mythological and religious entities. | Apollo, Persephone, Aphrodite, Saint Peter, Pope Gregory I, Hercules. |
|
| 82 |
+
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. |
|
| 83 |
+
VEHI (vehicle) | Cars, motorcycles and other vehicles. | Ferrari Testarossa, Suzuki Jimny, Honda CR-X, Boeing 747, Fairey Fulmar.
|
| 84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
## Bias, Risks, and Limitations
|
| 87 |
|
| 88 |
Only trained on English split of MultiNERD dataset. Therefore will not perform well on other languages.
|
|
|
|
| 89 |
|
| 90 |
+
## How to Get Started with the Model
|
|
|
|
|
|
|
| 91 |
|
| 92 |
+
Use the code below to get started with the model:
|
| 93 |
|
| 94 |
+
```py
|
| 95 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 96 |
+
from transformers import pipeline
|
| 97 |
|
| 98 |
+
tokenizer = AutoTokenizer.from_pretrained("dslim/bert-base-NER")
|
| 99 |
+
model = AutoModelForTokenClassification.from_pretrained("dslim/bert-base-NER")
|
| 100 |
|
| 101 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 102 |
+
example = "My name is Wolfgang and I live in Berlin"
|
| 103 |
|
| 104 |
+
ner_results = nlp(example)
|
| 105 |
+
print(ner_results)
|
| 106 |
+
```
|
| 107 |
|
| 108 |
## Training Details
|
| 109 |
|
| 110 |
### Training Data
|
| 111 |
|
| 112 |
+
50% of train split of MultiNERD dataset was used to finetune the model.
|
|
|
|
|
|
|
| 113 |
|
| 114 |
### Training Procedure
|
| 115 |
|
|
|
|
| 116 |
|
| 117 |
#### Preprocessing [optional]
|
| 118 |
|
| 119 |
+
English dataset was filterd out : `train_dataset = train_dataset.filter(lambda x: x['lang'] == 'en')`
|
| 120 |
|
| 121 |
|
| 122 |
#### Training Hyperparameters
|
| 123 |
|
| 124 |
+
The following hyperparameters were used during training:
|
|
|
|
|
|
|
| 125 |
|
| 126 |
+
learning_rate: 5e-05
|
| 127 |
+
train_batch_size: 32
|
| 128 |
+
eval_batch_size: 32
|
| 129 |
+
seed: 42
|
| 130 |
+
optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 131 |
+
lr_scheduler_type: linear
|
| 132 |
+
lr_scheduler_warmup_ratio: 0.1
|
| 133 |
+
num_epochs: 1
|
| 134 |
|
|
|
|
| 135 |
|
| 136 |
## Evaluation
|
| 137 |
|
| 138 |
+
Evaluation was perfored on 50% of evaluation split of MultiNERD dataset.
|
| 139 |
|
| 140 |
### Testing Data & Metrics
|
| 141 |
|
|
|
|
| 142 |
|
| 143 |
+
#### Testing Data
|
| 144 |
|
| 145 |
+
Tested on Full test split of MultiNERD dataset.
|
| 146 |
|
| 147 |
|
| 148 |
#### Metrics
|
| 149 |
+
Model versions and checkpoint were evaluated using F1, Precision and Recall.
|
| 150 |
+
For this `seqeval` metric was used: `metric = load_metric("seqeval")`.
|
|
|
|
|
|
|
| 151 |
|
| 152 |
### Results
|
| 153 |
|
| 154 |
+
|Entity | Precision | Recall | F1 score | Support |
|
| 155 |
+
|---|---|---|---|---|
|
| 156 |
+
|ANIM | 0.71 | 0.77 | 0.739 | 1604 |
|
| 157 |
+
|BIO | 0.5 | 0.125 | 0.2 | 8 |
|
| 158 |
+
|CEL | 0.738 | 0.756 | 0.746 | 41 |
|
| 159 |
+
|DIS | 0.737 | 0.772 | 0.754 | 759 |
|
| 160 |
+
|EVE | 0.952 | 0.968 | 0.960 | 352 |
|
| 161 |
+
|FOOD | 0.679 | 0.545 | 0.605 | 566 |
|
| 162 |
+
|INST | 0.75 | 0.75 | 0.75 | 12 |
|
| 163 |
+
|LOC | 0.994 | 0.991 | 0.993 | 12024 |
|
| 164 |
+
|MEDIA | 0.940 | 0.969 | 0.954 | 458 |
|
| 165 |
+
|ORG | 0.977 | 0.981 | 0.979 | 3309 |
|
| 166 |
+
|PER | 0.992 | 0.995 | 0.993 | 5265 |
|
| 167 |
+
|PLANT | 0.617 | 0.730 | 0.669 | 894 |
|
| 168 |
+
|MYTH | 0.647 | 0.687 | 0.666 | 32 |
|
| 169 |
+
|TIME | 0.825 | 0.820 | 0.822 | 289 |
|
| 170 |
+
|VEHI | 0.812 | 0.812 | 0.812 | 32 |
|
| 171 |
+
|**Overall** | **0.939** | **0.947** | **0.943** |
|
| 172 |
|
| 173 |
## Technical Specifications [optional]
|
| 174 |
|
| 175 |
### Model Architecture and Objective
|
| 176 |
Follows the same as RoBERTa-BASE
|
|
|
|
| 177 |
|
| 178 |
### Compute Infrastructure
|
|
|
|
|
|
|
| 179 |
|
| 180 |
#### Hardware
|
| 181 |
|
| 182 |
+
Kaggle - GPU T4x2
|
| 183 |
+
Google Colab - GPU T4x1
|
| 184 |
|
| 185 |
#### Software
|
| 186 |
+
pandas==1.5.3
|
| 187 |
+
numpy==1.23.5
|
| 188 |
+
seqeval==1.2.2
|
| 189 |
+
datasets==2.15.0
|
| 190 |
+
huggingface_hub==0.19.4
|
| 191 |
+
transformers[torch]==4.35.2
|
| 192 |
+
evaluate==0.4.1
|
| 193 |
+
matplotlib==3.7.1
|
| 194 |
+
collections
|
| 195 |
+
torch==2.0.0
|
| 196 |
|
| 197 |
## Model Card Contact
|
| 198 |
+
[jayant-yadav](https://huggingface.co/jayant-yadav)
|
|
|