asahi417 commited on
Commit
781eb2b
1 Parent(s): aff6774

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-dec2020-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.6526255707762557
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6443868349864743
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6610777058279371
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6069741859166096
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5990170780704488
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6172166732079049
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7868028997088875
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7768259693417493
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7970394356424193
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.6544474393530997
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.680874929893438
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6299948105864037
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6138692748869267
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.639860659918586
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5920548821120473
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7586950660555406
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7895622895622896
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7301504929942917
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-dec2020-tweetner7-2020-2021-concat
88
+
89
+ This model is a fine-tuned version of [cardiffnlp/twitter-roberta-base-dec2020](https://huggingface.co/cardiffnlp/twitter-roberta-base-dec2020) 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.6526255707762557
94
+ - Precision (micro): 0.6443868349864743
95
+ - Recall (micro): 0.6610777058279371
96
+ - F1 (macro): 0.6069741859166096
97
+ - Precision (macro): 0.5990170780704488
98
+ - Recall (macro): 0.6172166732079049
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5153234960272418
104
+ - creative_work: 0.47595252966895685
105
+ - event: 0.46693657219973006
106
+ - group: 0.60928
107
+ - location: 0.6688567674113008
108
+ - person: 0.8386501936197677
109
+ - product: 0.6738197424892703
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6437691693006731, 0.6623739817960804]
114
+ - 95%: [0.6423289413183693, 0.6642699129749126]
115
+ - F1 (macro):
116
+ - 90%: [0.6437691693006731, 0.6623739817960804]
117
+ - 95%: [0.6423289413183693, 0.6642699129749126]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-dec2020-tweetner7-2020-2021-concat/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-dec2020-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/twitter-roberta-base-dec2020-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: cardiffnlp/twitter-roberta-base-dec2020
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.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-dec2020-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.6425339366515838, "micro/f1_ci": {}, "micro/recall": 0.639, "micro/precision": 0.6461071789686552, "macro/f1": 0.5989569296686776, "macro/f1_ci": {}, "macro/recall": 0.5963672516044548, "macro/precision": 0.604043351645594, "per_entity_metric": {"corporation": {"f1": 0.6082474226804123, "f1_ci": {}, "precision": 0.6413043478260869, "recall": 0.5784313725490197}, "creative_work": {"f1": 0.4171779141104294, "f1_ci": {}, "precision": 0.38202247191011235, "recall": 0.4594594594594595}, "event": {"f1": 0.4251968503937008, "f1_ci": {}, "precision": 0.43902439024390244, "recall": 0.4122137404580153}, "group": {"f1": 0.6236080178173719, "f1_ci": {}, "precision": 0.6306306306306306, "recall": 0.6167400881057269}, "location": {"f1": 0.6486486486486486, "f1_ci": {}, "precision": 0.631578947368421, "recall": 0.6666666666666666}, "person": {"f1": 0.8286713286713286, "f1_ci": {}, "precision": 0.8200692041522492, "recall": 0.8374558303886925}, "product": {"f1": 0.6411483253588517, "f1_ci": {}, "precision": 0.6836734693877551, "recall": 0.6036036036036037}}}, "2021.test": {"micro/f1": 0.6526255707762557, "micro/f1_ci": {"90": [0.6437691693006731, 0.6623739817960804], "95": [0.6423289413183693, 0.6642699129749126]}, "micro/recall": 0.6610777058279371, "micro/precision": 0.6443868349864743, "macro/f1": 0.6069741859166096, "macro/f1_ci": {"90": [0.5969405931574795, 0.6169180905698453], "95": [0.5951882145650105, 0.6186261415221893]}, "macro/recall": 0.6172166732079049, "macro/precision": 0.5990170780704488, "per_entity_metric": {"corporation": {"f1": 0.5153234960272418, "f1_ci": {"90": [0.48979124830710313, 0.5416453967401038], "95": [0.4846763606289239, 0.5484286848323734]}, "precision": 0.5266821345707656, "recall": 0.5044444444444445}, "creative_work": {"f1": 0.47595252966895685, "f1_ci": {"90": [0.4450136547127212, 0.5060689375403542], "95": [0.4406451100516083, 0.5104259293002914]}, "precision": 0.4379310344827586, "recall": 0.521203830369357}, "event": {"f1": 0.46693657219973006, "f1_ci": {"90": [0.4433278746436782, 0.4904300531124057], "95": [0.43908609101602464, 0.4948272743714957]}, "precision": 0.46174377224199287, "recall": 0.47224749772520475}, "group": {"f1": 0.60928, "f1_ci": {"90": [0.58905038898122, 0.6306565075497464], "95": [0.5857818627333528, 0.6337814610823933]}, "precision": 0.5924082140634723, "recall": 0.6271409749670619}, "location": {"f1": 0.6688567674113008, "f1_ci": {"90": [0.6411061399494976, 0.6963439016627287], "95": [0.6362671616964405, 0.7015416924027178]}, "precision": 0.6315136476426799, "recall": 0.7108938547486033}, "person": {"f1": 0.8386501936197677, "f1_ci": {"90": [0.8280056803440087, 0.8493018351616476], "95": [0.8263492236736317, 0.8510733824274442]}, "precision": 0.8388048690520103, "recall": 0.838495575221239}, "product": {"f1": 0.6738197424892703, "f1_ci": {"90": [0.65218196906801, 0.6956179563127771], "95": [0.6475943730141744, 0.6984190719050953]}, "precision": 0.7040358744394619, "recall": 0.6460905349794238}}}, "2020.test": {"micro/f1": 0.6544474393530997, "micro/f1_ci": {"90": [0.6328497699075983, 0.6728044842641441], "95": [0.6291867061094695, 0.6760719350870426]}, "micro/recall": 0.6299948105864037, "micro/precision": 0.680874929893438, "macro/f1": 0.6138692748869267, "macro/f1_ci": {"90": [0.590175490065613, 0.6330937411191636], "95": [0.5865029961531653, 0.6369957089246945]}, "macro/recall": 0.5920548821120473, "macro/precision": 0.639860659918586, "per_entity_metric": {"corporation": {"f1": 0.5675675675675675, "f1_ci": {"90": [0.504295559145109, 0.6253295812135242], "95": [0.49554695181907565, 0.6339265479676438]}, "precision": 0.5865921787709497, "recall": 0.5497382198952879}, "creative_work": {"f1": 0.550561797752809, "f1_ci": {"90": [0.4934960481877372, 0.6020524118738404], "95": [0.4848118648722878, 0.6132814376651454]}, "precision": 0.5536723163841808, "recall": 0.547486033519553}, "event": {"f1": 0.462406015037594, "f1_ci": {"90": [0.4108194750550992, 0.5124638081746882], "95": [0.401291157260602, 0.5232811578406383]}, "precision": 0.4606741573033708, "recall": 0.4641509433962264}, "group": {"f1": 0.5551601423487544, "f1_ci": {"90": [0.5016589792385684, 0.6076091861210725], "95": [0.4912804447531413, 0.617329390460492]}, "precision": 0.6215139442231076, "recall": 0.5016077170418006}, "location": {"f1": 0.6426426426426426, "f1_ci": {"90": [0.5713889988128216, 0.7035890939799735], "95": [0.5591985171261487, 0.7202876984126986]}, "precision": 0.6369047619047619, "recall": 0.6484848484848484}, "person": {"f1": 0.8487467588591183, "f1_ci": {"90": [0.8219659833630422, 0.8716422802714063], "95": [0.8163611658762722, 0.8762541806020068]}, "precision": 0.875222816399287, "recall": 0.8238255033557047}, "product": {"f1": 0.67, "f1_ci": {"90": [0.6153665583243049, 0.7173996017258546], "95": [0.6060281385281385, 0.7304367192795584]}, "precision": 0.7444444444444445, "recall": 0.6090909090909091}}}, "2021.test (span detection)": {"micro/f1": 0.7868028997088875, "micro/f1_ci": {}, "micro/recall": 0.7970394356424193, "micro/precision": 0.7768259693417493, "macro/f1": 0.7868028997088875, "macro/f1_ci": {}, "macro/recall": 0.7970394356424193, "macro/precision": 0.7768259693417493}, "2020.test (span detection)": {"micro/f1": 0.7586950660555406, "micro/f1_ci": {}, "micro/recall": 0.7301504929942917, "micro/precision": 0.7895622895622896, "macro/f1": 0.7586950660555406, "macro/f1_ci": {}, "macro/recall": 0.7301504929942917, "macro/precision": 0.7895622895622896}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6544474393530997, "micro/f1_ci": {"90": [0.6328497699075983, 0.6728044842641441], "95": [0.6291867061094695, 0.6760719350870426]}, "micro/recall": 0.6299948105864037, "micro/precision": 0.680874929893438, "macro/f1": 0.6138692748869267, "macro/f1_ci": {"90": [0.590175490065613, 0.6330937411191636], "95": [0.5865029961531653, 0.6369957089246945]}, "macro/recall": 0.5920548821120473, "macro/precision": 0.639860659918586, "per_entity_metric": {"corporation": {"f1": 0.5675675675675675, "f1_ci": {"90": [0.504295559145109, 0.6253295812135242], "95": [0.49554695181907565, 0.6339265479676438]}, "precision": 0.5865921787709497, "recall": 0.5497382198952879}, "creative_work": {"f1": 0.550561797752809, "f1_ci": {"90": [0.4934960481877372, 0.6020524118738404], "95": [0.4848118648722878, 0.6132814376651454]}, "precision": 0.5536723163841808, "recall": 0.547486033519553}, "event": {"f1": 0.462406015037594, "f1_ci": {"90": [0.4108194750550992, 0.5124638081746882], "95": [0.401291157260602, 0.5232811578406383]}, "precision": 0.4606741573033708, "recall": 0.4641509433962264}, "group": {"f1": 0.5551601423487544, "f1_ci": {"90": [0.5016589792385684, 0.6076091861210725], "95": [0.4912804447531413, 0.617329390460492]}, "precision": 0.6215139442231076, "recall": 0.5016077170418006}, "location": {"f1": 0.6426426426426426, "f1_ci": {"90": [0.5713889988128216, 0.7035890939799735], "95": [0.5591985171261487, 0.7202876984126986]}, "precision": 0.6369047619047619, "recall": 0.6484848484848484}, "person": {"f1": 0.8487467588591183, "f1_ci": {"90": [0.8219659833630422, 0.8716422802714063], "95": [0.8163611658762722, 0.8762541806020068]}, "precision": 0.875222816399287, "recall": 0.8238255033557047}, "product": {"f1": 0.67, "f1_ci": {"90": [0.6153665583243049, 0.7173996017258546], "95": [0.6060281385281385, 0.7304367192795584]}, "precision": 0.7444444444444445, "recall": 0.6090909090909091}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6526255707762557, "micro/f1_ci": {"90": [0.6437691693006731, 0.6623739817960804], "95": [0.6423289413183693, 0.6642699129749126]}, "micro/recall": 0.6610777058279371, "micro/precision": 0.6443868349864743, "macro/f1": 0.6069741859166096, "macro/f1_ci": {"90": [0.5969405931574795, 0.6169180905698453], "95": [0.5951882145650105, 0.6186261415221893]}, "macro/recall": 0.6172166732079049, "macro/precision": 0.5990170780704488, "per_entity_metric": {"corporation": {"f1": 0.5153234960272418, "f1_ci": {"90": [0.48979124830710313, 0.5416453967401038], "95": [0.4846763606289239, 0.5484286848323734]}, "precision": 0.5266821345707656, "recall": 0.5044444444444445}, "creative_work": {"f1": 0.47595252966895685, "f1_ci": {"90": [0.4450136547127212, 0.5060689375403542], "95": [0.4406451100516083, 0.5104259293002914]}, "precision": 0.4379310344827586, "recall": 0.521203830369357}, "event": {"f1": 0.46693657219973006, "f1_ci": {"90": [0.4433278746436782, 0.4904300531124057], "95": [0.43908609101602464, 0.4948272743714957]}, "precision": 0.46174377224199287, "recall": 0.47224749772520475}, "group": {"f1": 0.60928, "f1_ci": {"90": [0.58905038898122, 0.6306565075497464], "95": [0.5857818627333528, 0.6337814610823933]}, "precision": 0.5924082140634723, "recall": 0.6271409749670619}, "location": {"f1": 0.6688567674113008, "f1_ci": {"90": [0.6411061399494976, 0.6963439016627287], "95": [0.6362671616964405, 0.7015416924027178]}, "precision": 0.6315136476426799, "recall": 0.7108938547486033}, "person": {"f1": 0.8386501936197677, "f1_ci": {"90": [0.8280056803440087, 0.8493018351616476], "95": [0.8263492236736317, 0.8510733824274442]}, "precision": 0.8388048690520103, "recall": 0.838495575221239}, "product": {"f1": 0.6738197424892703, "f1_ci": {"90": [0.65218196906801, 0.6956179563127771], "95": [0.6475943730141744, 0.6984190719050953]}, "precision": 0.7040358744394619, "recall": 0.6460905349794238}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7586950660555406, "micro/f1_ci": {}, "micro/recall": 0.7301504929942917, "micro/precision": 0.7895622895622896, "macro/f1": 0.7586950660555406, "macro/f1_ci": {}, "macro/recall": 0.7301504929942917, "macro/precision": 0.7895622895622896}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7868028997088875, "micro/f1_ci": {}, "micro/recall": 0.7970394356424193, "micro/precision": 0.7768259693417493, "macro/f1": 0.7868028997088875, "macro/f1_ci": {}, "macro/recall": 0.7970394356424193, "macro/precision": 0.7768259693417493}
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": "cardiffnlp/twitter-roberta-base-dec2020", "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_all", "dataset_name": null, "local_dataset": null, "model": "cardiffnlp/twitter-roberta-base-dec2020", "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}