model update
Browse files- README.md +168 -0
- eval/metric.test_2020.json +1 -0
- eval/{metric.json → metric.test_2021.json} +1 -1
- eval/metric_span.test_2020.json +1 -0
- eval/metric_span.test_2021.json +1 -0
- trainer_config.json +1 -1
README.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- tner/tweetner7
|
| 4 |
+
metrics:
|
| 5 |
+
- f1
|
| 6 |
+
- precision
|
| 7 |
+
- recall
|
| 8 |
+
model-index:
|
| 9 |
+
- name: tner/roberta-large-tweetner7-selflabel2021
|
| 10 |
+
results:
|
| 11 |
+
- task:
|
| 12 |
+
name: Token Classification
|
| 13 |
+
type: token-classification
|
| 14 |
+
dataset:
|
| 15 |
+
name: tner/tweetner7
|
| 16 |
+
type: tner/tweetner7
|
| 17 |
+
args: tner/tweetner7
|
| 18 |
+
metrics:
|
| 19 |
+
- name: F1 (test_2021)
|
| 20 |
+
type: f1
|
| 21 |
+
value: 0.6460286973223365
|
| 22 |
+
- name: Precision (test_2021)
|
| 23 |
+
type: precision
|
| 24 |
+
value: 0.6315440689198144
|
| 25 |
+
- name: Recall (test_2021)
|
| 26 |
+
type: recall
|
| 27 |
+
value: 0.6611933395004626
|
| 28 |
+
- name: Macro F1 (test_2021)
|
| 29 |
+
type: f1_macro
|
| 30 |
+
value: 0.5944660768713126
|
| 31 |
+
- name: Macro Precision (test_2021)
|
| 32 |
+
type: precision_macro
|
| 33 |
+
value: 0.5801646971717881
|
| 34 |
+
- name: Macro Recall (test_2021)
|
| 35 |
+
type: recall_macro
|
| 36 |
+
value: 0.6174983598336771
|
| 37 |
+
- name: Entity Span F1 (test_2021)
|
| 38 |
+
type: f1_entity_span
|
| 39 |
+
value: 0.7857183209988137
|
| 40 |
+
- name: Entity Span Precision (test_2020)
|
| 41 |
+
type: precision_entity_span
|
| 42 |
+
value: 0.7680583167660703
|
| 43 |
+
- name: Entity Span Recall (test_2021)
|
| 44 |
+
type: recall_entity_span
|
| 45 |
+
value: 0.8042095524459351
|
| 46 |
+
- name: F1 (test_2020)
|
| 47 |
+
type: f1
|
| 48 |
+
value: 0.6475365457498646
|
| 49 |
+
- name: Precision (test_2020)
|
| 50 |
+
type: precision
|
| 51 |
+
value: 0.6768534238822863
|
| 52 |
+
- name: Recall (test_2020)
|
| 53 |
+
type: recall
|
| 54 |
+
value: 0.6206538661131292
|
| 55 |
+
- name: Macro F1 (test_2020)
|
| 56 |
+
type: f1_macro
|
| 57 |
+
value: 0.6064934754479069
|
| 58 |
+
- name: Macro Precision (test_2020)
|
| 59 |
+
type: precision_macro
|
| 60 |
+
value: 0.63365172906493
|
| 61 |
+
- name: Macro Recall (test_2020)
|
| 62 |
+
type: recall_macro
|
| 63 |
+
value: 0.5889063993107413
|
| 64 |
+
- name: Entity Span F1 (test_2020)
|
| 65 |
+
type: f1_entity_span
|
| 66 |
+
value: 0.7663146493365827
|
| 67 |
+
- name: Entity Span Precision (test_2020)
|
| 68 |
+
type: precision_entity_span
|
| 69 |
+
value: 0.8012457531143827
|
| 70 |
+
- name: Entity Span Recall (test_2020)
|
| 71 |
+
type: recall_entity_span
|
| 72 |
+
value: 0.7343020238713025
|
| 73 |
+
|
| 74 |
+
pipeline_tag: token-classification
|
| 75 |
+
widget:
|
| 76 |
+
- text: "Get the all-analog Classic Vinyl Edition of `Takin' Off` Album from {{@Herbie Hancock@}} via {{USERNAME}} link below: {{URL}}"
|
| 77 |
+
example_title: "NER Example 1"
|
| 78 |
+
---
|
| 79 |
+
# tner/roberta-large-tweetner7-selflabel2021
|
| 80 |
+
|
| 81 |
+
This model is a fine-tuned version of [roberta-large](https://huggingface.co/roberta-large) on the
|
| 82 |
+
[tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train` split). This model is fine-tuned on self-labeled dataset which is the `extra_2021` split of the [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) annotated by [tner/roberta-large](https://huggingface.co/tner/tner/roberta-large-tweetner7-2020)). Please check [https://github.com/asahi417/tner/tree/master/examples/tweetner7_paper#model-fine-tuning-self-labeling](https://github.com/asahi417/tner/tree/master/examples/tweetner7_paper#model-fine-tuning-self-labeling) for more detail of reproducing the model.
|
| 83 |
+
Model fine-tuning is done via [T-NER](https://github.com/asahi417/tner)'s hyper-parameter search (see the repository
|
| 84 |
+
for more detail). It achieves the following results on the test set of 2021:
|
| 85 |
+
- F1 (micro): 0.6460286973223365
|
| 86 |
+
- Precision (micro): 0.6315440689198144
|
| 87 |
+
- Recall (micro): 0.6611933395004626
|
| 88 |
+
- F1 (macro): 0.5944660768713126
|
| 89 |
+
- Precision (macro): 0.5801646971717881
|
| 90 |
+
- Recall (macro): 0.6174983598336771
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
The per-entity breakdown of the F1 score on the test set are below:
|
| 95 |
+
- corporation: 0.5021008403361344
|
| 96 |
+
- creative_work: 0.4589000591366056
|
| 97 |
+
- event: 0.45184799583550234
|
| 98 |
+
- group: 0.602966540186271
|
| 99 |
+
- location: 0.667091836734694
|
| 100 |
+
- person: 0.8345784418356457
|
| 101 |
+
- product: 0.6437768240343348
|
| 102 |
+
|
| 103 |
+
For F1 scores, the confidence interval is obtained by bootstrap as below:
|
| 104 |
+
- F1 (micro):
|
| 105 |
+
- 90%: [0.63733724830433, 0.6556095472315113]
|
| 106 |
+
- 95%: [0.6353273787551952, 0.6574352280031737]
|
| 107 |
+
- F1 (macro):
|
| 108 |
+
- 90%: [0.63733724830433, 0.6556095472315113]
|
| 109 |
+
- 95%: [0.6353273787551952, 0.6574352280031737]
|
| 110 |
+
|
| 111 |
+
Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-tweetner7-selflabel2021/raw/main/eval/metric.json)
|
| 112 |
+
and [metric file of entity span](https://huggingface.co/tner/roberta-large-tweetner7-selflabel2021/raw/main/eval/metric_span.json).
|
| 113 |
+
|
| 114 |
+
### Usage
|
| 115 |
+
This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
|
| 116 |
+
```shell
|
| 117 |
+
pip install tner
|
| 118 |
+
```
|
| 119 |
+
and activate model as below.
|
| 120 |
+
```python
|
| 121 |
+
from tner import TransformersNER
|
| 122 |
+
model = TransformersNER("tner/roberta-large-tweetner7-selflabel2021")
|
| 123 |
+
model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
|
| 124 |
+
```
|
| 125 |
+
It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
|
| 126 |
+
|
| 127 |
+
### Training hyperparameters
|
| 128 |
+
|
| 129 |
+
The following hyperparameters were used during training:
|
| 130 |
+
- dataset: ['tner/tweetner7']
|
| 131 |
+
- dataset_split: train
|
| 132 |
+
- dataset_name: None
|
| 133 |
+
- local_dataset: {'train': 'tweet_ner/2021.extra.tner/roberta-large-2020.txt', 'validation': 'tweet_ner/2020.dev.txt'}
|
| 134 |
+
- model: roberta-large
|
| 135 |
+
- crf: True
|
| 136 |
+
- max_length: 128
|
| 137 |
+
- epoch: 30
|
| 138 |
+
- batch_size: 32
|
| 139 |
+
- lr: 1e-05
|
| 140 |
+
- random_seed: 0
|
| 141 |
+
- gradient_accumulation_steps: 1
|
| 142 |
+
- weight_decay: 1e-07
|
| 143 |
+
- lr_warmup_step_ratio: 0.15
|
| 144 |
+
- max_grad_norm: 1
|
| 145 |
+
|
| 146 |
+
The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/roberta-large-tweetner7-selflabel2021/raw/main/trainer_config.json).
|
| 147 |
+
|
| 148 |
+
### Reference
|
| 149 |
+
If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
|
| 150 |
+
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
@inproceedings{ushio-camacho-collados-2021-ner,
|
| 154 |
+
title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
|
| 155 |
+
author = "Ushio, Asahi and
|
| 156 |
+
Camacho-Collados, Jose",
|
| 157 |
+
booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
|
| 158 |
+
month = apr,
|
| 159 |
+
year = "2021",
|
| 160 |
+
address = "Online",
|
| 161 |
+
publisher = "Association for Computational Linguistics",
|
| 162 |
+
url = "https://aclanthology.org/2021.eacl-demos.7",
|
| 163 |
+
doi = "10.18653/v1/2021.eacl-demos.7",
|
| 164 |
+
pages = "53--62",
|
| 165 |
+
abstract = "Language model (LM) pretraining has led to consistent improvements in many NLP downstream tasks, including named entity recognition (NER). In this paper, we present T-NER (Transformer-based Named Entity Recognition), a Python library for NER LM finetuning. In addition to its practical utility, T-NER facilitates the study and investigation of the cross-domain and cross-lingual generalization ability of LMs finetuned on NER. Our library also provides a web app where users can get model predictions interactively for arbitrary text, which facilitates qualitative model evaluation for non-expert programmers. We show the potential of the library by compiling nine public NER datasets into a unified format and evaluating the cross-domain and cross- lingual performance across the datasets. The results from our initial experiments show that in-domain performance is generally competitive across datasets. However, cross-domain generalization is challenging even with a large pretrained LM, which has nevertheless capacity to learn domain-specific features if fine- tuned on a combined dataset. To facilitate future research, we also release all our LM checkpoints via the Hugging Face model hub.",
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
```
|
eval/metric.test_2020.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"micro/f1": 0.6475365457498646, "micro/f1_ci": {"90": [0.6278810391051123, 0.6659767107844533], "95": [0.6235838190810499, 0.6692123090249849]}, "micro/recall": 0.6206538661131292, "micro/precision": 0.6768534238822863, "macro/f1": 0.6064934754479069, "macro/f1_ci": {"90": [0.5836818822839157, 0.6251332135885596], "95": [0.5795678730454966, 0.6290985642471119]}, "macro/recall": 0.5889063993107413, "macro/precision": 0.63365172906493, "per_entity_metric": {"corporation": {"f1": 0.5618556701030927, "f1_ci": {"90": [0.5, 0.6172598627787307], "95": [0.4885981049752539, 0.6259302015554888]}, "precision": 0.5532994923857868, "recall": 0.5706806282722513}, "creative_work": {"f1": 0.5040650406504065, "f1_ci": {"90": [0.44183047910974876, 0.5584744579292135], "95": [0.4330176767676768, 0.572193256090315]}, "precision": 0.48947368421052634, "recall": 0.5195530726256983}, "event": {"f1": 0.4731182795698925, "f1_ci": {"90": [0.41807994639571167, 0.5219746433628906], "95": [0.40788644405130475, 0.5325269892043183]}, "precision": 0.55, "recall": 0.41509433962264153}, "group": {"f1": 0.5521235521235521, "f1_ci": {"90": [0.5008620689655173, 0.6033057851239669], "95": [0.48913461538461533, 0.6141652372784449]}, "precision": 0.6908212560386473, "recall": 0.45980707395498394}, "location": {"f1": 0.6746268656716418, "f1_ci": {"90": [0.610678987545199, 0.7329210191981933], "95": [0.5951452376616281, 0.741727195043794]}, "precision": 0.6647058823529411, "recall": 0.6848484848484848}, "person": {"f1": 0.8190314358538658, "f1_ci": {"90": [0.7936307012256378, 0.8422012779178834], "95": [0.787314635592392, 0.846041418767823]}, "precision": 0.8296041308089501, "recall": 0.8087248322147651}, "product": {"f1": 0.660633484162896, "f1_ci": {"90": [0.6098026856808009, 0.7045074140794477], "95": [0.6030337195196198, 0.7142857142857143]}, "precision": 0.6576576576576577, "recall": 0.6636363636363637}}}
|
eval/{metric.json → metric.test_2021.json}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"
|
|
|
|
| 1 |
+
{"micro/f1": 0.6460286973223365, "micro/f1_ci": {"90": [0.63733724830433, 0.6556095472315113], "95": [0.6353273787551952, 0.6574352280031737]}, "micro/recall": 0.6611933395004626, "micro/precision": 0.6315440689198144, "macro/f1": 0.5944660768713126, "macro/f1_ci": {"90": [0.5849081455127132, 0.604378357848271], "95": [0.5831045169205292, 0.6060640264322646]}, "macro/recall": 0.6174983598336771, "macro/precision": 0.5801646971717881, "per_entity_metric": {"corporation": {"f1": 0.5021008403361344, "f1_ci": {"90": [0.4789834700215685, 0.5271894733215282], "95": [0.4745525584297708, 0.5316368161943792]}, "precision": 0.4760956175298805, "recall": 0.5311111111111111}, "creative_work": {"f1": 0.4589000591366056, "f1_ci": {"90": [0.4306853034260597, 0.48736707656304246], "95": [0.4254521058174994, 0.4930922458104417]}, "precision": 0.4041666666666667, "recall": 0.53077975376197}, "event": {"f1": 0.45184799583550234, "f1_ci": {"90": [0.4270124161552733, 0.4763863451671203], "95": [0.422088474249013, 0.4810302713987474]}, "precision": 0.5279805352798054, "recall": 0.39490445859872614}, "group": {"f1": 0.602966540186271, "f1_ci": {"90": [0.5815257576832498, 0.6258527871580286], "95": [0.5783987738887143, 0.6301280206163071]}, "precision": 0.6328747284576394, "recall": 0.5757575757575758}, "location": {"f1": 0.667091836734694, "f1_ci": {"90": [0.6408738272872012, 0.6929653849735745], "95": [0.6349154946952874, 0.6970575007002522]}, "precision": 0.613849765258216, "recall": 0.7304469273743017}, "person": {"f1": 0.8345784418356457, "f1_ci": {"90": [0.8240660420354806, 0.8454018578179613], "95": [0.8221766134345567, 0.8467589019305347]}, "precision": 0.8061855670103093, "recall": 0.8650442477876106}, "product": {"f1": 0.6437768240343348, "f1_ci": {"90": [0.622562297681236, 0.6648001670663515], "95": [0.6190244802359166, 0.668536346487744]}, "precision": 0.6, "recall": 0.6944444444444444}}}
|
eval/metric_span.test_2020.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"micro/f1": 0.7663146493365827, "micro/f1_ci": {}, "micro/recall": 0.7343020238713025, "micro/precision": 0.8012457531143827, "macro/f1": 0.7663146493365827, "macro/f1_ci": {}, "macro/recall": 0.7343020238713025, "macro/precision": 0.8012457531143827}
|
eval/metric_span.test_2021.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"micro/f1": 0.7857183209988137, "micro/f1_ci": {}, "micro/recall": 0.8042095524459351, "micro/precision": 0.7680583167660703, "macro/f1": 0.7857183209988137, "macro/f1_ci": {}, "macro/recall": 0.8042095524459351, "macro/precision": 0.7680583167660703}
|
trainer_config.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"
|
|
|
|
| 1 |
+
{"dataset": ["tner/tweetner7"], "dataset_split": "train", "dataset_name": null, "local_dataset": {"train": "tweet_ner/2021.extra.tner/roberta-large-2020.txt", "validation": "tweet_ner/2020.dev.txt"}, "model": "roberta-large", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 1e-05, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.15, "max_grad_norm": 1}
|