asahi417 commited on
Commit
339baee
1 Parent(s): 374d6ad

model update

Browse files
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-2020-selflabel2021-concat
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.6451758087201125
22
+ - name: Precision (test_2021)
23
+ type: precision
24
+ value: 0.6282458639202366
25
+ - name: Recall (test_2021)
26
+ type: recall
27
+ value: 0.6630434782608695
28
+ - name: Macro F1 (test_2021)
29
+ type: f1_macro
30
+ value: 0.5945137835095485
31
+ - name: Macro Precision (test_2021)
32
+ type: precision_macro
33
+ value: 0.5791991181065553
34
+ - name: Macro Recall (test_2021)
35
+ type: recall_macro
36
+ value: 0.6195808065595296
37
+ - name: Entity Span F1 (test_2021)
38
+ type: f1_entity_span
39
+ value: 0.7849668054461573
40
+ - name: Entity Span Precision (test_2020)
41
+ type: precision_entity_span
42
+ value: 0.7643256272597787
43
+ - name: Entity Span Recall (test_2021)
44
+ type: recall_entity_span
45
+ value: 0.8067537874407309
46
+ - name: F1 (test_2020)
47
+ type: f1
48
+ value: 0.6605206073752712
49
+ - name: Precision (test_2020)
50
+ type: precision
51
+ value: 0.6916524701873935
52
+ - name: Recall (test_2020)
53
+ type: recall
54
+ value: 0.6320705760249092
55
+ - name: Macro F1 (test_2020)
56
+ type: f1_macro
57
+ value: 0.6182768841282975
58
+ - name: Macro Precision (test_2020)
59
+ type: precision_macro
60
+ value: 0.646958757311601
61
+ - name: Macro Recall (test_2020)
62
+ type: recall_macro
63
+ value: 0.600022393469146
64
+ - name: Entity Span F1 (test_2020)
65
+ type: f1_entity_span
66
+ value: 0.769397721106891
67
+ - name: Entity Span Precision (test_2020)
68
+ type: precision_entity_span
69
+ value: 0.8061398521887436
70
+ - name: Entity Span Recall (test_2020)
71
+ type: recall_entity_span
72
+ value: 0.7358588479501816
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-2020-selflabel2021-concat
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.6451758087201125
86
+ - Precision (micro): 0.6282458639202366
87
+ - Recall (micro): 0.6630434782608695
88
+ - F1 (macro): 0.5945137835095485
89
+ - Precision (macro): 0.5791991181065553
90
+ - Recall (macro): 0.6195808065595296
91
+
92
+
93
+
94
+ The per-entity breakdown of the F1 score on the test set are below:
95
+ - corporation: 0.5067218200620476
96
+ - creative_work: 0.45376220562894887
97
+ - event: 0.4452749599572877
98
+ - group: 0.6063348416289593
99
+ - location: 0.6619263089851325
100
+ - person: 0.835890955046037
101
+ - product: 0.651685393258427
102
+
103
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
104
+ - F1 (micro):
105
+ - 90%: [0.6360452531843157, 0.6546242674951402]
106
+ - 95%: [0.6344128889037165, 0.6562435584441533]
107
+ - F1 (macro):
108
+ - 90%: [0.6360452531843157, 0.6546242674951402]
109
+ - 95%: [0.6344128889037165, 0.6562435584441533]
110
+
111
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-tweetner7-2020-selflabel2021-concat/raw/main/eval/metric.json)
112
+ and [metric file of entity span](https://huggingface.co/tner/roberta-large-tweetner7-2020-selflabel2021-concat/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-2020-selflabel2021-concat")
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/2020_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.3
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-2020-selflabel2021-concat/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.json DELETED
@@ -1 +0,0 @@
1
- {"2020.dev": {"micro/f1": 0.6461038961038961, "micro/f1_ci": {}, "micro/recall": 0.6238244514106583, "micro/precision": 0.67003367003367, "macro/f1": 0.587322338466695, "macro/f1_ci": {}, "macro/recall": 0.5756381956969621, "macro/precision": 0.6090469200966296, "per_entity_metric": {"corporation": {"f1": 0.484375, "f1_ci": {}, "precision": 0.5138121546961326, "recall": 0.458128078817734}, "creative_work": {"f1": 0.511520737327189, "f1_ci": {}, "precision": 0.4911504424778761, "recall": 0.5336538461538461}, "event": {"f1": 0.38613861386138615, "f1_ci": {}, "precision": 0.527027027027027, "recall": 0.3046875}, "group": {"f1": 0.5733333333333334, "f1_ci": {}, "precision": 0.57847533632287, "recall": 0.5682819383259912}, "location": {"f1": 0.640625, "f1_ci": {}, "precision": 0.6059113300492611, "recall": 0.6795580110497238}, "person": {"f1": 0.8709122203098106, "f1_ci": {}, "precision": 0.8971631205673759, "recall": 0.8461538461538461}, "product": {"f1": 0.6443514644351463, "f1_ci": {}, "precision": 0.6497890295358649, "recall": 0.6390041493775933}}}, "2021.test": {"micro/f1": 0.6451758087201125, "micro/f1_ci": {"90": [0.6360452531843157, 0.6546242674951402], "95": [0.6344128889037165, 0.6562435584441533]}, "micro/recall": 0.6630434782608695, "micro/precision": 0.6282458639202366, "macro/f1": 0.5945137835095485, "macro/f1_ci": {"90": [0.5849625646474219, 0.6048099476423717], "95": [0.5832263131312113, 0.6064180014512437]}, "macro/recall": 0.6195808065595296, "macro/precision": 0.5791991181065553, "per_entity_metric": {"corporation": {"f1": 0.5067218200620476, "f1_ci": {"90": [0.482720115378613, 0.5318353967881462], "95": [0.4796950147983722, 0.5369819879159188]}, "precision": 0.4738878143133462, "recall": 0.5444444444444444}, "creative_work": {"f1": 0.45376220562894887, "f1_ci": {"90": [0.42664800694587557, 0.48082929944314123], "95": [0.42158048043728424, 0.4846494398622172]}, "precision": 0.3910891089108911, "recall": 0.5403556771545828}, "event": {"f1": 0.4452749599572877, "f1_ci": {"90": [0.41903187721369545, 0.4705294264916067], "95": [0.41504947523868935, 0.4746242629321899]}, "precision": 0.5387596899224806, "recall": 0.3794358507734304}, "group": {"f1": 0.6063348416289593, "f1_ci": {"90": [0.5861107400130976, 0.6279132370043825], "95": [0.5830224656689539, 0.6322202313625416]}, "precision": 0.5951776649746193, "recall": 0.6179183135704874}, "location": {"f1": 0.6619263089851325, "f1_ci": {"90": [0.6324935407210904, 0.6882328863476124], "95": [0.6253949479866915, 0.6927306998069366]}, "precision": 0.6161251504211793, "recall": 0.7150837988826816}, "person": {"f1": 0.835890955046037, "f1_ci": {"90": [0.8259559078534311, 0.8463653140397381], "95": [0.8236693872632049, 0.848508779376511]}, "precision": 0.8188892819243013, "recall": 0.8536135693215339}, "product": {"f1": 0.651685393258427, "f1_ci": {"90": [0.6290720140515222, 0.6729078211863003], "95": [0.6251710926532523, 0.6767235821801794]}, "precision": 0.6204651162790698, "recall": 0.6862139917695473}}}, "2020.test": {"micro/f1": 0.6605206073752712, "micro/f1_ci": {"90": [0.6408255159753993, 0.6793274637933173], "95": [0.6373893291997992, 0.6825239933971441]}, "micro/recall": 0.6320705760249092, "micro/precision": 0.6916524701873935, "macro/f1": 0.6182768841282975, "macro/f1_ci": {"90": [0.5961031178968297, 0.6385985065596177], "95": [0.5914673366772406, 0.6421666965178469]}, "macro/recall": 0.600022393469146, "macro/precision": 0.646958757311601, "per_entity_metric": {"corporation": {"f1": 0.5822784810126582, "f1_ci": {"90": [0.5256752905886762, 0.6318421628123121], "95": [0.5128, 0.6414092076062835]}, "precision": 0.5637254901960784, "recall": 0.6020942408376964}, "creative_work": {"f1": 0.5343915343915344, "f1_ci": {"90": [0.476412981770012, 0.588596538853071], "95": [0.4636852685629959, 0.5979764281221802]}, "precision": 0.507537688442211, "recall": 0.5642458100558659}, "event": {"f1": 0.4439252336448598, "f1_ci": {"90": [0.38862436460968, 0.497920986683701], "95": [0.3779821592181615, 0.5074727486164683]}, "precision": 0.5828220858895705, "recall": 0.3584905660377358}, "group": {"f1": 0.597864768683274, "f1_ci": {"90": [0.5551718002208861, 0.6446087202184763], "95": [0.548585759887216, 0.6524932368209403]}, "precision": 0.6693227091633466, "recall": 0.5401929260450161}, "location": {"f1": 0.6808510638297872, "f1_ci": {"90": [0.6142731829573934, 0.743047103899031], "95": [0.6024013007045483, 0.7507189002768739]}, "precision": 0.6829268292682927, "recall": 0.6787878787878788}, "person": {"f1": 0.8343347639484978, "f1_ci": {"90": [0.8076569065611846, 0.8573930598247411], "95": [0.8034319572294566, 0.8639877286061661]}, "precision": 0.8541300527240774, "recall": 0.8154362416107382}, "product": {"f1": 0.6542923433874709, "f1_ci": {"90": [0.6053549332303825, 0.7005813660209848], "95": [0.5979308671922375, 0.7089777612241414]}, "precision": 0.6682464454976303, "recall": 0.6409090909090909}}}, "2021.test (span detection)": {"micro/f1": 0.7849668054461573, "micro/f1_ci": {}, "micro/recall": 0.8067537874407309, "micro/precision": 0.7643256272597787, "macro/f1": 0.7849668054461573, "macro/f1_ci": {}, "macro/recall": 0.8067537874407309, "macro/precision": 0.7643256272597787}, "2020.test (span detection)": {"micro/f1": 0.769397721106891, "micro/f1_ci": {}, "micro/recall": 0.7358588479501816, "micro/precision": 0.8061398521887436, "macro/f1": 0.769397721106891, "macro/f1_ci": {}, "macro/recall": 0.7358588479501816, "macro/precision": 0.8061398521887436}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6605206073752712, "micro/f1_ci": {"90": [0.6408255159753993, 0.6793274637933173], "95": [0.6373893291997992, 0.6825239933971441]}, "micro/recall": 0.6320705760249092, "micro/precision": 0.6916524701873935, "macro/f1": 0.6182768841282975, "macro/f1_ci": {"90": [0.5961031178968297, 0.6385985065596177], "95": [0.5914673366772406, 0.6421666965178469]}, "macro/recall": 0.600022393469146, "macro/precision": 0.646958757311601, "per_entity_metric": {"corporation": {"f1": 0.5822784810126582, "f1_ci": {"90": [0.5256752905886762, 0.6318421628123121], "95": [0.5128, 0.6414092076062835]}, "precision": 0.5637254901960784, "recall": 0.6020942408376964}, "creative_work": {"f1": 0.5343915343915344, "f1_ci": {"90": [0.476412981770012, 0.588596538853071], "95": [0.4636852685629959, 0.5979764281221802]}, "precision": 0.507537688442211, "recall": 0.5642458100558659}, "event": {"f1": 0.4439252336448598, "f1_ci": {"90": [0.38862436460968, 0.497920986683701], "95": [0.3779821592181615, 0.5074727486164683]}, "precision": 0.5828220858895705, "recall": 0.3584905660377358}, "group": {"f1": 0.597864768683274, "f1_ci": {"90": [0.5551718002208861, 0.6446087202184763], "95": [0.548585759887216, 0.6524932368209403]}, "precision": 0.6693227091633466, "recall": 0.5401929260450161}, "location": {"f1": 0.6808510638297872, "f1_ci": {"90": [0.6142731829573934, 0.743047103899031], "95": [0.6024013007045483, 0.7507189002768739]}, "precision": 0.6829268292682927, "recall": 0.6787878787878788}, "person": {"f1": 0.8343347639484978, "f1_ci": {"90": [0.8076569065611846, 0.8573930598247411], "95": [0.8034319572294566, 0.8639877286061661]}, "precision": 0.8541300527240774, "recall": 0.8154362416107382}, "product": {"f1": 0.6542923433874709, "f1_ci": {"90": [0.6053549332303825, 0.7005813660209848], "95": [0.5979308671922375, 0.7089777612241414]}, "precision": 0.6682464454976303, "recall": 0.6409090909090909}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6451758087201125, "micro/f1_ci": {"90": [0.6360452531843157, 0.6546242674951402], "95": [0.6344128889037165, 0.6562435584441533]}, "micro/recall": 0.6630434782608695, "micro/precision": 0.6282458639202366, "macro/f1": 0.5945137835095485, "macro/f1_ci": {"90": [0.5849625646474219, 0.6048099476423717], "95": [0.5832263131312113, 0.6064180014512437]}, "macro/recall": 0.6195808065595296, "macro/precision": 0.5791991181065553, "per_entity_metric": {"corporation": {"f1": 0.5067218200620476, "f1_ci": {"90": [0.482720115378613, 0.5318353967881462], "95": [0.4796950147983722, 0.5369819879159188]}, "precision": 0.4738878143133462, "recall": 0.5444444444444444}, "creative_work": {"f1": 0.45376220562894887, "f1_ci": {"90": [0.42664800694587557, 0.48082929944314123], "95": [0.42158048043728424, 0.4846494398622172]}, "precision": 0.3910891089108911, "recall": 0.5403556771545828}, "event": {"f1": 0.4452749599572877, "f1_ci": {"90": [0.41903187721369545, 0.4705294264916067], "95": [0.41504947523868935, 0.4746242629321899]}, "precision": 0.5387596899224806, "recall": 0.3794358507734304}, "group": {"f1": 0.6063348416289593, "f1_ci": {"90": [0.5861107400130976, 0.6279132370043825], "95": [0.5830224656689539, 0.6322202313625416]}, "precision": 0.5951776649746193, "recall": 0.6179183135704874}, "location": {"f1": 0.6619263089851325, "f1_ci": {"90": [0.6324935407210904, 0.6882328863476124], "95": [0.6253949479866915, 0.6927306998069366]}, "precision": 0.6161251504211793, "recall": 0.7150837988826816}, "person": {"f1": 0.835890955046037, "f1_ci": {"90": [0.8259559078534311, 0.8463653140397381], "95": [0.8236693872632049, 0.848508779376511]}, "precision": 0.8188892819243013, "recall": 0.8536135693215339}, "product": {"f1": 0.651685393258427, "f1_ci": {"90": [0.6290720140515222, 0.6729078211863003], "95": [0.6251710926532523, 0.6767235821801794]}, "precision": 0.6204651162790698, "recall": 0.6862139917695473}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.769397721106891, "micro/f1_ci": {}, "micro/recall": 0.7358588479501816, "micro/precision": 0.8061398521887436, "macro/f1": 0.769397721106891, "macro/f1_ci": {}, "macro/recall": 0.7358588479501816, "macro/precision": 0.8061398521887436}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7849668054461573, "micro/f1_ci": {}, "micro/recall": 0.8067537874407309, "micro/precision": 0.7643256272597787, "macro/f1": 0.7849668054461573, "macro/f1_ci": {}, "macro/recall": 0.8067537874407309, "macro/precision": 0.7643256272597787}
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "2020_2021.extra.roberta-large-2020", "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.3, "max_grad_norm": 1}
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train", "dataset_name": null, "local_dataset": {"train": "tweet_ner/2020_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.3, "max_grad_norm": 1}