asahi417 commited on
Commit
8711ca0
1 Parent(s): 94e344e

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-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.6515831894070236
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6488190781930749
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6543709528214616
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6081318073591985
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.6024892144112918
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6155807376978756
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7893373251194657
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7859435909195138
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7927604949693535
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.6531839300355288
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6899538106235565
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6201349247535028
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6166186507300974
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6523781324413148
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5860926262979317
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7523236741388737
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7949162333911034
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7140633108458744
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-concat
88
+
89
+ This model is a fine-tuned version of [roberta-base](https://huggingface.co/roberta-base) 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.6515831894070236
94
+ - Precision (micro): 0.6488190781930749
95
+ - Recall (micro): 0.6543709528214616
96
+ - F1 (macro): 0.6081318073591985
97
+ - Precision (macro): 0.6024892144112918
98
+ - Recall (macro): 0.6155807376978756
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5174234424498415
104
+ - creative_work: 0.466403162055336
105
+ - event: 0.46727272727272723
106
+ - group: 0.6071197411003236
107
+ - location: 0.6832786885245901
108
+ - person: 0.8377301195672804
109
+ - product: 0.6776947705442904
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6426248846161623, 0.6611146727643068]
114
+ - 95%: [0.6408583849998567, 0.6629609445072536]
115
+ - F1 (macro):
116
+ - 90%: [0.6426248846161623, 0.6611146727643068]
117
+ - 95%: [0.6408583849998567, 0.6629609445072536]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-base-tweetner7-2020-2021-concat/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/roberta-base-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/roberta-base-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: roberta-base
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/roberta-base-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.6469689251146206, "micro/f1_ci": {}, "micro/recall": 0.635, "micro/precision": 0.6593977154724818, "macro/f1": 0.6014288931166422, "macro/f1_ci": {}, "macro/recall": 0.5903596479194196, "macro/precision": 0.6143183232533814, "per_entity_metric": {"corporation": {"f1": 0.6019417475728156, "f1_ci": {}, "precision": 0.5961538461538461, "recall": 0.6078431372549019}, "creative_work": {"f1": 0.47887323943661975, "f1_ci": {}, "precision": 0.5, "recall": 0.4594594594594595}, "event": {"f1": 0.41767068273092367, "f1_ci": {}, "precision": 0.4406779661016949, "recall": 0.3969465648854962}, "group": {"f1": 0.631578947368421, "f1_ci": {}, "precision": 0.62882096069869, "recall": 0.6343612334801763}, "location": {"f1": 0.6122448979591836, "f1_ci": {}, "precision": 0.6, "recall": 0.625}, "person": {"f1": 0.8366247755834828, "f1_ci": {}, "precision": 0.8503649635036497, "recall": 0.823321554770318}, "product": {"f1": 0.6310679611650485, "f1_ci": {}, "precision": 0.6842105263157895, "recall": 0.5855855855855856}}}, "2021.test": {"micro/f1": 0.6515831894070236, "micro/f1_ci": {"90": [0.6426248846161623, 0.6611146727643068], "95": [0.6408583849998567, 0.6629609445072536]}, "micro/recall": 0.6543709528214616, "micro/precision": 0.6488190781930749, "macro/f1": 0.6081318073591985, "macro/f1_ci": {"90": [0.5982720247328263, 0.6181304060646944], "95": [0.5956407088917159, 0.6196130125852912]}, "macro/recall": 0.6155807376978756, "macro/precision": 0.6024892144112918, "per_entity_metric": {"corporation": {"f1": 0.5174234424498415, "f1_ci": {"90": [0.4936648515870705, 0.5437348601262041], "95": [0.4885022949243286, 0.5471504446094865]}, "precision": 0.49295774647887325, "recall": 0.5444444444444444}, "creative_work": {"f1": 0.466403162055336, "f1_ci": {"90": [0.4365426214916792, 0.49570670195121297], "95": [0.430553631074086, 0.5016692736109198]}, "precision": 0.4498094027954257, "recall": 0.4842681258549932}, "event": {"f1": 0.46727272727272723, "f1_ci": {"90": [0.4454429687968715, 0.4903171853702863], "95": [0.44099256614662297, 0.4949513525562855]}, "precision": 0.46684831970935514, "recall": 0.467697907188353}, "group": {"f1": 0.6071197411003236, "f1_ci": {"90": [0.5861576908243826, 0.6289925904123155], "95": [0.5836863413397794, 0.6323354921624595]}, "precision": 0.5966921119592875, "recall": 0.6179183135704874}, "location": {"f1": 0.6832786885245901, "f1_ci": {"90": [0.6571720974465681, 0.7109068486625629], "95": [0.6508663190665896, 0.7162931067002565]}, "precision": 0.6440049443757726, "recall": 0.7276536312849162}, "person": {"f1": 0.8377301195672804, "f1_ci": {"90": [0.8276980959235751, 0.8485767478830628], "95": [0.8260255921110556, 0.8508092332281014]}, "precision": 0.8631208447399296, "recall": 0.8137905604719764}, "product": {"f1": 0.6776947705442904, "f1_ci": {"90": [0.6553902251490492, 0.699632094409221], "95": [0.6517642249373523, 0.7046841960928648]}, "precision": 0.7039911308203991, "recall": 0.6532921810699589}}}, "2020.test": {"micro/f1": 0.6531839300355288, "micro/f1_ci": {"90": [0.6331939425228015, 0.6709196392454311], "95": [0.6287463050212823, 0.6742363307437226]}, "micro/recall": 0.6201349247535028, "micro/precision": 0.6899538106235565, "macro/f1": 0.6166186507300974, "macro/f1_ci": {"90": [0.594157548648219, 0.6362144855158252], "95": [0.5904501135575192, 0.639776197480569]}, "macro/recall": 0.5860926262979317, "macro/precision": 0.6523781324413148, "per_entity_metric": {"corporation": {"f1": 0.6194225721784777, "f1_ci": {"90": [0.5565017746228926, 0.6733323349589473], "95": [0.5479085471734517, 0.6820512820512821]}, "precision": 0.6210526315789474, "recall": 0.6178010471204188}, "creative_work": {"f1": 0.4894259818731118, "f1_ci": {"90": [0.4270354135925701, 0.545507399577167], "95": [0.41717142698274423, 0.5555627705627706]}, "precision": 0.5328947368421053, "recall": 0.45251396648044695}, "event": {"f1": 0.45136186770428016, "f1_ci": {"90": [0.3978736734522443, 0.501874083251449], "95": [0.3891742854740079, 0.510803537621031]}, "precision": 0.46586345381526106, "recall": 0.4377358490566038}, "group": {"f1": 0.5658362989323844, "f1_ci": {"90": [0.5151382476251127, 0.61462698148764], "95": [0.5076307180164151, 0.626772526987192]}, "precision": 0.6334661354581673, "recall": 0.5112540192926045}, "location": {"f1": 0.6894409937888198, "f1_ci": {"90": [0.6274217149546386, 0.7440886398547689], "95": [0.6148768819473758, 0.7561225667461723]}, "precision": 0.7070063694267515, "recall": 0.6727272727272727}, "person": {"f1": 0.8275261324041812, "f1_ci": {"90": [0.7993567425754086, 0.8511074607796776], "95": [0.7958273985244123, 0.8545669887000585]}, "precision": 0.8605072463768116, "recall": 0.7969798657718121}, "product": {"f1": 0.6733167082294264, "f1_ci": {"90": [0.6190924641557551, 0.723014061091403], "95": [0.6093323046153235, 0.7345134333722708]}, "precision": 0.7458563535911602, "recall": 0.6136363636363636}}}, "2021.test (span detection)": {"micro/f1": 0.7893373251194657, "micro/f1_ci": {}, "micro/recall": 0.7927604949693535, "micro/precision": 0.7859435909195138, "macro/f1": 0.7893373251194657, "macro/f1_ci": {}, "macro/recall": 0.7927604949693535, "macro/precision": 0.7859435909195138}, "2020.test (span detection)": {"micro/f1": 0.7523236741388737, "micro/f1_ci": {}, "micro/recall": 0.7140633108458744, "micro/precision": 0.7949162333911034, "macro/f1": 0.7523236741388737, "macro/f1_ci": {}, "macro/recall": 0.7140633108458744, "macro/precision": 0.7949162333911034}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6531839300355288, "micro/f1_ci": {"90": [0.6331939425228015, 0.6709196392454311], "95": [0.6287463050212823, 0.6742363307437226]}, "micro/recall": 0.6201349247535028, "micro/precision": 0.6899538106235565, "macro/f1": 0.6166186507300974, "macro/f1_ci": {"90": [0.594157548648219, 0.6362144855158252], "95": [0.5904501135575192, 0.639776197480569]}, "macro/recall": 0.5860926262979317, "macro/precision": 0.6523781324413148, "per_entity_metric": {"corporation": {"f1": 0.6194225721784777, "f1_ci": {"90": [0.5565017746228926, 0.6733323349589473], "95": [0.5479085471734517, 0.6820512820512821]}, "precision": 0.6210526315789474, "recall": 0.6178010471204188}, "creative_work": {"f1": 0.4894259818731118, "f1_ci": {"90": [0.4270354135925701, 0.545507399577167], "95": [0.41717142698274423, 0.5555627705627706]}, "precision": 0.5328947368421053, "recall": 0.45251396648044695}, "event": {"f1": 0.45136186770428016, "f1_ci": {"90": [0.3978736734522443, 0.501874083251449], "95": [0.3891742854740079, 0.510803537621031]}, "precision": 0.46586345381526106, "recall": 0.4377358490566038}, "group": {"f1": 0.5658362989323844, "f1_ci": {"90": [0.5151382476251127, 0.61462698148764], "95": [0.5076307180164151, 0.626772526987192]}, "precision": 0.6334661354581673, "recall": 0.5112540192926045}, "location": {"f1": 0.6894409937888198, "f1_ci": {"90": [0.6274217149546386, 0.7440886398547689], "95": [0.6148768819473758, 0.7561225667461723]}, "precision": 0.7070063694267515, "recall": 0.6727272727272727}, "person": {"f1": 0.8275261324041812, "f1_ci": {"90": [0.7993567425754086, 0.8511074607796776], "95": [0.7958273985244123, 0.8545669887000585]}, "precision": 0.8605072463768116, "recall": 0.7969798657718121}, "product": {"f1": 0.6733167082294264, "f1_ci": {"90": [0.6190924641557551, 0.723014061091403], "95": [0.6093323046153235, 0.7345134333722708]}, "precision": 0.7458563535911602, "recall": 0.6136363636363636}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6515831894070236, "micro/f1_ci": {"90": [0.6426248846161623, 0.6611146727643068], "95": [0.6408583849998567, 0.6629609445072536]}, "micro/recall": 0.6543709528214616, "micro/precision": 0.6488190781930749, "macro/f1": 0.6081318073591985, "macro/f1_ci": {"90": [0.5982720247328263, 0.6181304060646944], "95": [0.5956407088917159, 0.6196130125852912]}, "macro/recall": 0.6155807376978756, "macro/precision": 0.6024892144112918, "per_entity_metric": {"corporation": {"f1": 0.5174234424498415, "f1_ci": {"90": [0.4936648515870705, 0.5437348601262041], "95": [0.4885022949243286, 0.5471504446094865]}, "precision": 0.49295774647887325, "recall": 0.5444444444444444}, "creative_work": {"f1": 0.466403162055336, "f1_ci": {"90": [0.4365426214916792, 0.49570670195121297], "95": [0.430553631074086, 0.5016692736109198]}, "precision": 0.4498094027954257, "recall": 0.4842681258549932}, "event": {"f1": 0.46727272727272723, "f1_ci": {"90": [0.4454429687968715, 0.4903171853702863], "95": [0.44099256614662297, 0.4949513525562855]}, "precision": 0.46684831970935514, "recall": 0.467697907188353}, "group": {"f1": 0.6071197411003236, "f1_ci": {"90": [0.5861576908243826, 0.6289925904123155], "95": [0.5836863413397794, 0.6323354921624595]}, "precision": 0.5966921119592875, "recall": 0.6179183135704874}, "location": {"f1": 0.6832786885245901, "f1_ci": {"90": [0.6571720974465681, 0.7109068486625629], "95": [0.6508663190665896, 0.7162931067002565]}, "precision": 0.6440049443757726, "recall": 0.7276536312849162}, "person": {"f1": 0.8377301195672804, "f1_ci": {"90": [0.8276980959235751, 0.8485767478830628], "95": [0.8260255921110556, 0.8508092332281014]}, "precision": 0.8631208447399296, "recall": 0.8137905604719764}, "product": {"f1": 0.6776947705442904, "f1_ci": {"90": [0.6553902251490492, 0.699632094409221], "95": [0.6517642249373523, 0.7046841960928648]}, "precision": 0.7039911308203991, "recall": 0.6532921810699589}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7523236741388737, "micro/f1_ci": {}, "micro/recall": 0.7140633108458744, "micro/precision": 0.7949162333911034, "macro/f1": 0.7523236741388737, "macro/f1_ci": {}, "macro/recall": 0.7140633108458744, "macro/precision": 0.7949162333911034}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7893373251194657, "micro/f1_ci": {}, "micro/recall": 0.7927604949693535, "micro/precision": 0.7859435909195138, "macro/f1": 0.7893373251194657, "macro/f1_ci": {}, "macro/recall": 0.7927604949693535, "macro/precision": 0.7859435909195138}
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": "roberta-base", "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": "roberta-base", "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}