asahi417 commited on
Commit
12b9b3b
1 Parent(s): 7bce251

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-base-tweetner7-2020-2021-continuous
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.6547126972113873
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6592801031773947
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6502081406105458
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6000787312274737
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.603865779286349
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5992466120658141
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7809734513274336
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7863758940086762
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7756447322770903
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.651460361613352
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.7020383693045563
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6076803321224702
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6081745135588633
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6574828031156369
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5706180236424009
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7504867872044506
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8087529976019184
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7000518941359626
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-base-tweetner7-2020-2021-continuous
88
+
89
+ This model is a fine-tuned version of [tner/roberta-base-tweetner-2020](https://huggingface.co/tner/roberta-base-tweetner-2020) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_2021` split). The model is first fine-tuned on `train_2020`, and then continuously fine-tuned on `train_2021`.
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.6547126972113873
94
+ - Precision (micro): 0.6592801031773947
95
+ - Recall (micro): 0.6502081406105458
96
+ - F1 (macro): 0.6000787312274737
97
+ - Precision (macro): 0.603865779286349
98
+ - Recall (macro): 0.5992466120658141
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.509673852957435
104
+ - creative_work: 0.41677588466579296
105
+ - event: 0.4675062972292191
106
+ - group: 0.6152256286600069
107
+ - location: 0.6798159105851413
108
+ - person: 0.8448868778280542
109
+ - product: 0.6666666666666667
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6458722707634147, 0.6637540527089854]
114
+ - 95%: [0.6443720180740024, 0.6654476640585366]
115
+ - F1 (macro):
116
+ - 90%: [0.6458722707634147, 0.6637540527089854]
117
+ - 95%: [0.6443720180740024, 0.6654476640585366]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-base-tweetner7-2020-2021-continuous/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/roberta-base-tweetner7-2020-2021-continuous/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-base-tweetner7-2020-2021-continuous")
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: tner/roberta-base-tweetner-2020
143
+ - crf: True
144
+ - max_length: 128
145
+ - epoch: 30
146
+ - batch_size: 32
147
+ - lr: 1e-06
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-base-tweetner7-2020-2021-continuous/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.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.651460361613352, "micro/f1_ci": {"90": [0.6305997364833857, 0.6695794736812504], "95": [0.6269839088527567, 0.6749042831834553]}, "micro/recall": 0.6076803321224702, "micro/precision": 0.7020383693045563, "macro/f1": 0.6081745135588633, "macro/f1_ci": {"90": [0.5854739740621966, 0.6281268906531955], "95": [0.581483892413636, 0.6343555010851516]}, "macro/recall": 0.5706180236424009, "macro/precision": 0.6574828031156369, "per_entity_metric": {"corporation": {"f1": 0.5804749340369394, "f1_ci": {"90": [0.5156140581232493, 0.6325686506372356], "95": [0.5058044742163802, 0.6415385361594802]}, "precision": 0.5851063829787234, "recall": 0.5759162303664922}, "creative_work": {"f1": 0.49853372434017595, "f1_ci": {"90": [0.4344938384299407, 0.5531050547402748], "95": [0.42452631578947353, 0.5626611469938013]}, "precision": 0.5246913580246914, "recall": 0.4748603351955307}, "event": {"f1": 0.4473684210526316, "f1_ci": {"90": [0.39322736633500616, 0.5023485303606792], "95": [0.38337182448036955, 0.511726656523523]}, "precision": 0.5340314136125655, "recall": 0.3849056603773585}, "group": {"f1": 0.560460652591171, "f1_ci": {"90": [0.5110098560700875, 0.608893264449275], "95": [0.5010438972162741, 0.6203138617664004]}, "precision": 0.6952380952380952, "recall": 0.4694533762057878}, "location": {"f1": 0.6707692307692309, "f1_ci": {"90": [0.6067931688804554, 0.7277823315118398], "95": [0.5954828423929547, 0.7365481158894334]}, "precision": 0.68125, "recall": 0.6606060606060606}, "person": {"f1": 0.8263473053892216, "f1_ci": {"90": [0.7996677782129142, 0.8497937470551579], "95": [0.7938117295076058, 0.856165669034084]}, "precision": 0.8429319371727748, "recall": 0.8104026845637584}, "product": {"f1": 0.6732673267326733, "f1_ci": {"90": [0.6195010523709298, 0.7234149470758046], "95": [0.6084558684914979, 0.7323297582567245]}, "precision": 0.7391304347826086, "recall": 0.6181818181818182}}}
eval/{metric.json → metric.test_2021.json} RENAMED
@@ -1 +1 @@
1
- {"2021.dev": {"micro/f1": 0.6488706365503081, "micro/f1_ci": {}, "micro/recall": 0.632, "micro/precision": 0.6666666666666666, "macro/f1": 0.5997203254958251, "macro/f1_ci": {}, "macro/recall": 0.5869343642573417, "macro/precision": 0.618503242002026, "per_entity_metric": {"corporation": {"f1": 0.5645933014354066, "f1_ci": {}, "precision": 0.5514018691588785, "recall": 0.5784313725490197}, "creative_work": {"f1": 0.44295302013422816, "f1_ci": {}, "precision": 0.44, "recall": 0.44594594594594594}, "event": {"f1": 0.415929203539823, "f1_ci": {}, "precision": 0.49473684210526314, "recall": 0.35877862595419846}, "group": {"f1": 0.6372093023255814, "f1_ci": {}, "precision": 0.6748768472906403, "recall": 0.6035242290748899}, "location": {"f1": 0.6486486486486486, "f1_ci": {}, "precision": 0.631578947368421, "recall": 0.6666666666666666}, "person": {"f1": 0.8253424657534247, "f1_ci": {}, "precision": 0.8006644518272426, "recall": 0.8515901060070671}, "product": {"f1": 0.6633663366336634, "f1_ci": {}, "precision": 0.7362637362637363, "recall": 0.6036036036036037}}}, "2021.test": {"micro/f1": 0.6547126972113873, "micro/f1_ci": {"90": [0.6458722707634147, 0.6637540527089854], "95": [0.6443720180740024, 0.6654476640585366]}, "micro/recall": 0.6502081406105458, "micro/precision": 0.6592801031773947, "macro/f1": 0.6000787312274737, "macro/f1_ci": {"90": [0.5905237241709625, 0.6095507771622684], "95": [0.5885881380317086, 0.6113013659787363]}, "macro/recall": 0.5992466120658141, "macro/precision": 0.603865779286349, "per_entity_metric": {"corporation": {"f1": 0.509673852957435, "f1_ci": {"90": [0.484179870421451, 0.5353061422313796], "95": [0.47824814173709396, 0.5405723393787932]}, "precision": 0.5071507150715071, "recall": 0.5122222222222222}, "creative_work": {"f1": 0.41677588466579296, "f1_ci": {"90": [0.3865633906408017, 0.44653977444332704], "95": [0.37910324725354655, 0.4510138162184456]}, "precision": 0.4, "recall": 0.43502051983584133}, "event": {"f1": 0.4675062972292191, "f1_ci": {"90": [0.4432285719295966, 0.49052772395711874], "95": [0.4381138582657509, 0.49466101670892687]}, "precision": 0.5237020316027088, "recall": 0.4222020018198362}, "group": {"f1": 0.6152256286600069, "f1_ci": {"90": [0.5945103130246991, 0.6374704452133914], "95": [0.5902147083464299, 0.6407439785680712]}, "precision": 0.6447653429602888, "recall": 0.5882740447957839}, "location": {"f1": 0.6798159105851413, "f1_ci": {"90": [0.6515954195494981, 0.7065228684260313], "95": [0.646596286962582, 0.7124493642560418]}, "precision": 0.6422360248447205, "recall": 0.7220670391061452}, "person": {"f1": 0.8448868778280542, "f1_ci": {"90": [0.8343973181095194, 0.8549887043226098], "95": [0.8319527490533347, 0.8570455559167381]}, "precision": 0.8297191610380377, "recall": 0.8606194690265486}, "product": {"f1": 0.6666666666666667, "f1_ci": {"90": [0.6452512118485499, 0.6877656402687181], "95": [0.6405735428551591, 0.6908174750739359]}, "precision": 0.6794871794871795, "recall": 0.654320987654321}}}, "2020.test": {"micro/f1": 0.651460361613352, "micro/f1_ci": {"90": [0.6305997364833857, 0.6695794736812504], "95": [0.6269839088527567, 0.6749042831834553]}, "micro/recall": 0.6076803321224702, "micro/precision": 0.7020383693045563, "macro/f1": 0.6081745135588633, "macro/f1_ci": {"90": [0.5854739740621966, 0.6281268906531955], "95": [0.581483892413636, 0.6343555010851516]}, "macro/recall": 0.5706180236424009, "macro/precision": 0.6574828031156369, "per_entity_metric": {"corporation": {"f1": 0.5804749340369394, "f1_ci": {"90": [0.5156140581232493, 0.6325686506372356], "95": [0.5058044742163802, 0.6415385361594802]}, "precision": 0.5851063829787234, "recall": 0.5759162303664922}, "creative_work": {"f1": 0.49853372434017595, "f1_ci": {"90": [0.4344938384299407, 0.5531050547402748], "95": [0.42452631578947353, 0.5626611469938013]}, "precision": 0.5246913580246914, "recall": 0.4748603351955307}, "event": {"f1": 0.4473684210526316, "f1_ci": {"90": [0.39322736633500616, 0.5023485303606792], "95": [0.38337182448036955, 0.511726656523523]}, "precision": 0.5340314136125655, "recall": 0.3849056603773585}, "group": {"f1": 0.560460652591171, "f1_ci": {"90": [0.5110098560700875, 0.608893264449275], "95": [0.5010438972162741, 0.6203138617664004]}, "precision": 0.6952380952380952, "recall": 0.4694533762057878}, "location": {"f1": 0.6707692307692309, "f1_ci": {"90": [0.6067931688804554, 0.7277823315118398], "95": [0.5954828423929547, 0.7365481158894334]}, "precision": 0.68125, "recall": 0.6606060606060606}, "person": {"f1": 0.8263473053892216, "f1_ci": {"90": [0.7996677782129142, 0.8497937470551579], "95": [0.7938117295076058, 0.856165669034084]}, "precision": 0.8429319371727748, "recall": 0.8104026845637584}, "product": {"f1": 0.6732673267326733, "f1_ci": {"90": [0.6195010523709298, 0.7234149470758046], "95": [0.6084558684914979, 0.7323297582567245]}, "precision": 0.7391304347826086, "recall": 0.6181818181818182}}}, "2021.test (span detection)": {"micro/f1": 0.7809734513274336, "micro/f1_ci": {}, "micro/recall": 0.7756447322770903, "micro/precision": 0.7863758940086762, "macro/f1": 0.7809734513274336, "macro/f1_ci": {}, "macro/recall": 0.7756447322770903, "macro/precision": 0.7863758940086762}, "2020.test (span detection)": {"micro/f1": 0.7504867872044506, "micro/f1_ci": {}, "micro/recall": 0.7000518941359626, "micro/precision": 0.8087529976019184, "macro/f1": 0.7504867872044506, "macro/f1_ci": {}, "macro/recall": 0.7000518941359626, "macro/precision": 0.8087529976019184}}
 
