asahi417 commited on
Commit
238eb24
1 Parent(s): c3db6c2

model update

Browse files
README.md ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - tner/tweetner7
4
+ metrics:
5
+ - f1
6
+ - precision
7
+ - recall
8
+ model-index:
9
+ - name: tner/twitter-roberta-base-dec2020-tweetner7-2020
10
+ results:
11
+ - task:
12
+ name: Token Classification
13
+ type: token-classification
14
+ dataset:
15
+ name: tner/tweetner7/test_2021
16
+ type: tner/tweetner7/test_2021
17
+ args: tner/tweetner7/test_2021
18
+ metrics:
19
+ - name: F1
20
+ type: f1
21
+ value: 0.6286510590858417
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6068661213947482
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6520582793709528
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5826193263874178
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5604713618790561
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6077023445382103
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7649255811360722
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7383770985794231
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7934543772406615
46
+ - task:
47
+ name: Token Classification
48
+ type: token-classification
49
+ dataset:
50
+ name: tner/tweetner7/test_2020
51
+ type: tner/tweetner7/test_2020
52
+ args: tner/tweetner7/test_2020
53
+ metrics:
54
+ - name: F1
55
+ type: f1
56
+ value: 0.6439333862014274
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.65625
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6320705760249092
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6031387609223192
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6135739317575558
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5938222468969824
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7565424266455195
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7710129310344828
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7426050856253243
81
+
82
+ pipeline_tag: token-classification
83
+ widget:
84
+ - text: "Get the all-analog Classic Vinyl Edition of `Takin' Off` Album from {{@Herbie Hancock@}} via {{USERNAME}} link below: {{URL}}"
85
+ example_title: "NER Example 1"
86
+ ---
87
+ # tner/twitter-roberta-base-dec2020-tweetner7-2020
88
+
89
+ This model is a fine-tuned version of [cardiffnlp/twitter-roberta-base-dec2020](https://huggingface.co/cardiffnlp/twitter-roberta-base-dec2020) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_2020` split).
91
+ Model fine-tuning is done via [T-NER](https://github.com/asahi417/tner)'s hyper-parameter search (see the repository
92
+ for more detail). It achieves the following results on the test set of 2021:
93
+ - F1 (micro): 0.6286510590858417
94
+ - Precision (micro): 0.6068661213947482
95
+ - Recall (micro): 0.6520582793709528
96
+ - F1 (macro): 0.5826193263874178
97
+ - Precision (macro): 0.5604713618790561
98
+ - Recall (macro): 0.6077023445382103
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.49895397489539745
104
+ - creative_work: 0.44903064415259536
105
+ - event: 0.43684450524395807
106
+ - group: 0.5762400489895897
107
+ - location: 0.6437541308658294
108
+ - person: 0.8228613299139035
109
+ - product: 0.6506506506506508
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6202748254882829, 0.6378443623614226]
114
+ - 95%: [0.6184976815588282, 0.6399304136434694]
115
+ - F1 (macro):
116
+ - 90%: [0.6202748254882829, 0.6378443623614226]
117
+ - 95%: [0.6184976815588282, 0.6399304136434694]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-dec2020-tweetner7-2020/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-dec2020-tweetner7-2020/raw/main/eval/metric_span.json).
121
+
122
+ ### Usage
123
+ This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
124
+ ```shell
125
+ pip install tner
126
+ ```
127
+ and activate model as below.
128
+ ```python
129
+ from tner import TransformersNER
130
+ model = TransformersNER("tner/twitter-roberta-base-dec2020-tweetner7-2020")
131
+ model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
132
+ ```
133
+ It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
134
+
135
+ ### Training hyperparameters
136
+
137
+ The following hyperparameters were used during training:
138
+ - dataset: ['tner/tweetner7']
139
+ - dataset_split: train_2020
140
+ - dataset_name: None
141
+ - local_dataset: None
142
+ - model: cardiffnlp/twitter-roberta-base-dec2020
143
+ - crf: True
144
+ - max_length: 128
145
+ - epoch: 30
146
+ - batch_size: 32
147
+ - lr: 1e-05
148
+ - random_seed: 0
149
+ - gradient_accumulation_steps: 1
150
+ - weight_decay: 1e-07
151
+ - lr_warmup_step_ratio: 0.15
152
+ - max_grad_norm: 1
153
+
154
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/twitter-roberta-base-dec2020-tweetner7-2020/raw/main/trainer_config.json).
155
+
156
+ ### Reference
157
+ If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
158
+
159
+ ```
160
+
161
+ @inproceedings{ushio-camacho-collados-2021-ner,
162
+ title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
163
+ author = "Ushio, Asahi and
164
+ Camacho-Collados, Jose",
165
+ booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
166
+ month = apr,
167
+ year = "2021",
168
+ address = "Online",
169
+ publisher = "Association for Computational Linguistics",
170
+ url = "https://aclanthology.org/2021.eacl-demos.7",
171
+ doi = "10.18653/v1/2021.eacl-demos.7",
172
+ pages = "53--62",
173
+ 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.",
174
+ }
175
+
176
+ ```
eval/metric.json DELETED
@@ -1 +0,0 @@
1
- {"2020.dev": {"micro/f1": 0.6386958845537146, "micro/f1_ci": {}, "micro/recall": 0.6243469174503657, "micro/precision": 0.6537199124726477, "macro/f1": 0.5845688851603238, "macro/f1_ci": {}, "macro/recall": 0.5723876957337674, "macro/precision": 0.5986924134163691, "per_entity_metric": {"corporation": {"f1": 0.4895833333333333, "f1_ci": {}, "precision": 0.5193370165745856, "recall": 0.4630541871921182}, "creative_work": {"f1": 0.5089058524173028, "f1_ci": {}, "precision": 0.5405405405405406, "recall": 0.4807692307692308}, "event": {"f1": 0.39285714285714285, "f1_ci": {}, "precision": 0.39919354838709675, "recall": 0.38671875}, "group": {"f1": 0.5296610169491525, "f1_ci": {}, "precision": 0.5102040816326531, "recall": 0.5506607929515418}, "location": {"f1": 0.6413043478260869, "f1_ci": {}, "precision": 0.6310160427807486, "recall": 0.6519337016574586}, "person": {"f1": 0.8760757314974182, "f1_ci": {}, "precision": 0.9024822695035462, "recall": 0.8511705685618729}, "product": {"f1": 0.6535947712418301, "f1_ci": {}, "precision": 0.6880733944954128, "recall": 0.6224066390041494}}}, "2021.test": {"micro/f1": 0.6286510590858417, "micro/f1_ci": {"90": [0.6202748254882829, 0.6378443623614226], "95": [0.6184976815588282, 0.6399304136434694]}, "micro/recall": 0.6520582793709528, "micro/precision": 0.6068661213947482, "macro/f1": 0.5826193263874178, "macro/f1_ci": {"90": [0.5730758041885631, 0.5923948982929359], "95": [0.5710195948548461, 0.5939565674784726]}, "macro/recall": 0.6077023445382103, "macro/precision": 0.5604713618790561, "per_entity_metric": {"corporation": {"f1": 0.49895397489539745, "f1_ci": {"90": [0.4740900380273677, 0.5254155321720864], "95": [0.46839534789719484, 0.5299778434362932]}, "precision": 0.47134387351778656, "recall": 0.53}, "creative_work": {"f1": 0.44903064415259536, "f1_ci": {"90": [0.41834966834966836, 0.47882006500914226], "95": [0.4111298735015004, 0.48611544056525346]}, "precision": 0.41359447004608296, "recall": 0.4911080711354309}, "event": {"f1": 0.43684450524395807, "f1_ci": {"90": [0.4132443746794808, 0.4595091419890372], "95": [0.4083257469654529, 0.46410276457343014]}, "precision": 0.43784277879341865, "recall": 0.43585077343039125}, "group": {"f1": 0.5762400489895897, "f1_ci": {"90": [0.5565039530120158, 0.5954325184333603], "95": [0.5526282709880291, 0.5985174584532377]}, "precision": 0.5383295194508009, "recall": 0.6198945981554678}, "location": {"f1": 0.6437541308658294, "f1_ci": {"90": [0.6177487356743749, 0.6711433093555442], "95": [0.6108565669901822, 0.6758728290717165]}, "precision": 0.6110414052697616, "recall": 0.6801675977653632}, "person": {"f1": 0.8228613299139035, "f1_ci": {"90": [0.8118870888802372, 0.8341448223449718], "95": [0.8093167258284707, 0.8359517294083364]}, "precision": 0.8176192209683291, "recall": 0.8281710914454278}, "product": {"f1": 0.6506506506506508, "f1_ci": {"90": [0.628450730150472, 0.672123577203644], "95": [0.6258410385414003, 0.6746884809110153]}, "precision": 0.6335282651072125, "recall": 0.668724279835391}}}, "2020.test": {"micro/f1": 0.6439333862014274, "micro/f1_ci": {"90": [0.6234163633400337, 0.6617054879836103], "95": [0.620296601140631, 0.6652159767398678]}, "micro/recall": 0.6320705760249092, "micro/precision": 0.65625, "macro/f1": 0.6031387609223192, "macro/f1_ci": {"90": [0.5814650043179064, 0.6214737405579287], "95": [0.5769478753146529, 0.6247167595269991]}, "macro/recall": 0.5938222468969824, "macro/precision": 0.6135739317575558, "per_entity_metric": {"corporation": {"f1": 0.5518987341772151, "f1_ci": {"90": [0.495774647887324, 0.6018518518518519], "95": [0.481054054054054, 0.6117767106842738]}, "precision": 0.5343137254901961, "recall": 0.5706806282722513}, "creative_work": {"f1": 0.5172413793103449, "f1_ci": {"90": [0.4618975618975619, 0.5738577425556122], "95": [0.44866459269501097, 0.5829040366996946]}, "precision": 0.5325443786982249, "recall": 0.5027932960893855}, "event": {"f1": 0.42911877394636017, "f1_ci": {"90": [0.38280066287878795, 0.4780351622131284], "95": [0.3752165216808781, 0.4866137266023824]}, "precision": 0.4357976653696498, "recall": 0.4226415094339623}, "group": {"f1": 0.559463986599665, "f1_ci": {"90": [0.5110015268737078, 0.6065222988556122], "95": [0.5, 0.6178964376394552]}, "precision": 0.583916083916084, "recall": 0.5369774919614148}, "location": {"f1": 0.6546546546546548, "f1_ci": {"90": [0.5867749707685221, 0.7157319269359402], "95": [0.5732812621501827, 0.7224163619125017]}, "precision": 0.6488095238095238, "recall": 0.6606060606060606}, "person": {"f1": 0.8397600685518423, "f1_ci": {"90": [0.8127127749861485, 0.8636382189239333], "95": [0.806420397665552, 0.86896508864127]}, "precision": 0.8581436077057794, "recall": 0.8221476510067114}, "product": {"f1": 0.669833729216152, "f1_ci": {"90": [0.6180720440280364, 0.715330305760356], "95": [0.6086568322981365, 0.7247099284158108]}, "precision": 0.7014925373134329, "recall": 0.6409090909090909}}}, "2021.test (span detection)": {"micro/f1": 0.7649255811360722, "micro/f1_ci": {}, "micro/recall": 0.7934543772406615, "micro/precision": 0.7383770985794231, "macro/f1": 0.7649255811360722, "macro/f1_ci": {}, "macro/recall": 0.7934543772406615, "macro/precision": 0.7383770985794231}, "2020.test (span detection)": {"micro/f1": 0.7565424266455195, "micro/f1_ci": {}, "micro/recall": 0.7426050856253243, "micro/precision": 0.7710129310344828, "macro/f1": 0.7565424266455195, "macro/f1_ci": {}, "macro/recall": 0.7426050856253243, "macro/precision": 0.7710129310344828}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6439333862014274, "micro/f1_ci": {"90": [0.6234163633400337, 0.6617054879836103], "95": [0.620296601140631, 0.6652159767398678]}, "micro/recall": 0.6320705760249092, "micro/precision": 0.65625, "macro/f1": 0.6031387609223192, "macro/f1_ci": {"90": [0.5814650043179064, 0.6214737405579287], "95": [0.5769478753146529, 0.6247167595269991]}, "macro/recall": 0.5938222468969824, "macro/precision": 0.6135739317575558, "per_entity_metric": {"corporation": {"f1": 0.5518987341772151, "f1_ci": {"90": [0.495774647887324, 0.6018518518518519], "95": [0.481054054054054, 0.6117767106842738]}, "precision": 0.5343137254901961, "recall": 0.5706806282722513}, "creative_work": {"f1": 0.5172413793103449, "f1_ci": {"90": [0.4618975618975619, 0.5738577425556122], "95": [0.44866459269501097, 0.5829040366996946]}, "precision": 0.5325443786982249, "recall": 0.5027932960893855}, "event": {"f1": 0.42911877394636017, "f1_ci": {"90": [0.38280066287878795, 0.4780351622131284], "95": [0.3752165216808781, 0.4866137266023824]}, "precision": 0.4357976653696498, "recall": 0.4226415094339623}, "group": {"f1": 0.559463986599665, "f1_ci": {"90": [0.5110015268737078, 0.6065222988556122], "95": [0.5, 0.6178964376394552]}, "precision": 0.583916083916084, "recall": 0.5369774919614148}, "location": {"f1": 0.6546546546546548, "f1_ci": {"90": [0.5867749707685221, 0.7157319269359402], "95": [0.5732812621501827, 0.7224163619125017]}, "precision": 0.6488095238095238, "recall": 0.6606060606060606}, "person": {"f1": 0.8397600685518423, "f1_ci": {"90": [0.8127127749861485, 0.8636382189239333], "95": [0.806420397665552, 0.86896508864127]}, "precision": 0.8581436077057794, "recall": 0.8221476510067114}, "product": {"f1": 0.669833729216152, "f1_ci": {"90": [0.6180720440280364, 0.715330305760356], "95": [0.6086568322981365, 0.7247099284158108]}, "precision": 0.7014925373134329, "recall": 0.6409090909090909}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6286510590858417, "micro/f1_ci": {"90": [0.6202748254882829, 0.6378443623614226], "95": [0.6184976815588282, 0.6399304136434694]}, "micro/recall": 0.6520582793709528, "micro/precision": 0.6068661213947482, "macro/f1": 0.5826193263874178, "macro/f1_ci": {"90": [0.5730758041885631, 0.5923948982929359], "95": [0.5710195948548461, 0.5939565674784726]}, "macro/recall": 0.6077023445382103, "macro/precision": 0.5604713618790561, "per_entity_metric": {"corporation": {"f1": 0.49895397489539745, "f1_ci": {"90": [0.4740900380273677, 0.5254155321720864], "95": [0.46839534789719484, 0.5299778434362932]}, "precision": 0.47134387351778656, "recall": 0.53}, "creative_work": {"f1": 0.44903064415259536, "f1_ci": {"90": [0.41834966834966836, 0.47882006500914226], "95": [0.4111298735015004, 0.48611544056525346]}, "precision": 0.41359447004608296, "recall": 0.4911080711354309}, "event": {"f1": 0.43684450524395807, "f1_ci": {"90": [0.4132443746794808, 0.4595091419890372], "95": [0.4083257469654529, 0.46410276457343014]}, "precision": 0.43784277879341865, "recall": 0.43585077343039125}, "group": {"f1": 0.5762400489895897, "f1_ci": {"90": [0.5565039530120158, 0.5954325184333603], "95": [0.5526282709880291, 0.5985174584532377]}, "precision": 0.5383295194508009, "recall": 0.6198945981554678}, "location": {"f1": 0.6437541308658294, "f1_ci": {"90": [0.6177487356743749, 0.6711433093555442], "95": [0.6108565669901822, 0.6758728290717165]}, "precision": 0.6110414052697616, "recall": 0.6801675977653632}, "person": {"f1": 0.8228613299139035, "f1_ci": {"90": [0.8118870888802372, 0.8341448223449718], "95": [0.8093167258284707, 0.8359517294083364]}, "precision": 0.8176192209683291, "recall": 0.8281710914454278}, "product": {"f1": 0.6506506506506508, "f1_ci": {"90": [0.628450730150472, 0.672123577203644], "95": [0.6258410385414003, 0.6746884809110153]}, "precision": 0.6335282651072125, "recall": 0.668724279835391}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7565424266455195, "micro/f1_ci": {}, "micro/recall": 0.7426050856253243, "micro/precision": 0.7710129310344828, "macro/f1": 0.7565424266455195, "macro/f1_ci": {}, "macro/recall": 0.7426050856253243, "macro/precision": 0.7710129310344828}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7649255811360722, "micro/f1_ci": {}, "micro/recall": 0.7934543772406615, "micro/precision": 0.7383770985794231, "macro/f1": 0.7649255811360722, "macro/f1_ci": {}, "macro/recall": 0.7934543772406615, "macro/precision": 0.7383770985794231}
eval/prediction.2020.dev.json DELETED
The diff for this file is too large to render. See raw diff
 
eval/prediction.2020.test.json DELETED
The diff for this file is too large to render. See raw diff
 
eval/prediction.2021.test.json DELETED
The diff for this file is too large to render. See raw diff
 
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "2020.train", "model": "cardiffnlp/twitter-roberta-base-dec2020", "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}
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_2020", "dataset_name": null, "local_dataset": null, "model": "cardiffnlp/twitter-roberta-base-dec2020", "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}