asahi417 commited on
Commit
da24b01
1 Parent(s): f12441e

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-large-tweetner7-random
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.6632769652650823
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6554878048780488
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6712534690101758
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6096477771855761
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.6042443991246051
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6191008735553379
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7900359938296291
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.780713640469738
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7995836706372152
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.6439847577572129
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6771608471665712
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6139076284379865
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6008744778169367
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6358142893696356
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5742193301311931
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7552409474543968
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7943871706758304
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7197716658017644
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-large-tweetner7-random
88
+
89
+ This model is a fine-tuned version of [roberta-large](https://huggingface.co/roberta-large) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_random` 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.6632769652650823
94
+ - Precision (micro): 0.6554878048780488
95
+ - Recall (micro): 0.6712534690101758
96
+ - F1 (macro): 0.6096477771855761
97
+ - Precision (macro): 0.6042443991246051
98
+ - Recall (macro): 0.6191008735553379
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5224148236700539
104
+ - creative_work: 0.45186640471512773
105
+ - event: 0.4894837476099427
106
+ - group: 0.6327722432153899
107
+ - location: 0.6692258477287268
108
+ - person: 0.838405036726128
109
+ - product: 0.6633663366336633
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6546824558783396, 0.6722355436189195]
114
+ - 95%: [0.6527609558375069, 0.6741666937877734]
115
+ - F1 (macro):
116
+ - 90%: [0.6546824558783396, 0.6722355436189195]
117
+ - 95%: [0.6527609558375069, 0.6741666937877734]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-tweetner7-random/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/roberta-large-tweetner7-random/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-large-tweetner7-random")
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_random
140
+ - dataset_name: None
141
+ - local_dataset: None
142
+ - model: roberta-large
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.15
152
+ - max_grad_norm: 1
153
+
154
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/roberta-large-tweetner7-random/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
- {"random.dev": {"micro/f1": 0.6501650165016502, "micro/f1_ci": {}, "micro/recall": 0.6310731446876668, "micro/precision": 0.6704480998298356, "macro/f1": 0.6005028651678407, "macro/f1_ci": {}, "macro/recall": 0.5837622163983479, "macro/precision": 0.621752223375048, "per_entity_metric": {"corporation": {"f1": 0.5413105413105412, "f1_ci": {}, "precision": 0.6012658227848101, "recall": 0.49222797927461137}, "creative_work": {"f1": 0.5171339563862928, "f1_ci": {}, "precision": 0.5220125786163522, "recall": 0.5123456790123457}, "event": {"f1": 0.3730337078651686, "f1_ci": {}, "precision": 0.415, "recall": 0.33877551020408164}, "group": {"f1": 0.6291079812206571, "f1_ci": {}, "precision": 0.6860068259385665, "recall": 0.5809248554913294}, "location": {"f1": 0.6686746987951807, "f1_ci": {}, "precision": 0.6568047337278107, "recall": 0.6809815950920245}, "person": {"f1": 0.8540344514959203, "f1_ci": {}, "precision": 0.8263157894736842, "recall": 0.8836772983114447}, "product": {"f1": 0.6202247191011236, "f1_ci": {}, "precision": 0.6448598130841121, "recall": 0.5974025974025974}}}, "2021.test": {"micro/f1": 0.6632769652650823, "micro/f1_ci": {"90": [0.6546824558783396, 0.6722355436189195], "95": [0.6527609558375069, 0.6741666937877734]}, "micro/recall": 0.6712534690101758, "micro/precision": 0.6554878048780488, "macro/f1": 0.6096477771855761, "macro/f1_ci": {"90": [0.6000033399344015, 0.6196382573823579], "95": [0.5981472384000703, 0.6215975643766474]}, "macro/recall": 0.6191008735553379, "macro/precision": 0.6042443991246051, "per_entity_metric": {"corporation": {"f1": 0.5224148236700539, "f1_ci": {"90": [0.49575230566534917, 0.548428873717759], "95": [0.49180182879678314, 0.5536876221847715]}, "precision": 0.5653298835705045, "recall": 0.4855555555555556}, "creative_work": {"f1": 0.45186640471512773, "f1_ci": {"90": [0.4220381822268108, 0.4839308609644777], "95": [0.4154910463113729, 0.48911260537307555]}, "precision": 0.4334170854271357, "recall": 0.4719562243502052}, "event": {"f1": 0.4894837476099427, "f1_ci": {"90": [0.4661296765605938, 0.510871201463544], "95": [0.4615384615384615, 0.516411878785732]}, "precision": 0.5156092648539778, "recall": 0.4658780709736124}, "group": {"f1": 0.6327722432153899, "f1_ci": {"90": [0.6127003027617782, 0.6543839434706372], "95": [0.6093291625393491, 0.6588729726962956]}, "precision": 0.6611629576453697, "recall": 0.6067193675889329}, "location": {"f1": 0.6692258477287268, "f1_ci": {"90": [0.6417970501525123, 0.6963076846900378], "95": [0.6367998717602004, 0.7017981808437215]}, "precision": 0.6174734356552538, "recall": 0.7304469273743017}, "person": {"f1": 0.838405036726128, "f1_ci": {"90": [0.8282701377388866, 0.8495293562513028], "95": [0.825632170233011, 0.851578528092547]}, "precision": 0.7974051896207585, "recall": 0.8838495575221239}, "product": {"f1": 0.6633663366336633, "f1_ci": {"90": [0.6417739190805534, 0.6847604430802081], "95": [0.637114780619813, 0.689184375235439]}, "precision": 0.6393129770992366, "recall": 0.6893004115226338}}}, "2020.test": {"micro/f1": 0.6439847577572129, "micro/f1_ci": {"90": [0.6239511351712037, 0.6636956588748724], "95": [0.6202890037120405, 0.6672202398213474]}, "micro/recall": 0.6139076284379865, "micro/precision": 0.6771608471665712, "macro/f1": 0.6008744778169367, "macro/f1_ci": {"90": [0.5782367510542764, 0.6219123487136012], "95": [0.5732090094451493, 0.6256935746402632]}, "macro/recall": 0.5742193301311931, "macro/precision": 0.6358142893696356, "per_entity_metric": {"corporation": {"f1": 0.5344827586206895, "f1_ci": {"90": [0.46733010287597426, 0.5928074904241737], "95": [0.4548436580892954, 0.6016792777061768]}, "precision": 0.5923566878980892, "recall": 0.4869109947643979}, "creative_work": {"f1": 0.5027322404371585, "f1_ci": {"90": [0.4469743400143622, 0.5552825552825553], "95": [0.43710669569951005, 0.5633915193287383]}, "precision": 0.4919786096256685, "recall": 0.5139664804469274}, "event": {"f1": 0.46680080482897385, "f1_ci": {"90": [0.4107729801228506, 0.5203104053512446], "95": [0.4024955652314143, 0.5313219588102243]}, "precision": 0.5, "recall": 0.4377358490566038}, "group": {"f1": 0.5725190839694656, "f1_ci": {"90": [0.5231821675037455, 0.6240227074235808], "95": [0.5101295909346619, 0.6312023177209077]}, "precision": 0.704225352112676, "recall": 0.48231511254019294}, "location": {"f1": 0.654434250764526, "f1_ci": {"90": [0.5903994977449776, 0.7104554590942137], "95": [0.5794875818846374, 0.7240381663767523]}, "precision": 0.6604938271604939, "recall": 0.6484848484848484}, "person": {"f1": 0.81787521079258, "f1_ci": {"90": [0.7923931517380374, 0.8422851983243039], "95": [0.7870345804988661, 0.8482340257519794]}, "precision": 0.8220338983050848, "recall": 0.8137583892617449}, "product": {"f1": 0.6572769953051644, "f1_ci": {"90": [0.6066135800653779, 0.707374149659864], "95": [0.5938903100310432, 0.7184158092104591]}, "precision": 0.6796116504854369, "recall": 0.6363636363636364}}}, "2021.test (span detection)": {"micro/f1": 0.7900359938296291, "micro/f1_ci": {}, "micro/recall": 0.7995836706372152, "micro/precision": 0.780713640469738, "macro/f1": 0.7900359938296291, "macro/f1_ci": {}, "macro/recall": 0.7995836706372152, "macro/precision": 0.780713640469738}, "2020.test (span detection)": {"micro/f1": 0.7552409474543968, "micro/f1_ci": {}, "micro/recall": 0.7197716658017644, "micro/precision": 0.7943871706758304, "macro/f1": 0.7552409474543968, "macro/f1_ci": {}, "macro/recall": 0.7197716658017644, "macro/precision": 0.7943871706758304}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6439847577572129, "micro/f1_ci": {"90": [0.6239511351712037, 0.6636956588748724], "95": [0.6202890037120405, 0.6672202398213474]}, "micro/recall": 0.6139076284379865, "micro/precision": 0.6771608471665712, "macro/f1": 0.6008744778169367, "macro/f1_ci": {"90": [0.5782367510542764, 0.6219123487136012], "95": [0.5732090094451493, 0.6256935746402632]}, "macro/recall": 0.5742193301311931, "macro/precision": 0.6358142893696356, "per_entity_metric": {"corporation": {"f1": 0.5344827586206895, "f1_ci": {"90": [0.46733010287597426, 0.5928074904241737], "95": [0.4548436580892954, 0.6016792777061768]}, "precision": 0.5923566878980892, "recall": 0.4869109947643979}, "creative_work": {"f1": 0.5027322404371585, "f1_ci": {"90": [0.4469743400143622, 0.5552825552825553], "95": [0.43710669569951005, 0.5633915193287383]}, "precision": 0.4919786096256685, "recall": 0.5139664804469274}, "event": {"f1": 0.46680080482897385, "f1_ci": {"90": [0.4107729801228506, 0.5203104053512446], "95": [0.4024955652314143, 0.5313219588102243]}, "precision": 0.5, "recall": 0.4377358490566038}, "group": {"f1": 0.5725190839694656, "f1_ci": {"90": [0.5231821675037455, 0.6240227074235808], "95": [0.5101295909346619, 0.6312023177209077]}, "precision": 0.704225352112676, "recall": 0.48231511254019294}, "location": {"f1": 0.654434250764526, "f1_ci": {"90": [0.5903994977449776, 0.7104554590942137], "95": [0.5794875818846374, 0.7240381663767523]}, "precision": 0.6604938271604939, "recall": 0.6484848484848484}, "person": {"f1": 0.81787521079258, "f1_ci": {"90": [0.7923931517380374, 0.8422851983243039], "95": [0.7870345804988661, 0.8482340257519794]}, "precision": 0.8220338983050848, "recall": 0.8137583892617449}, "product": {"f1": 0.6572769953051644, "f1_ci": {"90": [0.6066135800653779, 0.707374149659864], "95": [0.5938903100310432, 0.7184158092104591]}, "precision": 0.6796116504854369, "recall": 0.6363636363636364}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6632769652650823, "micro/f1_ci": {"90": [0.6546824558783396, 0.6722355436189195], "95": [0.6527609558375069, 0.6741666937877734]}, "micro/recall": 0.6712534690101758, "micro/precision": 0.6554878048780488, "macro/f1": 0.6096477771855761, "macro/f1_ci": {"90": [0.6000033399344015, 0.6196382573823579], "95": [0.5981472384000703, 0.6215975643766474]}, "macro/recall": 0.6191008735553379, "macro/precision": 0.6042443991246051, "per_entity_metric": {"corporation": {"f1": 0.5224148236700539, "f1_ci": {"90": [0.49575230566534917, 0.548428873717759], "95": [0.49180182879678314, 0.5536876221847715]}, "precision": 0.5653298835705045, "recall": 0.4855555555555556}, "creative_work": {"f1": 0.45186640471512773, "f1_ci": {"90": [0.4220381822268108, 0.4839308609644777], "95": [0.4154910463113729, 0.48911260537307555]}, "precision": 0.4334170854271357, "recall": 0.4719562243502052}, "event": {"f1": 0.4894837476099427, "f1_ci": {"90": [0.4661296765605938, 0.510871201463544], "95": [0.4615384615384615, 0.516411878785732]}, "precision": 0.5156092648539778, "recall": 0.4658780709736124}, "group": {"f1": 0.6327722432153899, "f1_ci": {"90": [0.6127003027617782, 0.6543839434706372], "95": [0.6093291625393491, 0.6588729726962956]}, "precision": 0.6611629576453697, "recall": 0.6067193675889329}, "location": {"f1": 0.6692258477287268, "f1_ci": {"90": [0.6417970501525123, 0.6963076846900378], "95": [0.6367998717602004, 0.7017981808437215]}, "precision": 0.6174734356552538, "recall": 0.7304469273743017}, "person": {"f1": 0.838405036726128, "f1_ci": {"90": [0.8282701377388866, 0.8495293562513028], "95": [0.825632170233011, 0.851578528092547]}, "precision": 0.7974051896207585, "recall": 0.8838495575221239}, "product": {"f1": 0.6633663366336633, "f1_ci": {"90": [0.6417739190805534, 0.6847604430802081], "95": [0.637114780619813, 0.689184375235439]}, "precision": 0.6393129770992366, "recall": 0.6893004115226338}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7552409474543968, "micro/f1_ci": {}, "micro/recall": 0.7197716658017644, "micro/precision": 0.7943871706758304, "macro/f1": 0.7552409474543968, "macro/f1_ci": {}, "macro/recall": 0.7197716658017644, "macro/precision": 0.7943871706758304}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7900359938296291, "micro/f1_ci": {}, "micro/recall": 0.7995836706372152, "micro/precision": 0.780713640469738, "macro/f1": 0.7900359938296291, "macro/f1_ci": {}, "macro/recall": 0.7995836706372152, "macro/precision": 0.780713640469738}
eval/prediction.2020.test.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
 
eval/prediction.random.dev.json DELETED
The diff for this file is too large to render. See raw diff
 
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "random.train", "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.15, "max_grad_norm": 1}
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_random", "dataset_name": null, "local_dataset": null, "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.15, "max_grad_norm": 1}