1
+ {"micro/f1": 0.6547126972113873, "micro/f1_ci": {"90": [0.6458722707634147, 0.6637540527089854], "95": [0.6443720180740024, 0.6654476640585366]}, "micro/recall": 0.6502081406105458, "micro/precision": 0.6592801031773947, "macro/f1": 0.6000787312274737, "macro/f1_ci": {"90": [0.5905237241709625, 0.6095507771622684], "95": [0.5885881380317086, 0.6113013659787363]}, "macro/recall": 0.5992466120658141, "macro/precision": 0.603865779286349, "per_entity_metric": {"corporation": {"f1": 0.509673852957435, "f1_ci": {"90": [0.484179870421451, 0.5353061422313796], "95": [0.47824814173709396, 0.5405723393787932]}, "precision": 0.5071507150715071, "recall": 0.5122222222222222}, "creative_work": {"f1": 0.41677588466579296, "f1_ci": {"90": [0.3865633906408017, 0.44653977444332704], "95": [0.37910324725354655, 0.4510138162184456]}, "precision": 0.4, "recall": 0.43502051983584133}, "event": {"f1": 0.4675062972292191, "f1_ci": {"90": [0.4432285719295966, 0.49052772395711874], "95": [0.4381138582657509, 0.49466101670892687]}, "precision": 0.5237020316027088, "recall": 0.4222020018198362}, "group": {"f1": 0.6152256286600069, "f1_ci": {"90": [0.5945103130246991, 0.6374704452133914], "95": [0.5902147083464299, 0.6407439785680712]}, "precision": 0.6447653429602888, "recall": 0.5882740447957839}, "location": {"f1": 0.6798159105851413, "f1_ci": {"90": [0.6515954195494981, 0.7065228684260313], "95": [0.646596286962582, 0.7124493642560418]}, "precision": 0.6422360248447205, "recall": 0.7220670391061452}, "person": {"f1": 0.8448868778280542, "f1_ci": {"90": [0.8343973181095194, 0.8549887043226098], "95": [0.8319527490533347, 0.8570455559167381]}, "precision": 0.8297191610380377, "recall": 0.8606194690265486}, "product": {"f1": 0.6666666666666667, "f1_ci": {"90": [0.6452512118485499, 0.6877656402687181], "95": [0.6405735428551591, 0.6908174750739359]}, "precision": 0.6794871794871795, "recall": 0.654320987654321}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7504867872044506, "micro/f1_ci": {}, "micro/recall": 0.7000518941359626, "micro/precision": 0.8087529976019184, "macro/f1": 0.7504867872044506, "macro/f1_ci": {}, "macro/recall": 0.7000518941359626, "macro/precision": 0.8087529976019184}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7809734513274336, "micro/f1_ci": {}, "micro/recall": 0.7756447322770903, "micro/precision": 0.7863758940086762, "macro/f1": 0.7809734513274336, "macro/f1_ci": {}, "macro/recall": 0.7756447322770903, "macro/precision": 0.7863758940086762}
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": "tner/roberta-base-tweetner-2020", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 1e-06, "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": "tner/roberta-base-tweetner-2020", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 1e-06, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.15, "max_grad_norm": 1}