asahi417 commited on
Commit
232d0c2
1 Parent(s): 50e9c09

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-2019-90m-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.6323179293083451
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.669727143411354
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.5988667900092507
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5671647388688191
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.6049623231784063
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5439217682783225
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.756898656898657
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.801629380576749
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.716896033306349
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.6190614981055086
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.7061170212765957
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5511157239231966
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.560944714651875
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6527607933480432
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5048039912609852
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7303993004954824
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8331117021276596
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.6502335236118318
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-2019-90m-tweetner7-2021
88
+
89
+ This model is a fine-tuned version of [cardiffnlp/twitter-roberta-base-2019-90m](https://huggingface.co/cardiffnlp/twitter-roberta-base-2019-90m) 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.6323179293083451
94
+ - Precision (micro): 0.669727143411354
95
+ - Recall (micro): 0.5988667900092507
96
+ - F1 (macro): 0.5671647388688191
97
+ - Precision (macro): 0.6049623231784063
98
+ - Recall (macro): 0.5439217682783225
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.4673109721432633
104
+ - creative_work: 0.33124018838304553
105
+ - event: 0.4597107438016529
106
+ - group: 0.5760869565217391
107
+ - location: 0.6441717791411042
108
+ - person: 0.8321060382916053
109
+ - product: 0.6595264937993236
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6233520895930195, 0.6418683671749849]
114
+ - 95%: [0.6212129239683746, 0.6433834953337656]
115
+ - F1 (macro):
116
+ - 90%: [0.6233520895930195, 0.6418683671749849]
117
+ - 95%: [0.6212129239683746, 0.6433834953337656]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-2019-90m-tweetner7-2021/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-2019-90m-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/twitter-roberta-base-2019-90m-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: cardiffnlp/twitter-roberta-base-2019-90m
143
+ - crf: True
144
+ - max_length: 128
145
+ - epoch: 30
146
+ - batch_size: 32
147
+ - lr: 0.0001
148
+ - random_seed: 0
149
+ - gradient_accumulation_steps: 1
150
+ - weight_decay: 1e-07
151
+ - lr_warmup_step_ratio: 0.3
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-2019-90m-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.6266882766072394, "micro/f1_ci": {}, "micro/recall": 0.58, "micro/precision": 0.681551116333725, "macro/f1": 0.5706545991586711, "macro/f1_ci": {}, "macro/recall": 0.531585091469556, "macro/precision": 0.6312766832243282, "per_entity_metric": {"corporation": {"f1": 0.5360824742268041, "f1_ci": {}, "precision": 0.5652173913043478, "recall": 0.5098039215686274}, "creative_work": {"f1": 0.4406779661016949, "f1_ci": {}, "precision": 0.5909090909090909, "recall": 0.35135135135135137}, "event": {"f1": 0.4192139737991266, "f1_ci": {}, "precision": 0.4897959183673469, "recall": 0.366412213740458}, "group": {"f1": 0.6036745406824147, "f1_ci": {}, "precision": 0.7467532467532467, "recall": 0.5066079295154186}, "location": {"f1": 0.5844155844155844, "f1_ci": {}, "precision": 0.5487804878048781, "recall": 0.625}, "person": {"f1": 0.8145580589254766, "f1_ci": {}, "precision": 0.7993197278911565, "recall": 0.8303886925795053}, "product": {"f1": 0.5959595959595959, "f1_ci": {}, "precision": 0.6781609195402298, "recall": 0.5315315315315315}}}, "2021.test": {"micro/f1": 0.6323179293083451, "micro/f1_ci": {"90": [0.6233520895930195, 0.6418683671749849], "95": [0.6212129239683746, 0.6433834953337656]}, "micro/recall": 0.5988667900092507, "micro/precision": 0.669727143411354, "macro/f1": 0.5671647388688191, "macro/f1_ci": {"90": [0.5572399048719903, 0.577247635111665], "95": [0.5553732615109348, 0.5793881693393761]}, "macro/recall": 0.5439217682783225, "macro/precision": 0.6049623231784063, "per_entity_metric": {"corporation": {"f1": 0.4673109721432633, "f1_ci": {"90": [0.44073821638214794, 0.49380346194506486], "95": [0.4345049629782454, 0.5010802868149081]}, "precision": 0.47846332945285214, "recall": 0.45666666666666667}, "creative_work": {"f1": 0.33124018838304553, "f1_ci": {"90": [0.30036395978888, 0.3626835949872128], "95": [0.29519152771518703, 0.3685301988871562]}, "precision": 0.3885819521178637, "recall": 0.28864569083447333}, "event": {"f1": 0.4597107438016529, "f1_ci": {"90": [0.43358831070137327, 0.4834637283006848], "95": [0.429486076821645, 0.48853823770491805]}, "precision": 0.5316606929510155, "recall": 0.4049135577797998}, "group": {"f1": 0.5760869565217391, "f1_ci": {"90": [0.5533624070508728, 0.6002919737979431], "95": [0.5506175388446288, 0.6050261925906731]}, "precision": 0.7013232514177694, "recall": 0.4888010540184453}, "location": {"f1": 0.6441717791411042, "f1_ci": {"90": [0.6165992673657916, 0.6703458808896694], "95": [0.6119444333644128, 0.6748159083550472]}, "precision": 0.574398249452954, "recall": 0.7332402234636871}, "person": {"f1": 0.8321060382916053, "f1_ci": {"90": [0.821677267531769, 0.8427002490386487], "95": [0.8194743155293102, 0.8450823127765467]}, "precision": 0.8308823529411765, "recall": 0.8333333333333334}, "product": {"f1": 0.6595264937993236, "f1_ci": {"90": [0.6365520783180869, 0.6811715301378959], "95": [0.63347027394072, 0.6853053837030515]}, "precision": 0.729426433915212, "recall": 0.6018518518518519}}}, "2020.test": {"micro/f1": 0.6190614981055086, "micro/f1_ci": {"90": [0.5980767583769521, 0.6386591052606013], "95": [0.594361748617247, 0.6421009828807712]}, "micro/recall": 0.5511157239231966, "micro/precision": 0.7061170212765957, "macro/f1": 0.560944714651875, "macro/f1_ci": {"90": [0.5382449708194087, 0.5830707544345507], "95": [0.5329546485473574, 0.5877732547723248]}, "macro/recall": 0.5048039912609852, "macro/precision": 0.6527607933480432, "per_entity_metric": {"corporation": {"f1": 0.48587570621468923, "f1_ci": {"90": [0.4244097956307259, 0.5391095780737103], "95": [0.4135752506857322, 0.5517241379310345]}, "precision": 0.5276073619631901, "recall": 0.450261780104712}, "creative_work": {"f1": 0.4109589041095891, "f1_ci": {"90": [0.34865740740740736, 0.4698943140984992], "95": [0.3368421052631579, 0.4780009260331057]}, "precision": 0.5309734513274337, "recall": 0.33519553072625696}, "event": {"f1": 0.44345898004434586, "f1_ci": {"90": [0.38608838826019914, 0.49776446992488316], "95": [0.3770863852083504, 0.5061822739770339]}, "precision": 0.5376344086021505, "recall": 0.37735849056603776}, "group": {"f1": 0.4956896551724138, "f1_ci": {"90": [0.43870042305658385, 0.5517481398511882], "95": [0.42508749495221426, 0.5630294024483409]}, "precision": 0.7516339869281046, "recall": 0.36977491961414793}, "location": {"f1": 0.6416184971098265, "f1_ci": {"90": [0.5747673429813478, 0.7], "95": [0.5628215866937897, 0.7102204062256282]}, "precision": 0.6132596685082873, "recall": 0.6727272727272727}, "person": {"f1": 0.8230165649520488, "f1_ci": {"90": [0.7955670228304957, 0.8472247474747475], "95": [0.7889798131252806, 0.8509595090840202]}, "precision": 0.8566243194192378, "recall": 0.7919463087248322}, "product": {"f1": 0.6259946949602122, "f1_ci": {"90": [0.5654336444343274, 0.6793460715738638], "95": [0.5555480682839173, 0.6876914070924608]}, "precision": 0.7515923566878981, "recall": 0.5363636363636364}}}, "2021.test (span detection)": {"micro/f1": 0.756898656898657, "micro/f1_ci": {}, "micro/recall": 0.716896033306349, "micro/precision": 0.801629380576749, "macro/f1": 0.756898656898657, "macro/f1_ci": {}, "macro/recall": 0.716896033306349, "macro/precision": 0.801629380576749}, "2020.test (span detection)": {"micro/f1": 0.7303993004954824, "micro/f1_ci": {}, "micro/recall": 0.6502335236118318, "micro/precision": 0.8331117021276596, "macro/f1": 0.7303993004954824, "macro/f1_ci": {}, "macro/recall": 0.6502335236118318, "macro/precision": 0.8331117021276596}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6190614981055086, "micro/f1_ci": {"90": [0.5980767583769521, 0.6386591052606013], "95": [0.594361748617247, 0.6421009828807712]}, "micro/recall": 0.5511157239231966, "micro/precision": 0.7061170212765957, "macro/f1": 0.560944714651875, "macro/f1_ci": {"90": [0.5382449708194087, 0.5830707544345507], "95": [0.5329546485473574, 0.5877732547723248]}, "macro/recall": 0.5048039912609852, "macro/precision": 0.6527607933480432, "per_entity_metric": {"corporation": {"f1": 0.48587570621468923, "f1_ci": {"90": [0.4244097956307259, 0.5391095780737103], "95": [0.4135752506857322, 0.5517241379310345]}, "precision": 0.5276073619631901, "recall": 0.450261780104712}, "creative_work": {"f1": 0.4109589041095891, "f1_ci": {"90": [0.34865740740740736, 0.4698943140984992], "95": [0.3368421052631579, 0.4780009260331057]}, "precision": 0.5309734513274337, "recall": 0.33519553072625696}, "event": {"f1": 0.44345898004434586, "f1_ci": {"90": [0.38608838826019914, 0.49776446992488316], "95": [0.3770863852083504, 0.5061822739770339]}, "precision": 0.5376344086021505, "recall": 0.37735849056603776}, "group": {"f1": 0.4956896551724138, "f1_ci": {"90": [0.43870042305658385, 0.5517481398511882], "95": [0.42508749495221426, 0.5630294024483409]}, "precision": 0.7516339869281046, "recall": 0.36977491961414793}, "location": {"f1": 0.6416184971098265, "f1_ci": {"90": [0.5747673429813478, 0.7], "95": [0.5628215866937897, 0.7102204062256282]}, "precision": 0.6132596685082873, "recall": 0.6727272727272727}, "person": {"f1": 0.8230165649520488, "f1_ci": {"90": [0.7955670228304957, 0.8472247474747475], "95": [0.7889798131252806, 0.8509595090840202]}, "precision": 0.8566243194192378, "recall": 0.7919463087248322}, "product": {"f1": 0.6259946949602122, "f1_ci": {"90": [0.5654336444343274, 0.6793460715738638], "95": [0.5555480682839173, 0.6876914070924608]}, "precision": 0.7515923566878981, "recall": 0.5363636363636364}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6323179293083451, "micro/f1_ci": {"90": [0.6233520895930195, 0.6418683671749849], "95": [0.6212129239683746, 0.6433834953337656]}, "micro/recall": 0.5988667900092507, "micro/precision": 0.669727143411354, "macro/f1": 0.5671647388688191, "macro/f1_ci": {"90": [0.5572399048719903, 0.577247635111665], "95": [0.5553732615109348, 0.5793881693393761]}, "macro/recall": 0.5439217682783225, "macro/precision": 0.6049623231784063, "per_entity_metric": {"corporation": {"f1": 0.4673109721432633, "f1_ci": {"90": [0.44073821638214794, 0.49380346194506486], "95": [0.4345049629782454, 0.5010802868149081]}, "precision": 0.47846332945285214, "recall": 0.45666666666666667}, "creative_work": {"f1": 0.33124018838304553, "f1_ci": {"90": [0.30036395978888, 0.3626835949872128], "95": [0.29519152771518703, 0.3685301988871562]}, "precision": 0.3885819521178637, "recall": 0.28864569083447333}, "event": {"f1": 0.4597107438016529, "f1_ci": {"90": [0.43358831070137327, 0.4834637283006848], "95": [0.429486076821645, 0.48853823770491805]}, "precision": 0.5316606929510155, "recall": 0.4049135577797998}, "group": {"f1": 0.5760869565217391, "f1_ci": {"90": [0.5533624070508728, 0.6002919737979431], "95": [0.5506175388446288, 0.6050261925906731]}, "precision": 0.7013232514177694, "recall": 0.4888010540184453}, "location": {"f1": 0.6441717791411042, "f1_ci": {"90": [0.6165992673657916, 0.6703458808896694], "95": [0.6119444333644128, 0.6748159083550472]}, "precision": 0.574398249452954, "recall": 0.7332402234636871}, "person": {"f1": 0.8321060382916053, "f1_ci": {"90": [0.821677267531769, 0.8427002490386487], "95": [0.8194743155293102, 0.8450823127765467]}, "precision": 0.8308823529411765, "recall": 0.8333333333333334}, "product": {"f1": 0.6595264937993236, "f1_ci": {"90": [0.6365520783180869, 0.6811715301378959], "95": [0.63347027394072, 0.6853053837030515]}, "precision": 0.729426433915212, "recall": 0.6018518518518519}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7303993004954824, "micro/f1_ci": {}, "micro/recall": 0.6502335236118318, "micro/precision": 0.8331117021276596, "macro/f1": 0.7303993004954824, "macro/f1_ci": {}, "macro/recall": 0.6502335236118318, "macro/precision": 0.8331117021276596}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.756898656898657, "micro/f1_ci": {}, "micro/recall": 0.716896033306349, "micro/precision": 0.801629380576749, "macro/f1": 0.756898656898657, "macro/f1_ci": {}, "macro/recall": 0.716896033306349, "macro/precision": 0.801629380576749}
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": "cardiffnlp/twitter-roberta-base-2019-90m", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 0.0001, "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_2021", "dataset_name": null, "local_dataset": null, "model": "cardiffnlp/twitter-roberta-base-2019-90m", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 0.0001, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.3, "max_grad_norm": 1}