asahi417 commited on
Commit
8c6f4d3
1 Parent(s): a804325

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-2021
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.6404513989878424
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6443872176050568
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6365633672525439
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5910583983096561
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5928837696021392
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5900571634271187
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7770796974985457
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7818096687346365
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7724066150109865
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.6335644937586686
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6805721096543504
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5926310326933056
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.5914520478690088
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6370623744887871
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5535477989961968
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7436182019977802
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7990459153249851
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.6953814218993254
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-2021
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_2021` 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.6404513989878424
94
+ - Precision (micro): 0.6443872176050568
95
+ - Recall (micro): 0.6365633672525439
96
+ - F1 (macro): 0.5910583983096561
97
+ - Precision (macro): 0.5928837696021392
98
+ - Recall (macro): 0.5900571634271187
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5058236272878537
104
+ - creative_work: 0.43911917098445596
105
+ - event: 0.46597353497164457
106
+ - group: 0.6068318821165438
107
+ - location: 0.6398910823689584
108
+ - person: 0.8267511177347244
109
+ - product: 0.6530183727034121
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6310532748860292, 0.6500710194412829]
114
+ - 95%: [0.6296658889111393, 0.6521427599284435]
115
+ - F1 (macro):
116
+ - 90%: [0.6310532748860292, 0.6500710194412829]
117
+ - 95%: [0.6296658889111393, 0.6521427599284435]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-tweetner7-2021/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/roberta-large-tweetner7-2021/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-2021")
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_2021
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-2021/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.6360351058337637, "micro/f1_ci": {}, "micro/recall": 0.616, "micro/precision": 0.6574172892209178, "macro/f1": 0.5912051787344677, "macro/f1_ci": {}, "macro/recall": 0.5716765665918595, "macro/precision": 0.6145258341593257, "per_entity_metric": {"corporation": {"f1": 0.5235602094240838, "f1_ci": {}, "precision": 0.5617977528089888, "recall": 0.49019607843137253}, "creative_work": {"f1": 0.5, "f1_ci": {}, "precision": 0.48717948717948717, "recall": 0.5135135135135135}, "event": {"f1": 0.35684647302904565, "f1_ci": {}, "precision": 0.39090909090909093, "recall": 0.3282442748091603}, "group": {"f1": 0.627906976744186, "f1_ci": {}, "precision": 0.6650246305418719, "recall": 0.5947136563876652}, "location": {"f1": 0.6818181818181818, "f1_ci": {}, "precision": 0.75, "recall": 0.625}, "person": {"f1": 0.8301225919439579, "f1_ci": {}, "precision": 0.8229166666666666, "recall": 0.8374558303886925}, "product": {"f1": 0.6181818181818182, "f1_ci": {}, "precision": 0.6238532110091743, "recall": 0.6126126126126126}}}, "2021.test": {"micro/f1": 0.6404513989878424, "micro/f1_ci": {"90": [0.6310532748860292, 0.6500710194412829], "95": [0.6296658889111393, 0.6521427599284435]}, "micro/recall": 0.6365633672525439, "micro/precision": 0.6443872176050568, "macro/f1": 0.5910583983096561, "macro/f1_ci": {"90": [0.5809463231552521, 0.6010049606712689], "95": [0.5788166178408317, 0.6032882856914171]}, "macro/recall": 0.5900571634271187, "macro/precision": 0.5928837696021392, "per_entity_metric": {"corporation": {"f1": 0.5058236272878537, "f1_ci": {"90": [0.48221203045637623, 0.5303888996856597], "95": [0.4768192669028184, 0.5361739312316256]}, "precision": 0.5049833887043189, "recall": 0.5066666666666667}, "creative_work": {"f1": 0.43911917098445596, "f1_ci": {"90": [0.4088519263305804, 0.4698779572211306], "95": [0.4033908658729188, 0.47548628801170667]}, "precision": 0.41697416974169743, "recall": 0.4637482900136799}, "event": {"f1": 0.46597353497164457, "f1_ci": {"90": [0.4414376523975732, 0.48765845692109383], "95": [0.4374048509297999, 0.49298079426045754]}, "precision": 0.48475909537856443, "recall": 0.44858962693357596}, "group": {"f1": 0.6068318821165438, "f1_ci": {"90": [0.5857613197870366, 0.6284661621519472], "95": [0.5822767750520318, 0.6337291179191381]}, "precision": 0.6171662125340599, "recall": 0.5968379446640316}, "location": {"f1": 0.6398910823689584, "f1_ci": {"90": [0.61063908109445, 0.6675512121611009], "95": [0.6064278122897154, 0.6741361629127748]}, "precision": 0.6241699867197875, "recall": 0.6564245810055865}, "person": {"f1": 0.8267511177347244, "f1_ci": {"90": [0.8157005907020787, 0.8380098885018492], "95": [0.8137865601171665, 0.8400948145156062]}, "precision": 0.8354668674698795, "recall": 0.8182153392330384}, "product": {"f1": 0.6530183727034121, "f1_ci": {"90": [0.6302189400687924, 0.6751343003974581], "95": [0.6264020156559537, 0.6791711660773018]}, "precision": 0.6666666666666666, "recall": 0.6399176954732511}}}, "2020.test": {"micro/f1": 0.6335644937586686, "micro/f1_ci": {"90": [0.6120421464705215, 0.6525076828761172], "95": [0.6086564713285258, 0.6559915040520051]}, "micro/recall": 0.5926310326933056, "micro/precision": 0.6805721096543504, "macro/f1": 0.5914520478690088, "macro/f1_ci": {"90": [0.5672890790149243, 0.6111046076343697], "95": [0.5631922824822733, 0.615969012049981]}, "macro/recall": 0.5535477989961968, "macro/precision": 0.6370623744887871, "per_entity_metric": {"corporation": {"f1": 0.5322128851540617, "f1_ci": {"90": [0.4679528605099636, 0.5855111633372503], "95": [0.45919247230614296, 0.5964937200956938]}, "precision": 0.572289156626506, "recall": 0.4973821989528796}, "creative_work": {"f1": 0.4941176470588235, "f1_ci": {"90": [0.4324237140366173, 0.5483963133640553], "95": [0.4233767507552276, 0.5575498000792478]}, "precision": 0.5217391304347826, "recall": 0.4692737430167598}, "event": {"f1": 0.46613545816733065, "f1_ci": {"90": [0.41300613255759094, 0.5199418408061135], "95": [0.40350089295094027, 0.5281582054309327]}, "precision": 0.4936708860759494, "recall": 0.44150943396226416}, "group": {"f1": 0.5464684014869888, "f1_ci": {"90": [0.4933666798613359, 0.5976370403789758], "95": [0.4788116130430073, 0.610861672409387]}, "precision": 0.6475770925110133, "recall": 0.47266881028938906}, "location": {"f1": 0.63125, "f1_ci": {"90": [0.5671345820472707, 0.6885394482690307], "95": [0.5551672761749965, 0.7014767828550316]}, "precision": 0.6516129032258065, "recall": 0.6121212121212121}, "person": {"f1": 0.81326352530541, "f1_ci": {"90": [0.7841960889038811, 0.8395792418896547], "95": [0.7788274499501572, 0.8438129923423588]}, "precision": 0.8472727272727273, "recall": 0.7818791946308725}, "product": {"f1": 0.6567164179104477, "f1_ci": {"90": [0.6008587786259542, 0.7132317854013615], "95": [0.5929074717150218, 0.7208718442447583]}, "precision": 0.7252747252747253, "recall": 0.6}}}, "2021.test (span detection)": {"micro/f1": 0.7770796974985457, "micro/f1_ci": {}, "micro/recall": 0.7724066150109865, "micro/precision": 0.7818096687346365, "macro/f1": 0.7770796974985457, "macro/f1_ci": {}, "macro/recall": 0.7724066150109865, "macro/precision": 0.7818096687346365}, "2020.test (span detection)": {"micro/f1": 0.7436182019977802, "micro/f1_ci": {}, "micro/recall": 0.6953814218993254, "micro/precision": 0.7990459153249851, "macro/f1": 0.7436182019977802, "macro/f1_ci": {}, "macro/recall": 0.6953814218993254, "macro/precision": 0.7990459153249851}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6335644937586686, "micro/f1_ci": {"90": [0.6120421464705215, 0.6525076828761172], "95": [0.6086564713285258, 0.6559915040520051]}, "micro/recall": 0.5926310326933056, "micro/precision": 0.6805721096543504, "macro/f1": 0.5914520478690088, "macro/f1_ci": {"90": [0.5672890790149243, 0.6111046076343697], "95": [0.5631922824822733, 0.615969012049981]}, "macro/recall": 0.5535477989961968, "macro/precision": 0.6370623744887871, "per_entity_metric": {"corporation": {"f1": 0.5322128851540617, "f1_ci": {"90": [0.4679528605099636, 0.5855111633372503], "95": [0.45919247230614296, 0.5964937200956938]}, "precision": 0.572289156626506, "recall": 0.4973821989528796}, "creative_work": {"f1": 0.4941176470588235, "f1_ci": {"90": [0.4324237140366173, 0.5483963133640553], "95": [0.4233767507552276, 0.5575498000792478]}, "precision": 0.5217391304347826, "recall": 0.4692737430167598}, "event": {"f1": 0.46613545816733065, "f1_ci": {"90": [0.41300613255759094, 0.5199418408061135], "95": [0.40350089295094027, 0.5281582054309327]}, "precision": 0.4936708860759494, "recall": 0.44150943396226416}, "group": {"f1": 0.5464684014869888, "f1_ci": {"90": [0.4933666798613359, 0.5976370403789758], "95": [0.4788116130430073, 0.610861672409387]}, "precision": 0.6475770925110133, "recall": 0.47266881028938906}, "location": {"f1": 0.63125, "f1_ci": {"90": [0.5671345820472707, 0.6885394482690307], "95": [0.5551672761749965, 0.7014767828550316]}, "precision": 0.6516129032258065, "recall": 0.6121212121212121}, "person": {"f1": 0.81326352530541, "f1_ci": {"90": [0.7841960889038811, 0.8395792418896547], "95": [0.7788274499501572, 0.8438129923423588]}, "precision": 0.8472727272727273, "recall": 0.7818791946308725}, "product": {"f1": 0.6567164179104477, "f1_ci": {"90": [0.6008587786259542, 0.7132317854013615], "95": [0.5929074717150218, 0.7208718442447583]}, "precision": 0.7252747252747253, "recall": 0.6}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6404513989878424, "micro/f1_ci": {"90": [0.6310532748860292, 0.6500710194412829], "95": [0.6296658889111393, 0.6521427599284435]}, "micro/recall": 0.6365633672525439, "micro/precision": 0.6443872176050568, "macro/f1": 0.5910583983096561, "macro/f1_ci": {"90": [0.5809463231552521, 0.6010049606712689], "95": [0.5788166178408317, 0.6032882856914171]}, "macro/recall": 0.5900571634271187, "macro/precision": 0.5928837696021392, "per_entity_metric": {"corporation": {"f1": 0.5058236272878537, "f1_ci": {"90": [0.48221203045637623, 0.5303888996856597], "95": [0.4768192669028184, 0.5361739312316256]}, "precision": 0.5049833887043189, "recall": 0.5066666666666667}, "creative_work": {"f1": 0.43911917098445596, "f1_ci": {"90": [0.4088519263305804, 0.4698779572211306], "95": [0.4033908658729188, 0.47548628801170667]}, "precision": 0.41697416974169743, "recall": 0.4637482900136799}, "event": {"f1": 0.46597353497164457, "f1_ci": {"90": [0.4414376523975732, 0.48765845692109383], "95": [0.4374048509297999, 0.49298079426045754]}, "precision": 0.48475909537856443, "recall": 0.44858962693357596}, "group": {"f1": 0.6068318821165438, "f1_ci": {"90": [0.5857613197870366, 0.6284661621519472], "95": [0.5822767750520318, 0.6337291179191381]}, "precision": 0.6171662125340599, "recall": 0.5968379446640316}, "location": {"f1": 0.6398910823689584, "f1_ci": {"90": [0.61063908109445, 0.6675512121611009], "95": [0.6064278122897154, 0.6741361629127748]}, "precision": 0.6241699867197875, "recall": 0.6564245810055865}, "person": {"f1": 0.8267511177347244, "f1_ci": {"90": [0.8157005907020787, 0.8380098885018492], "95": [0.8137865601171665, 0.8400948145156062]}, "precision": 0.8354668674698795, "recall": 0.8182153392330384}, "product": {"f1": 0.6530183727034121, "f1_ci": {"90": [0.6302189400687924, 0.6751343003974581], "95": [0.6264020156559537, 0.6791711660773018]}, "precision": 0.6666666666666666, "recall": 0.6399176954732511}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7436182019977802, "micro/f1_ci": {}, "micro/recall": 0.6953814218993254, "micro/precision": 0.7990459153249851, "macro/f1": 0.7436182019977802, "macro/f1_ci": {}, "macro/recall": 0.6953814218993254, "macro/precision": 0.7990459153249851}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7770796974985457, "micro/f1_ci": {}, "micro/recall": 0.7724066150109865, "micro/precision": 0.7818096687346365, "macro/f1": 0.7770796974985457, "macro/f1_ci": {}, "macro/recall": 0.7724066150109865, "macro/precision": 0.7818096687346365}
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": "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_2021", "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}