asahi417 commited on
Commit
9c976bf
1 Parent(s): 74372e7

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/roberta-large-tweetner7-2020-2021-concat
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.6574551220340903
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.644212629008989
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6712534690101758
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6124665667529737
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.6005167968535563
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.625251837701222
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7881979839166384
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7722783264898457
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.804787787672025
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.6628787878787878
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6924816280384398
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6357031655422937
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6297223287745568
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6618492079232416
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.601311568050436
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7642760487144791
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7986425339366516
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7327451997924235
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/roberta-large-tweetner7-2020-2021-concat
88
+
89
+ This model is a fine-tuned version of [roberta-large](https://huggingface.co/roberta-large) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_all` 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.6574551220340903
94
+ - Precision (micro): 0.644212629008989
95
+ - Recall (micro): 0.6712534690101758
96
+ - F1 (macro): 0.6124665667529737
97
+ - Precision (macro): 0.6005167968535563
98
+ - Recall (macro): 0.625251837701222
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5392156862745098
104
+ - creative_work: 0.4760582928521859
105
+ - event: 0.4673321234119782
106
+ - group: 0.6139798488664987
107
+ - location: 0.6707399864222675
108
+ - person: 0.8293212669683258
109
+ - product: 0.6906187624750498
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6484148010152769, 0.6672289519134409]
114
+ - 95%: [0.6470100684797441, 0.6689850350992637]
115
+ - F1 (macro):
116
+ - 90%: [0.6484148010152769, 0.6672289519134409]
117
+ - 95%: [0.6470100684797441, 0.6689850350992637]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-tweetner7-2020-2021-concat/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/roberta-large-tweetner7-2020-2021-concat/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/roberta-large-tweetner7-2020-2021-concat")
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_all
140
+ - dataset_name: None
141
+ - local_dataset: None
142
+ - model: roberta-large
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/roberta-large-tweetner7-2020-2021-concat/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
- {"2021.dev": {"micro/f1": 0.6533466533466533, "micro/f1_ci": {}, "micro/recall": 0.654, "micro/precision": 0.6526946107784432, "macro/f1": 0.6139317233528648, "macro/f1_ci": {}, "macro/recall": 0.6070190930048767, "macro/precision": 0.6237479137205354, "per_entity_metric": {"corporation": {"f1": 0.5631067961165048, "f1_ci": {}, "precision": 0.5576923076923077, "recall": 0.5686274509803921}, "creative_work": {"f1": 0.47297297297297297, "f1_ci": {}, "precision": 0.47297297297297297, "recall": 0.47297297297297297}, "event": {"f1": 0.4505928853754941, "f1_ci": {}, "precision": 0.4672131147540984, "recall": 0.4351145038167939}, "group": {"f1": 0.6345733041575492, "f1_ci": {}, "precision": 0.6304347826086957, "recall": 0.6387665198237885}, "location": {"f1": 0.7076923076923076, "f1_ci": {}, "precision": 0.7931034482758621, "recall": 0.6388888888888888}, "person": {"f1": 0.8231292517006802, "f1_ci": {}, "precision": 0.7934426229508197, "recall": 0.8551236749116607}, "product": {"f1": 0.6454545454545454, "f1_ci": {}, "precision": 0.6513761467889908, "recall": 0.6396396396396397}}}, "2021.test": {"micro/f1": 0.6574551220340903, "micro/f1_ci": {"90": [0.6484148010152769, 0.6672289519134409], "95": [0.6470100684797441, 0.6689850350992637]}, "micro/recall": 0.6712534690101758, "micro/precision": 0.644212629008989, "macro/f1": 0.6124665667529737, "macro/f1_ci": {"90": [0.6027797907638927, 0.6224386923123064], "95": [0.600643831363655, 0.6236643933399094]}, "macro/recall": 0.625251837701222, "macro/precision": 0.6005167968535563, "per_entity_metric": {"corporation": {"f1": 0.5392156862745098, "f1_ci": {"90": [0.5150666283343305, 0.5627638588284978], "95": [0.5107747807572307, 0.5685865874978943]}, "precision": 0.5288461538461539, "recall": 0.55}, "creative_work": {"f1": 0.4760582928521859, "f1_ci": {"90": [0.44542457349745634, 0.508050611843474], "95": [0.43965273913172126, 0.5137357875658368]}, "precision": 0.4830985915492958, "recall": 0.4692202462380301}, "event": {"f1": 0.4673321234119782, "f1_ci": {"90": [0.4453263502657273, 0.4898926859987146], "95": [0.4407011814810304, 0.4935304881902431]}, "precision": 0.4660633484162896, "recall": 0.46860782529572337}, "group": {"f1": 0.6139798488664987, "f1_ci": {"90": [0.5937377152453256, 0.6348052094376245], "95": [0.5916896908608198, 0.6386072364652792]}, "precision": 0.5880579010856454, "recall": 0.642292490118577}, "location": {"f1": 0.6707399864222675, "f1_ci": {"90": [0.6421888503799826, 0.6973484858175715], "95": [0.6384158152719541, 0.702529512070608]}, "precision": 0.6525759577278731, "recall": 0.6899441340782123}, "person": {"f1": 0.8293212669683258, "f1_ci": {"90": [0.8181446413482045, 0.8403938359511686], "95": [0.8159141098754302, 0.8428604160939993]}, "precision": 0.8144329896907216, "recall": 0.8447640117994101}, "product": {"f1": 0.6906187624750498, "f1_ci": {"90": [0.6702170960229447, 0.7112006663611212], "95": [0.6659795602550325, 0.714153086982773]}, "precision": 0.6705426356589147, "recall": 0.7119341563786008}}}, "2020.test": {"micro/f1": 0.6628787878787878, "micro/f1_ci": {"90": [0.6433422832233964, 0.6809899075848771], "95": [0.6396017768782147, 0.6838039347472534]}, "micro/recall": 0.6357031655422937, "micro/precision": 0.6924816280384398, "macro/f1": 0.6297223287745568, "macro/f1_ci": {"90": [0.6077306460764652, 0.649687103374554], "95": [0.6035631307519294, 0.6525413558422907]}, "macro/recall": 0.601311568050436, "macro/precision": 0.6618492079232416, "per_entity_metric": {"corporation": {"f1": 0.6183844011142062, "f1_ci": {"90": [0.5604604257738921, 0.6691009721496806], "95": [0.5487777897690481, 0.6787612489773658]}, "precision": 0.6607142857142857, "recall": 0.581151832460733}, "creative_work": {"f1": 0.5159420289855072, "f1_ci": {"90": [0.4561346362649294, 0.5690866992079243], "95": [0.44507064868336543, 0.5785442676279234]}, "precision": 0.536144578313253, "recall": 0.4972067039106145}, "event": {"f1": 0.5028790786948176, "f1_ci": {"90": [0.4574887305511124, 0.5513362750160383], "95": [0.44581993761996164, 0.5625028357531761]}, "precision": 0.51171875, "recall": 0.49433962264150944}, "group": {"f1": 0.5598591549295774, "f1_ci": {"90": [0.5130891913483878, 0.6074147053457399], "95": [0.5018050541516246, 0.6181973581973583]}, "precision": 0.6186770428015564, "recall": 0.5112540192926045}, "location": {"f1": 0.6923076923076923, "f1_ci": {"90": [0.6291361251400163, 0.75], "95": [0.6172724125995154, 0.7622443181818181]}, "precision": 0.7346938775510204, "recall": 0.6545454545454545}, "person": {"f1": 0.8201193520886614, "f1_ci": {"90": [0.7918366950327573, 0.8450477632944151], "95": [0.7872476092967537, 0.8496363016720296]}, "precision": 0.8336221837088388, "recall": 0.8070469798657718}, "product": {"f1": 0.6985645933014354, "f1_ci": {"90": [0.6469248291571754, 0.744086649786838], "95": [0.6368046132971505, 0.7505999077065068]}, "precision": 0.7373737373737373, "recall": 0.6636363636363637}}}, "2021.test (span detection)": {"micro/f1": 0.7881979839166384, "micro/f1_ci": {}, "micro/recall": 0.804787787672025, "micro/precision": 0.7722783264898457, "macro/f1": 0.7881979839166384, "macro/f1_ci": {}, "macro/recall": 0.804787787672025, "macro/precision": 0.7722783264898457}, "2020.test (span detection)": {"micro/f1": 0.7642760487144791, "micro/f1_ci": {}, "micro/recall": 0.7327451997924235, "micro/precision": 0.7986425339366516, "macro/f1": 0.7642760487144791, "macro/f1_ci": {}, "macro/recall": 0.7327451997924235, "macro/precision": 0.7986425339366516}}
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6628787878787878, "micro/f1_ci": {"90": [0.6433422832233964, 0.6809899075848771], "95": [0.6396017768782147, 0.6838039347472534]}, "micro/recall": 0.6357031655422937, "micro/precision": 0.6924816280384398, "macro/f1": 0.6297223287745568, "macro/f1_ci": {"90": [0.6077306460764652, 0.649687103374554], "95": [0.6035631307519294, 0.6525413558422907]}, "macro/recall": 0.601311568050436, "macro/precision": 0.6618492079232416, "per_entity_metric": {"corporation": {"f1": 0.6183844011142062, "f1_ci": {"90": [0.5604604257738921, 0.6691009721496806], "95": [0.5487777897690481, 0.6787612489773658]}, "precision": 0.6607142857142857, "recall": 0.581151832460733}, "creative_work": {"f1": 0.5159420289855072, "f1_ci": {"90": [0.4561346362649294, 0.5690866992079243], "95": [0.44507064868336543, 0.5785442676279234]}, "precision": 0.536144578313253, "recall": 0.4972067039106145}, "event": {"f1": 0.5028790786948176, "f1_ci": {"90": [0.4574887305511124, 0.5513362750160383], "95": [0.44581993761996164, 0.5625028357531761]}, "precision": 0.51171875, "recall": 0.49433962264150944}, "group": {"f1": 0.5598591549295774, "f1_ci": {"90": [0.5130891913483878, 0.6074147053457399], "95": [0.5018050541516246, 0.6181973581973583]}, "precision": 0.6186770428015564, "recall": 0.5112540192926045}, "location": {"f1": 0.6923076923076923, "f1_ci": {"90": [0.6291361251400163, 0.75], "95": [0.6172724125995154, 0.7622443181818181]}, "precision": 0.7346938775510204, "recall": 0.6545454545454545}, "person": {"f1": 0.8201193520886614, "f1_ci": {"90": [0.7918366950327573, 0.8450477632944151], "95": [0.7872476092967537, 0.8496363016720296]}, "precision": 0.8336221837088388, "recall": 0.8070469798657718}, "product": {"f1": 0.6985645933014354, "f1_ci": {"90": [0.6469248291571754, 0.744086649786838], "95": [0.6368046132971505, 0.7505999077065068]}, "precision": 0.7373737373737373, "recall": 0.6636363636363637}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6574551220340903, "micro/f1_ci": {"90": [0.6484148010152769, 0.6672289519134409], "95": [0.6470100684797441, 0.6689850350992637]}, "micro/recall": 0.6712534690101758, "micro/precision": 0.644212629008989, "macro/f1": 0.6124665667529737, "macro/f1_ci": {"90": [0.6027797907638927, 0.6224386923123064], "95": [0.600643831363655, 0.6236643933399094]}, "macro/recall": 0.625251837701222, "macro/precision": 0.6005167968535563, "per_entity_metric": {"corporation": {"f1": 0.5392156862745098, "f1_ci": {"90": [0.5150666283343305, 0.5627638588284978], "95": [0.5107747807572307, 0.5685865874978943]}, "precision": 0.5288461538461539, "recall": 0.55}, "creative_work": {"f1": 0.4760582928521859, "f1_ci": {"90": [0.44542457349745634, 0.508050611843474], "95": [0.43965273913172126, 0.5137357875658368]}, "precision": 0.4830985915492958, "recall": 0.4692202462380301}, "event": {"f1": 0.4673321234119782, "f1_ci": {"90": [0.4453263502657273, 0.4898926859987146], "95": [0.4407011814810304, 0.4935304881902431]}, "precision": 0.4660633484162896, "recall": 0.46860782529572337}, "group": {"f1": 0.6139798488664987, "f1_ci": {"90": [0.5937377152453256, 0.6348052094376245], "95": [0.5916896908608198, 0.6386072364652792]}, "precision": 0.5880579010856454, "recall": 0.642292490118577}, "location": {"f1": 0.6707399864222675, "f1_ci": {"90": [0.6421888503799826, 0.6973484858175715], "95": [0.6384158152719541, 0.702529512070608]}, "precision": 0.6525759577278731, "recall": 0.6899441340782123}, "person": {"f1": 0.8293212669683258, "f1_ci": {"90": [0.8181446413482045, 0.8403938359511686], "95": [0.8159141098754302, 0.8428604160939993]}, "precision": 0.8144329896907216, "recall": 0.8447640117994101}, "product": {"f1": 0.6906187624750498, "f1_ci": {"90": [0.6702170960229447, 0.7112006663611212], "95": [0.6659795602550325, 0.714153086982773]}, "precision": 0.6705426356589147, "recall": 0.7119341563786008}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7642760487144791, "micro/f1_ci": {}, "micro/recall": 0.7327451997924235, "micro/precision": 0.7986425339366516, "macro/f1": 0.7642760487144791, "macro/f1_ci": {}, "macro/recall": 0.7327451997924235, "macro/precision": 0.7986425339366516}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7881979839166384, "micro/f1_ci": {}, "micro/recall": 0.804787787672025, "micro/precision": 0.7722783264898457, "macro/f1": 0.7881979839166384, "macro/f1_ci": {}, "macro/recall": 0.804787787672025, "macro/precision": 0.7722783264898457}
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.dev.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_2021.train", "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}
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_all", "dataset_name": null, "local_dataset": null, "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}