asahi417 commited on
Commit
53e130c
1 Parent(s): 3a2e4d3

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-dec2021-tweetner7-2020
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.6417969860676713
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6314199395770392
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6525208140610546
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5950190138355756
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5844336783514947
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6100191042323923
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.77377161055505
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7612174107642385
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7867468486180178
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.6535560344827587
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6795518207282913
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6294758692267773
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6112036126522273
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6366190072656497
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5931815043549611
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7636755591484775
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7942825112107623
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7353399065905553
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-dec2021-tweetner7-2020
88
+
89
+ This model is a fine-tuned version of [cardiffnlp/twitter-roberta-base-dec2021](https://huggingface.co/cardiffnlp/twitter-roberta-base-dec2021) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_2020` 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.6417969860676713
94
+ - Precision (micro): 0.6314199395770392
95
+ - Recall (micro): 0.6525208140610546
96
+ - F1 (macro): 0.5950190138355756
97
+ - Precision (macro): 0.5844336783514947
98
+ - Recall (macro): 0.6100191042323923
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5161953727506428
104
+ - creative_work: 0.4749841671944269
105
+ - event: 0.43429109750353273
106
+ - group: 0.593413759373981
107
+ - location: 0.6431718061674009
108
+ - person: 0.8327532515112659
109
+ - product: 0.6703236423477785
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6334648803400447, 0.651188450223803]
114
+ - 95%: [0.6314263719566943, 0.6528797499551452]
115
+ - F1 (macro):
116
+ - 90%: [0.6334648803400447, 0.651188450223803]
117
+ - 95%: [0.6314263719566943, 0.6528797499551452]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-dec2021-tweetner7-2020/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-dec2021-tweetner7-2020/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-dec2021-tweetner7-2020")
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_2020
140
+ - dataset_name: None
141
+ - local_dataset: None
142
+ - model: cardiffnlp/twitter-roberta-base-dec2021
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-dec2021-tweetner7-2020/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
- {"2020.dev": {"micro/f1": 0.6370572207084468, "micro/f1_ci": {}, "micro/recall": 0.6107628004179728, "micro/precision": 0.6657175398633257, "macro/f1": 0.5818500927746258, "macro/f1_ci": {}, "macro/recall": 0.558634696207478, "macro/precision": 0.6115327302781756, "per_entity_metric": {"corporation": {"f1": 0.4693877551020408, "f1_ci": {}, "precision": 0.48677248677248675, "recall": 0.45320197044334976}, "creative_work": {"f1": 0.5144356955380578, "f1_ci": {}, "precision": 0.5664739884393064, "recall": 0.47115384615384615}, "event": {"f1": 0.3828920570264766, "f1_ci": {}, "precision": 0.4, "recall": 0.3671875}, "group": {"f1": 0.5622119815668202, "f1_ci": {}, "precision": 0.5893719806763285, "recall": 0.5374449339207048}, "location": {"f1": 0.6285714285714284, "f1_ci": {}, "precision": 0.5931372549019608, "recall": 0.6685082872928176}, "person": {"f1": 0.8676975945017182, "f1_ci": {}, "precision": 0.892226148409894, "recall": 0.8444816053511706}, "product": {"f1": 0.6477541371158392, "f1_ci": {}, "precision": 0.7527472527472527, "recall": 0.5684647302904564}}}, "2021.test": {"micro/f1": 0.6417969860676713, "micro/f1_ci": {"90": [0.6334648803400447, 0.651188450223803], "95": [0.6314263719566943, 0.6528797499551452]}, "micro/recall": 0.6525208140610546, "micro/precision": 0.6314199395770392, "macro/f1": 0.5950190138355756, "macro/f1_ci": {"90": [0.5855854380997908, 0.6046272067604185], "95": [0.5837653478173793, 0.606080435069187]}, "macro/recall": 0.6100191042323923, "macro/precision": 0.5844336783514947, "per_entity_metric": {"corporation": {"f1": 0.5161953727506428, "f1_ci": {"90": [0.4927218605886716, 0.5414831199725443], "95": [0.4870848768801742, 0.547844877649912]}, "precision": 0.48038277511961724, "recall": 0.5577777777777778}, "creative_work": {"f1": 0.4749841671944269, "f1_ci": {"90": [0.44315016015693665, 0.5054160340115397], "95": [0.4373215286098878, 0.5122643035682656]}, "precision": 0.44221698113207547, "recall": 0.5129958960328317}, "event": {"f1": 0.43429109750353273, "f1_ci": {"90": [0.4106041087816789, 0.45832656118533116], "95": [0.40788582234365367, 0.46288163349626044]}, "precision": 0.4501953125, "recall": 0.4194722474977252}, "group": {"f1": 0.593413759373981, "f1_ci": {"90": [0.5729480380392004, 0.6136009860444586], "95": [0.569351806541065, 0.6194689670779012]}, "precision": 0.5874757908327953, "recall": 0.5994729907773386}, "location": {"f1": 0.6431718061674009, "f1_ci": {"90": [0.6159219058444587, 0.6695603128406853], "95": [0.6090556482248325, 0.6734092369794471]}, "precision": 0.5853379152348225, "recall": 0.7136871508379888}, "person": {"f1": 0.8327532515112659, "f1_ci": {"90": [0.8230547559590614, 0.8433818253656356], "95": [0.8211029923755827, 0.8457833808000503]}, "precision": 0.827448125227521, "recall": 0.8381268436578171}, "product": {"f1": 0.6703236423477785, "f1_ci": {"90": [0.6478723110217235, 0.6911223620805819], "95": [0.6441389195232122, 0.6947141029343396]}, "precision": 0.717978848413631, "recall": 0.6286008230452675}}}, "2020.test": {"micro/f1": 0.6535560344827587, "micro/f1_ci": {"90": [0.6322110846801919, 0.6725291873276269], "95": [0.6284137294993963, 0.6757531238447321]}, "micro/recall": 0.6294758692267773, "micro/precision": 0.6795518207282913, "macro/f1": 0.6112036126522273, "macro/f1_ci": {"90": [0.5885812318209095, 0.6302682399052447], "95": [0.5851527157984716, 0.6350317949646983]}, "macro/recall": 0.5931815043549611, "macro/precision": 0.6366190072656497, "per_entity_metric": {"corporation": {"f1": 0.5960591133004925, "f1_ci": {"90": [0.5395060701236211, 0.6494117647058822], "95": [0.5253672975902609, 0.6620697527948355]}, "precision": 0.5627906976744186, "recall": 0.6335078534031413}, "creative_work": {"f1": 0.5341246290801188, "f1_ci": {"90": [0.47351444952608207, 0.5861169548093196], "95": [0.4651130219529672, 0.5969428423543331]}, "precision": 0.569620253164557, "recall": 0.5027932960893855}, "event": {"f1": 0.45136186770428016, "f1_ci": {"90": [0.39823686811875786, 0.5019271027404221], "95": [0.3909613718310647, 0.5127203344600605]}, "precision": 0.46586345381526106, "recall": 0.4377358490566038}, "group": {"f1": 0.5533453887884269, "f1_ci": {"90": [0.4990720961035416, 0.6060777264167093], "95": [0.48433459051724126, 0.6135325916276041]}, "precision": 0.6322314049586777, "recall": 0.4919614147909968}, "location": {"f1": 0.6361031518624641, "f1_ci": {"90": [0.5650739843960184, 0.6985154228855721], "95": [0.5545887898306531, 0.7110143602918171]}, "precision": 0.6032608695652174, "recall": 0.6727272727272727}, "person": {"f1": 0.8492678725236864, "f1_ci": {"90": [0.8247403953294568, 0.8714447733934279], "95": [0.8194677632518109, 0.8756164968824685]}, "precision": 0.8725663716814159, "recall": 0.8271812080536913}, "product": {"f1": 0.6581632653061223, "f1_ci": {"90": [0.6046445933517278, 0.7088196286472149], "95": [0.5933362116697867, 0.7185306985239963]}, "precision": 0.75, "recall": 0.5863636363636363}}}, "2021.test (span detection)": {"micro/f1": 0.77377161055505, "micro/f1_ci": {}, "micro/recall": 0.7867468486180178, "micro/precision": 0.7612174107642385, "macro/f1": 0.77377161055505, "macro/f1_ci": {}, "macro/recall": 0.7867468486180178, "macro/precision": 0.7612174107642385}, "2020.test (span detection)": {"micro/f1": 0.7636755591484775, "micro/f1_ci": {}, "micro/recall": 0.7353399065905553, "micro/precision": 0.7942825112107623, "macro/f1": 0.7636755591484775, "macro/f1_ci": {}, "macro/recall": 0.7353399065905553, "macro/precision": 0.7942825112107623}}
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6535560344827587, "micro/f1_ci": {"90": [0.6322110846801919, 0.6725291873276269], "95": [0.6284137294993963, 0.6757531238447321]}, "micro/recall": 0.6294758692267773, "micro/precision": 0.6795518207282913, "macro/f1": 0.6112036126522273, "macro/f1_ci": {"90": [0.5885812318209095, 0.6302682399052447], "95": [0.5851527157984716, 0.6350317949646983]}, "macro/recall": 0.5931815043549611, "macro/precision": 0.6366190072656497, "per_entity_metric": {"corporation": {"f1": 0.5960591133004925, "f1_ci": {"90": [0.5395060701236211, 0.6494117647058822], "95": [0.5253672975902609, 0.6620697527948355]}, "precision": 0.5627906976744186, "recall": 0.6335078534031413}, "creative_work": {"f1": 0.5341246290801188, "f1_ci": {"90": [0.47351444952608207, 0.5861169548093196], "95": [0.4651130219529672, 0.5969428423543331]}, "precision": 0.569620253164557, "recall": 0.5027932960893855}, "event": {"f1": 0.45136186770428016, "f1_ci": {"90": [0.39823686811875786, 0.5019271027404221], "95": [0.3909613718310647, 0.5127203344600605]}, "precision": 0.46586345381526106, "recall": 0.4377358490566038}, "group": {"f1": 0.5533453887884269, "f1_ci": {"90": [0.4990720961035416, 0.6060777264167093], "95": [0.48433459051724126, 0.6135325916276041]}, "precision": 0.6322314049586777, "recall": 0.4919614147909968}, "location": {"f1": 0.6361031518624641, "f1_ci": {"90": [0.5650739843960184, 0.6985154228855721], "95": [0.5545887898306531, 0.7110143602918171]}, "precision": 0.6032608695652174, "recall": 0.6727272727272727}, "person": {"f1": 0.8492678725236864, "f1_ci": {"90": [0.8247403953294568, 0.8714447733934279], "95": [0.8194677632518109, 0.8756164968824685]}, "precision": 0.8725663716814159, "recall": 0.8271812080536913}, "product": {"f1": 0.6581632653061223, "f1_ci": {"90": [0.6046445933517278, 0.7088196286472149], "95": [0.5933362116697867, 0.7185306985239963]}, "precision": 0.75, "recall": 0.5863636363636363}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6417969860676713, "micro/f1_ci": {"90": [0.6334648803400447, 0.651188450223803], "95": [0.6314263719566943, 0.6528797499551452]}, "micro/recall": 0.6525208140610546, "micro/precision": 0.6314199395770392, "macro/f1": 0.5950190138355756, "macro/f1_ci": {"90": [0.5855854380997908, 0.6046272067604185], "95": [0.5837653478173793, 0.606080435069187]}, "macro/recall": 0.6100191042323923, "macro/precision": 0.5844336783514947, "per_entity_metric": {"corporation": {"f1": 0.5161953727506428, "f1_ci": {"90": [0.4927218605886716, 0.5414831199725443], "95": [0.4870848768801742, 0.547844877649912]}, "precision": 0.48038277511961724, "recall": 0.5577777777777778}, "creative_work": {"f1": 0.4749841671944269, "f1_ci": {"90": [0.44315016015693665, 0.5054160340115397], "95": [0.4373215286098878, 0.5122643035682656]}, "precision": 0.44221698113207547, "recall": 0.5129958960328317}, "event": {"f1": 0.43429109750353273, "f1_ci": {"90": [0.4106041087816789, 0.45832656118533116], "95": [0.40788582234365367, 0.46288163349626044]}, "precision": 0.4501953125, "recall": 0.4194722474977252}, "group": {"f1": 0.593413759373981, "f1_ci": {"90": [0.5729480380392004, 0.6136009860444586], "95": [0.569351806541065, 0.6194689670779012]}, "precision": 0.5874757908327953, "recall": 0.5994729907773386}, "location": {"f1": 0.6431718061674009, "f1_ci": {"90": [0.6159219058444587, 0.6695603128406853], "95": [0.6090556482248325, 0.6734092369794471]}, "precision": 0.5853379152348225, "recall": 0.7136871508379888}, "person": {"f1": 0.8327532515112659, "f1_ci": {"90": [0.8230547559590614, 0.8433818253656356], "95": [0.8211029923755827, 0.8457833808000503]}, "precision": 0.827448125227521, "recall": 0.8381268436578171}, "product": {"f1": 0.6703236423477785, "f1_ci": {"90": [0.6478723110217235, 0.6911223620805819], "95": [0.6441389195232122, 0.6947141029343396]}, "precision": 0.717978848413631, "recall": 0.6286008230452675}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7636755591484775, "micro/f1_ci": {}, "micro/recall": 0.7353399065905553, "micro/precision": 0.7942825112107623, "macro/f1": 0.7636755591484775, "macro/f1_ci": {}, "macro/recall": 0.7353399065905553, "macro/precision": 0.7942825112107623}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.77377161055505, "micro/f1_ci": {}, "micro/recall": 0.7867468486180178, "micro/precision": 0.7612174107642385, "macro/f1": 0.77377161055505, "macro/f1_ci": {}, "macro/recall": 0.7867468486180178, "macro/precision": 0.7612174107642385}
eval/prediction.2020.dev.json DELETED
The diff for this file is too large to render. See raw diff
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
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "2020.train", "model": "cardiffnlp/twitter-roberta-base-dec2021", "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_2020", "dataset_name": null, "local_dataset": null, "model": "cardiffnlp/twitter-roberta-base-dec2021", "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}