asahi417 commited on
Commit
0f10ea9
1 Parent(s): b40f923

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-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.6587179789871326
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6727755003617073
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6452358926919519
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6107285696131857
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.6215631908472189
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6039860329938679
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7843692816244613
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.8010610079575596
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7683589684283566
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.6475869809203142
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.7049480757483201
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.598858329008822
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6057800656625983
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6627892226359489
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5669673771050993
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.755331088664422
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8222357971899816
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.6984950700570836
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-2020-2021-continuous
88
+
89
+ This model is a fine-tuned version of [tner/twitter-roberta-base-2019-90m-tweetner-2020](https://huggingface.co/tner/twitter-roberta-base-2019-90m-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.6587179789871326
94
+ - Precision (micro): 0.6727755003617073
95
+ - Recall (micro): 0.6452358926919519
96
+ - F1 (macro): 0.6107285696131857
97
+ - Precision (macro): 0.6215631908472189
98
+ - Recall (macro): 0.6039860329938679
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5165775401069518
104
+ - creative_work: 0.480106100795756
105
+ - event: 0.4846715328467153
106
+ - group: 0.6041666666666665
107
+ - location: 0.6836268754076973
108
+ - person: 0.8458527493010252
109
+ - product: 0.6600985221674878
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6500084574752211, 0.6675327789934176]
114
+ - 95%: [0.6480876172354417, 0.6695072839398589]
115
+ - F1 (macro):
116
+ - 90%: [0.6500084574752211, 0.6675327789934176]
117
+ - 95%: [0.6480876172354417, 0.6695072839398589]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-2019-90m-tweetner7-2020-2021-continuous/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-2019-90m-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/twitter-roberta-base-2019-90m-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/twitter-roberta-base-2019-90m-tweetner-2020
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-2019-90m-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.json DELETED
@@ -1 +0,0 @@
1
- {"2021.dev": {"micro/f1": 0.6450261780104712, "micro/f1_ci": {}, "micro/recall": 0.616, "micro/precision": 0.676923076923077, "macro/f1": 0.5962535580648441, "macro/f1_ci": {}, "macro/recall": 0.5745880129991789, "macro/precision": 0.6251527330747371, "per_entity_metric": {"corporation": {"f1": 0.5797101449275363, "f1_ci": {}, "precision": 0.5714285714285714, "recall": 0.5882352941176471}, "creative_work": {"f1": 0.4697986577181208, "f1_ci": {}, "precision": 0.4666666666666667, "recall": 0.47297297297297297}, "event": {"f1": 0.4067796610169492, "f1_ci": {}, "precision": 0.45714285714285713, "recall": 0.366412213740458}, "group": {"f1": 0.6305418719211824, "f1_ci": {}, "precision": 0.7150837988826816, "recall": 0.5638766519823789}, "location": {"f1": 0.5945945945945946, "f1_ci": {}, "precision": 0.5789473684210527, "recall": 0.6111111111111112}, "person": {"f1": 0.8324514991181658, "f1_ci": {}, "precision": 0.8309859154929577, "recall": 0.833922261484099}, "product": {"f1": 0.6598984771573604, "f1_ci": {}, "precision": 0.7558139534883721, "recall": 0.5855855855855856}}}, "2021.test": {"micro/f1": 0.6587179789871326, "micro/f1_ci": {"90": [0.6500084574752211, 0.6675327789934176], "95": [0.6480876172354417, 0.6695072839398589]}, "micro/recall": 0.6452358926919519, "micro/precision": 0.6727755003617073, "macro/f1": 0.6107285696131857, "macro/f1_ci": {"90": [0.6016803308717976, 0.6202645433833436], "95": [0.5994476476393031, 0.6216597508490829]}, "macro/recall": 0.6039860329938679, "macro/precision": 0.6215631908472189, "per_entity_metric": {"corporation": {"f1": 0.5165775401069518, "f1_ci": {"90": [0.49149727683928734, 0.5424631455686919], "95": [0.4852586317545886, 0.5461513660625363]}, "precision": 0.4979381443298969, "recall": 0.5366666666666666}, "creative_work": {"f1": 0.480106100795756, "f1_ci": {"90": [0.453073041723214, 0.50950812525732], "95": [0.4466713194941541, 0.5161499273646297]}, "precision": 0.46589446589446587, "recall": 0.4952120383036936}, "event": {"f1": 0.4846715328467153, "f1_ci": {"90": [0.461685794044665, 0.5075673834488479], "95": [0.45719391471483367, 0.5126992651593725]}, "precision": 0.5209205020920502, "recall": 0.4531392174704277}, "group": {"f1": 0.6041666666666665, "f1_ci": {"90": [0.5830811998193606, 0.6264368818381182], "95": [0.5783034453510499, 0.6304740494329455]}, "precision": 0.6642969984202212, "recall": 0.5540184453227931}, "location": {"f1": 0.6836268754076973, "f1_ci": {"90": [0.6571241349182627, 0.709613327872738], "95": [0.6521909682357443, 0.7150913388648733]}, "precision": 0.6413708690330477, "recall": 0.7318435754189944}, "person": {"f1": 0.8458527493010252, "f1_ci": {"90": [0.8342425995098203, 0.8575205549845837], "95": [0.8314334208846303, 0.8595415243945875]}, "precision": 0.8552581982661138, "recall": 0.8366519174041298}, "product": {"f1": 0.6600985221674878, "f1_ci": {"90": [0.6375820368237944, 0.681656240341884], "95": [0.6340597504399297, 0.684351750913229]}, "precision": 0.7052631578947368, "recall": 0.6203703703703703}}}, "2020.test": {"micro/f1": 0.6475869809203142, "micro/f1_ci": {"90": [0.6267897474300171, 0.6668509760382569], "95": [0.6220217753635754, 0.6707876882456454]}, "micro/recall": 0.598858329008822, "micro/precision": 0.7049480757483201, "macro/f1": 0.6057800656625983, "macro/f1_ci": {"90": [0.5831278101058672, 0.6263507944303333], "95": [0.5785552590152583, 0.6306934757086151]}, "macro/recall": 0.5669673771050993, "macro/precision": 0.6627892226359489, "per_entity_metric": {"corporation": {"f1": 0.5618556701030927, "f1_ci": {"90": [0.49852350088248815, 0.6193234013361967], "95": [0.4861052259887006, 0.6320740777090763]}, "precision": 0.5532994923857868, "recall": 0.5706806282722513}, "creative_work": {"f1": 0.5497076023391813, "f1_ci": {"90": [0.4895030501413481, 0.6027666741522567], "95": [0.47588721221519736, 0.6109806635085506]}, "precision": 0.5766871165644172, "recall": 0.5251396648044693}, "event": {"f1": 0.4467213114754099, "f1_ci": {"90": [0.3950591617258284, 0.49787323817218776], "95": [0.3825687077007499, 0.5054575163398694]}, "precision": 0.48878923766816146, "recall": 0.41132075471698115}, "group": {"f1": 0.5316973415132924, "f1_ci": {"90": [0.4749270706399321, 0.5884958258795467], "95": [0.46389314030764484, 0.6000093808630396]}, "precision": 0.7303370786516854, "recall": 0.4180064308681672}, "location": {"f1": 0.6352941176470588, "f1_ci": {"90": [0.5737047095912183, 0.689875593176863], "95": [0.5627423945917096, 0.703535282044023]}, "precision": 0.6171428571428571, "recall": 0.6545454545454545}, "person": {"f1": 0.8364279398762157, "f1_ci": {"90": [0.8095100467932836, 0.8597686174777278], "95": [0.8044955935879107, 0.8631130405741233]}, "precision": 0.8841121495327103, "recall": 0.7936241610738255}, "product": {"f1": 0.6787564766839379, "f1_ci": {"90": [0.6229499055113231, 0.7319359334823253], "95": [0.6136336187966622, 0.739809307700981]}, "precision": 0.7891566265060241, "recall": 0.5954545454545455}}}, "2021.test (span detection)": {"micro/f1": 0.7843692816244613, "micro/f1_ci": {}, "micro/recall": 0.7683589684283566, "micro/precision": 0.8010610079575596, "macro/f1": 0.7843692816244613, "macro/f1_ci": {}, "macro/recall": 0.7683589684283566, "macro/precision": 0.8010610079575596}, "2020.test (span detection)": {"micro/f1": 0.755331088664422, "micro/f1_ci": {}, "micro/recall": 0.6984950700570836, "micro/precision": 0.8222357971899816, "macro/f1": 0.755331088664422, "macro/f1_ci": {}, "macro/recall": 0.6984950700570836, "macro/precision": 0.8222357971899816}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6475869809203142, "micro/f1_ci": {"90": [0.6267897474300171, 0.6668509760382569], "95": [0.6220217753635754, 0.6707876882456454]}, "micro/recall": 0.598858329008822, "micro/precision": 0.7049480757483201, "macro/f1": 0.6057800656625983, "macro/f1_ci": {"90": [0.5831278101058672, 0.6263507944303333], "95": [0.5785552590152583, 0.6306934757086151]}, "macro/recall": 0.5669673771050993, "macro/precision": 0.6627892226359489, "per_entity_metric": {"corporation": {"f1": 0.5618556701030927, "f1_ci": {"90": [0.49852350088248815, 0.6193234013361967], "95": [0.4861052259887006, 0.6320740777090763]}, "precision": 0.5532994923857868, "recall": 0.5706806282722513}, "creative_work": {"f1": 0.5497076023391813, "f1_ci": {"90": [0.4895030501413481, 0.6027666741522567], "95": [0.47588721221519736, 0.6109806635085506]}, "precision": 0.5766871165644172, "recall": 0.5251396648044693}, "event": {"f1": 0.4467213114754099, "f1_ci": {"90": [0.3950591617258284, 0.49787323817218776], "95": [0.3825687077007499, 0.5054575163398694]}, "precision": 0.48878923766816146, "recall": 0.41132075471698115}, "group": {"f1": 0.5316973415132924, "f1_ci": {"90": [0.4749270706399321, 0.5884958258795467], "95": [0.46389314030764484, 0.6000093808630396]}, "precision": 0.7303370786516854, "recall": 0.4180064308681672}, "location": {"f1": 0.6352941176470588, "f1_ci": {"90": [0.5737047095912183, 0.689875593176863], "95": [0.5627423945917096, 0.703535282044023]}, "precision": 0.6171428571428571, "recall": 0.6545454545454545}, "person": {"f1": 0.8364279398762157, "f1_ci": {"90": [0.8095100467932836, 0.8597686174777278], "95": [0.8044955935879107, 0.8631130405741233]}, "precision": 0.8841121495327103, "recall": 0.7936241610738255}, "product": {"f1": 0.6787564766839379, "f1_ci": {"90": [0.6229499055113231, 0.7319359334823253], "95": [0.6136336187966622, 0.739809307700981]}, "precision": 0.7891566265060241, "recall": 0.5954545454545455}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6587179789871326, "micro/f1_ci": {"90": [0.6500084574752211, 0.6675327789934176], "95": [0.6480876172354417, 0.6695072839398589]}, "micro/recall": 0.6452358926919519, "micro/precision": 0.6727755003617073, "macro/f1": 0.6107285696131857, "macro/f1_ci": {"90": [0.6016803308717976, 0.6202645433833436], "95": [0.5994476476393031, 0.6216597508490829]}, "macro/recall": 0.6039860329938679, "macro/precision": 0.6215631908472189, "per_entity_metric": {"corporation": {"f1": 0.5165775401069518, "f1_ci": {"90": [0.49149727683928734, 0.5424631455686919], "95": [0.4852586317545886, 0.5461513660625363]}, "precision": 0.4979381443298969, "recall": 0.5366666666666666}, "creative_work": {"f1": 0.480106100795756, "f1_ci": {"90": [0.453073041723214, 0.50950812525732], "95": [0.4466713194941541, 0.5161499273646297]}, "precision": 0.46589446589446587, "recall": 0.4952120383036936}, "event": {"f1": 0.4846715328467153, "f1_ci": {"90": [0.461685794044665, 0.5075673834488479], "95": [0.45719391471483367, 0.5126992651593725]}, "precision": 0.5209205020920502, "recall": 0.4531392174704277}, "group": {"f1": 0.6041666666666665, "f1_ci": {"90": [0.5830811998193606, 0.6264368818381182], "95": [0.5783034453510499, 0.6304740494329455]}, "precision": 0.6642969984202212, "recall": 0.5540184453227931}, "location": {"f1": 0.6836268754076973, "f1_ci": {"90": [0.6571241349182627, 0.709613327872738], "95": [0.6521909682357443, 0.7150913388648733]}, "precision": 0.6413708690330477, "recall": 0.7318435754189944}, "person": {"f1": 0.8458527493010252, "f1_ci": {"90": [0.8342425995098203, 0.8575205549845837], "95": [0.8314334208846303, 0.8595415243945875]}, "precision": 0.8552581982661138, "recall": 0.8366519174041298}, "product": {"f1": 0.6600985221674878, "f1_ci": {"90": [0.6375820368237944, 0.681656240341884], "95": [0.6340597504399297, 0.684351750913229]}, "precision": 0.7052631578947368, "recall": 0.6203703703703703}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.755331088664422, "micro/f1_ci": {}, "micro/recall": 0.6984950700570836, "micro/precision": 0.8222357971899816, "macro/f1": 0.755331088664422, "macro/f1_ci": {}, "macro/recall": 0.6984950700570836, "macro/precision": 0.8222357971899816}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7843692816244613, "micro/f1_ci": {}, "micro/recall": 0.7683589684283566, "micro/precision": 0.8010610079575596, "macro/f1": 0.7843692816244613, "macro/f1_ci": {}, "macro/recall": 0.7683589684283566, "macro/precision": 0.8010610079575596}
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/twitter-roberta-base-2019-90m-tweetner-2020", "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_2021", "dataset_name": null, "local_dataset": null, "model": "tner/twitter-roberta-base-2019-90m-tweetner-2020", "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}