asahi417 commited on
Commit
dcc060a
1 Parent(s): 463fd82

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-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.647180429539451
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6428245493953912
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.651595744680851
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.599724784991918
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5927116702269455
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6075992592680901
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7828633779360248
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7775496235455168
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7882502602058518
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.6469310157523085
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6786324786324787
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6180591593149974
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6053228739595288
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6353958642029116
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5799081543030431
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7593699076588811
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7965811965811965
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7254800207576544
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-random
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_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.647180429539451
94
+ - Precision (micro): 0.6428245493953912
95
+ - Recall (micro): 0.651595744680851
96
+ - F1 (macro): 0.599724784991918
97
+ - Precision (macro): 0.5927116702269455
98
+ - Recall (macro): 0.6075992592680901
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.49081803005008345
104
+ - creative_work: 0.4642392717815344
105
+ - event: 0.4564920273348519
106
+ - group: 0.6168039538714991
107
+ - location: 0.6750496360026472
108
+ - person: 0.8331479421579534
109
+ - product: 0.661522633744856
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.638863290259823, 0.6571232166113093]
114
+ - 95%: [0.6369059711235887, 0.6583232503306811]
115
+ - F1 (macro):
116
+ - 90%: [0.638863290259823, 0.6571232166113093]
117
+ - 95%: [0.6369059711235887, 0.6583232503306811]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-dec2020-tweetner7-random/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-dec2020-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/twitter-roberta-base-dec2020-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: 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.15
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-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.636139292569235, "micro/f1_ci": {}, "micro/recall": 0.6193272824345969, "micro/precision": 0.6538895152198422, "macro/f1": 0.5889505868453838, "macro/f1_ci": {}, "macro/recall": 0.5747770006058855, "macro/precision": 0.6048487753165137, "per_entity_metric": {"corporation": {"f1": 0.5054945054945055, "f1_ci": {}, "precision": 0.5380116959064327, "recall": 0.47668393782383417}, "creative_work": {"f1": 0.4921135646687697, "f1_ci": {}, "precision": 0.5032258064516129, "recall": 0.48148148148148145}, "event": {"f1": 0.3678646934460888, "f1_ci": {}, "precision": 0.3815789473684211, "recall": 0.3551020408163265}, "group": {"f1": 0.6110283159463488, "f1_ci": {}, "precision": 0.6307692307692307, "recall": 0.5924855491329479}, "location": {"f1": 0.6686567164179105, "f1_ci": {}, "precision": 0.6511627906976745, "recall": 0.6871165644171779}, "person": {"f1": 0.8582302568981922, "f1_ci": {}, "precision": 0.8706563706563707, "recall": 0.8461538461538461}, "product": {"f1": 0.6192660550458715, "f1_ci": {}, "precision": 0.6585365853658537, "recall": 0.5844155844155844}}}, "2021.test": {"micro/f1": 0.647180429539451, "micro/f1_ci": {"90": [0.638863290259823, 0.6571232166113093], "95": [0.6369059711235887, 0.6583232503306811]}, "micro/recall": 0.651595744680851, "micro/precision": 0.6428245493953912, "macro/f1": 0.599724784991918, "macro/f1_ci": {"90": [0.5898083141176582, 0.6102417714069138], "95": [0.5883541467624883, 0.6118892806343514]}, "macro/recall": 0.6075992592680901, "macro/precision": 0.5927116702269455, "per_entity_metric": {"corporation": {"f1": 0.49081803005008345, "f1_ci": {"90": [0.4659487770408919, 0.5182997799087251], "95": [0.4607175510034198, 0.5226749309775297]}, "precision": 0.4916387959866221, "recall": 0.49}, "creative_work": {"f1": 0.4642392717815344, "f1_ci": {"90": [0.43437985968912063, 0.49609799842004704], "95": [0.4293175625975742, 0.50293712081692]}, "precision": 0.4423791821561338, "recall": 0.4883720930232558}, "event": {"f1": 0.4564920273348519, "f1_ci": {"90": [0.43312040607394414, 0.4805105894941198], "95": [0.4290331073815886, 0.48513216306524937]}, "precision": 0.45711678832116787, "recall": 0.45586897179253866}, "group": {"f1": 0.6168039538714991, "f1_ci": {"90": [0.596835997433537, 0.6375918997219351], "95": [0.5930045786258692, 0.6423742481136104]}, "precision": 0.6170072511535926, "recall": 0.616600790513834}, "location": {"f1": 0.6750496360026472, "f1_ci": {"90": [0.6483953111117986, 0.7020357363811676], "95": [0.6442174340711808, 0.7062758926474242]}, "precision": 0.6415094339622641, "recall": 0.7122905027932961}, "person": {"f1": 0.8331479421579534, "f1_ci": {"90": [0.8224552661031729, 0.8444571403179274], "95": [0.8204713825881407, 0.8460376396156104]}, "precision": 0.8378076062639821, "recall": 0.8285398230088495}, "product": {"f1": 0.661522633744856, "f1_ci": {"90": [0.6407822659293477, 0.6827506165675322], "95": [0.6355335831565007, 0.6869551952078615]}, "precision": 0.661522633744856, "recall": 0.661522633744856}}}, "2020.test": {"micro/f1": 0.6469310157523085, "micro/f1_ci": {"90": [0.6255332972787668, 0.6659736408494877], "95": [0.6224135756691761, 0.6702426848338685]}, "micro/recall": 0.6180591593149974, "micro/precision": 0.6786324786324787, "macro/f1": 0.6053228739595288, "macro/f1_ci": {"90": [0.5811485400719889, 0.625587676346971], "95": [0.5779351962830672, 0.630439252296093]}, "macro/recall": 0.5799081543030431, "macro/precision": 0.6353958642029116, "per_entity_metric": {"corporation": {"f1": 0.5555555555555557, "f1_ci": {"90": [0.49450244200244203, 0.6116561964591661], "95": [0.4842493589606233, 0.6220230556337368]}, "precision": 0.5614973262032086, "recall": 0.5497382198952879}, "creative_work": {"f1": 0.5384615384615384, "f1_ci": {"90": [0.479163765088208, 0.5944598315516683], "95": [0.4689400972590627, 0.6025773195876288]}, "precision": 0.5723270440251572, "recall": 0.5083798882681564}, "event": {"f1": 0.44274809160305345, "f1_ci": {"90": [0.3905637631216805, 0.4928571428571428], "95": [0.38058704004728827, 0.5038339866584143]}, "precision": 0.44787644787644787, "recall": 0.4377358490566038}, "group": {"f1": 0.5656934306569343, "f1_ci": {"90": [0.5115089837170129, 0.6180623574777951], "95": [0.49914021378118173, 0.626345170668137]}, "precision": 0.6540084388185654, "recall": 0.4983922829581994}, "location": {"f1": 0.6504559270516718, "f1_ci": {"90": [0.5806338822467855, 0.711697116442879], "95": [0.5667472773335965, 0.7247410144283611]}, "precision": 0.6524390243902439, "recall": 0.6484848484848484}, "person": {"f1": 0.8402777777777778, "f1_ci": {"90": [0.8144796380090498, 0.8632005454395977], "95": [0.810303182503082, 0.8675224547771234]}, "precision": 0.8705035971223022, "recall": 0.8120805369127517}, "product": {"f1": 0.6440677966101694, "f1_ci": {"90": [0.587443946188341, 0.6988570255688482], "95": [0.5747000587297592, 0.7104135562854583]}, "precision": 0.689119170984456, "recall": 0.6045454545454545}}}, "2021.test (span detection)": {"micro/f1": 0.7828633779360248, "micro/f1_ci": {}, "micro/recall": 0.7882502602058518, "micro/precision": 0.7775496235455168, "macro/f1": 0.7828633779360248, "macro/f1_ci": {}, "macro/recall": 0.7882502602058518, "macro/precision": 0.7775496235455168}, "2020.test (span detection)": {"micro/f1": 0.7593699076588811, "micro/f1_ci": {}, "micro/recall": 0.7254800207576544, "micro/precision": 0.7965811965811965, "macro/f1": 0.7593699076588811, "macro/f1_ci": {}, "macro/recall": 0.7254800207576544, "macro/precision": 0.7965811965811965}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6469310157523085, "micro/f1_ci": {"90": [0.6255332972787668, 0.6659736408494877], "95": [0.6224135756691761, 0.6702426848338685]}, "micro/recall": 0.6180591593149974, "micro/precision": 0.6786324786324787, "macro/f1": 0.6053228739595288, "macro/f1_ci": {"90": [0.5811485400719889, 0.625587676346971], "95": [0.5779351962830672, 0.630439252296093]}, "macro/recall": 0.5799081543030431, "macro/precision": 0.6353958642029116, "per_entity_metric": {"corporation": {"f1": 0.5555555555555557, "f1_ci": {"90": [0.49450244200244203, 0.6116561964591661], "95": [0.4842493589606233, 0.6220230556337368]}, "precision": 0.5614973262032086, "recall": 0.5497382198952879}, "creative_work": {"f1": 0.5384615384615384, "f1_ci": {"90": [0.479163765088208, 0.5944598315516683], "95": [0.4689400972590627, 0.6025773195876288]}, "precision": 0.5723270440251572, "recall": 0.5083798882681564}, "event": {"f1": 0.44274809160305345, "f1_ci": {"90": [0.3905637631216805, 0.4928571428571428], "95": [0.38058704004728827, 0.5038339866584143]}, "precision": 0.44787644787644787, "recall": 0.4377358490566038}, "group": {"f1": 0.5656934306569343, "f1_ci": {"90": [0.5115089837170129, 0.6180623574777951], "95": [0.49914021378118173, 0.626345170668137]}, "precision": 0.6540084388185654, "recall": 0.4983922829581994}, "location": {"f1": 0.6504559270516718, "f1_ci": {"90": [0.5806338822467855, 0.711697116442879], "95": [0.5667472773335965, 0.7247410144283611]}, "precision": 0.6524390243902439, "recall": 0.6484848484848484}, "person": {"f1": 0.8402777777777778, "f1_ci": {"90": [0.8144796380090498, 0.8632005454395977], "95": [0.810303182503082, 0.8675224547771234]}, "precision": 0.8705035971223022, "recall": 0.8120805369127517}, "product": {"f1": 0.6440677966101694, "f1_ci": {"90": [0.587443946188341, 0.6988570255688482], "95": [0.5747000587297592, 0.7104135562854583]}, "precision": 0.689119170984456, "recall": 0.6045454545454545}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.647180429539451, "micro/f1_ci": {"90": [0.638863290259823, 0.6571232166113093], "95": [0.6369059711235887, 0.6583232503306811]}, "micro/recall": 0.651595744680851, "micro/precision": 0.6428245493953912, "macro/f1": 0.599724784991918, "macro/f1_ci": {"90": [0.5898083141176582, 0.6102417714069138], "95": [0.5883541467624883, 0.6118892806343514]}, "macro/recall": 0.6075992592680901, "macro/precision": 0.5927116702269455, "per_entity_metric": {"corporation": {"f1": 0.49081803005008345, "f1_ci": {"90": [0.4659487770408919, 0.5182997799087251], "95": [0.4607175510034198, 0.5226749309775297]}, "precision": 0.4916387959866221, "recall": 0.49}, "creative_work": {"f1": 0.4642392717815344, "f1_ci": {"90": [0.43437985968912063, 0.49609799842004704], "95": [0.4293175625975742, 0.50293712081692]}, "precision": 0.4423791821561338, "recall": 0.4883720930232558}, "event": {"f1": 0.4564920273348519, "f1_ci": {"90": [0.43312040607394414, 0.4805105894941198], "95": [0.4290331073815886, 0.48513216306524937]}, "precision": 0.45711678832116787, "recall": 0.45586897179253866}, "group": {"f1": 0.6168039538714991, "f1_ci": {"90": [0.596835997433537, 0.6375918997219351], "95": [0.5930045786258692, 0.6423742481136104]}, "precision": 0.6170072511535926, "recall": 0.616600790513834}, "location": {"f1": 0.6750496360026472, "f1_ci": {"90": [0.6483953111117986, 0.7020357363811676], "95": [0.6442174340711808, 0.7062758926474242]}, "precision": 0.6415094339622641, "recall": 0.7122905027932961}, "person": {"f1": 0.8331479421579534, "f1_ci": {"90": [0.8224552661031729, 0.8444571403179274], "95": [0.8204713825881407, 0.8460376396156104]}, "precision": 0.8378076062639821, "recall": 0.8285398230088495}, "product": {"f1": 0.661522633744856, "f1_ci": {"90": [0.6407822659293477, 0.6827506165675322], "95": [0.6355335831565007, 0.6869551952078615]}, "precision": 0.661522633744856, "recall": 0.661522633744856}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7593699076588811, "micro/f1_ci": {}, "micro/recall": 0.7254800207576544, "micro/precision": 0.7965811965811965, "macro/f1": 0.7593699076588811, "macro/f1_ci": {}, "macro/recall": 0.7254800207576544, "macro/precision": 0.7965811965811965}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7828633779360248, "micro/f1_ci": {}, "micro/recall": 0.7882502602058518, "micro/precision": 0.7775496235455168, "macro/f1": 0.7828633779360248, "macro/f1_ci": {}, "macro/recall": 0.7882502602058518, "macro/precision": 0.7775496235455168}
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": "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.15, "max_grad_norm": 1}
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_random", "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.15, "max_grad_norm": 1}