asahi417 commited on
Commit
5f275e3
1 Parent(s): c0060e7

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
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.6421184225480168
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6312849162011173
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6533302497687327
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5910653350307403
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5792905609274926
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.604510675992635
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7789270288701977
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7657838864677617
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7925292008789175
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.642489851150203
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6713800904977375
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6159833938764919
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6023293888599316
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6319549874790182
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5783022171044098
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7480378890392421
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7816742081447964
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7171769590036325
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
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_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.6421184225480168
94
+ - Precision (micro): 0.6312849162011173
95
+ - Recall (micro): 0.6533302497687327
96
+ - F1 (macro): 0.5910653350307403
97
+ - Precision (macro): 0.5792905609274926
98
+ - Recall (macro): 0.604510675992635
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5075268817204301
104
+ - creative_work: 0.4444444444444444
105
+ - event: 0.4390243902439025
106
+ - group: 0.5914552736982643
107
+ - location: 0.6584415584415584
108
+ - person: 0.8392439243924392
109
+ - product: 0.6573208722741433
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6329963447257968, 0.6512071883878683]
114
+ - 95%: [0.6313662186691117, 0.6531901528182326]
115
+ - F1 (macro):
116
+ - 90%: [0.6329963447257968, 0.6512071883878683]
117
+ - 95%: [0.6313662186691117, 0.6531901528182326]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-base-tweetner7-2020/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/roberta-base-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/roberta-base-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: 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.15
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/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.63264192139738, "micro/f1_ci": {}, "micro/recall": 0.6055381400208987, "micro/precision": 0.6622857142857143, "macro/f1": 0.574634430106692, "macro/f1_ci": {}, "macro/recall": 0.5490536498812068, "macro/precision": 0.6046855072673193, "per_entity_metric": {"corporation": {"f1": 0.4741144414168937, "f1_ci": {}, "precision": 0.5304878048780488, "recall": 0.42857142857142855}, "creative_work": {"f1": 0.49738219895287955, "f1_ci": {}, "precision": 0.5459770114942529, "recall": 0.4567307692307692}, "event": {"f1": 0.39363817097415504, "f1_ci": {}, "precision": 0.4008097165991903, "recall": 0.38671875}, "group": {"f1": 0.5103448275862068, "f1_ci": {}, "precision": 0.5336538461538461, "recall": 0.4889867841409692}, "location": {"f1": 0.6284153005464481, "f1_ci": {}, "precision": 0.6216216216216216, "recall": 0.6353591160220995}, "person": {"f1": 0.8713550600343053, "f1_ci": {}, "precision": 0.8943661971830986, "recall": 0.8494983277591973}, "product": {"f1": 0.647191011235955, "f1_ci": {}, "precision": 0.7058823529411765, "recall": 0.5975103734439834}}}, "2021.test": {"micro/f1": 0.6421184225480168, "micro/f1_ci": {"90": [0.6329963447257968, 0.6512071883878683], "95": [0.6313662186691117, 0.6531901528182326]}, "micro/recall": 0.6533302497687327, "micro/precision": 0.6312849162011173, "macro/f1": 0.5910653350307403, "macro/f1_ci": {"90": [0.580811083611411, 0.6006051849025007], "95": [0.5786926369174525, 0.6019537723463372]}, "macro/recall": 0.604510675992635, "macro/precision": 0.5792905609274926, "per_entity_metric": {"corporation": {"f1": 0.5075268817204301, "f1_ci": {"90": [0.4824596104045469, 0.5321255741220724], "95": [0.4786678573496566, 0.5359074129334884]}, "precision": 0.49166666666666664, "recall": 0.5244444444444445}, "creative_work": {"f1": 0.4444444444444444, "f1_ci": {"90": [0.41206219991189397, 0.472399743395062], "95": [0.40429689645945094, 0.4781029004648966]}, "precision": 0.42105263157894735, "recall": 0.47058823529411764}, "event": {"f1": 0.4390243902439025, "f1_ci": {"90": [0.41618532179505363, 0.4613249997500841], "95": [0.4127254270752854, 0.46538424790791016]}, "precision": 0.4441340782122905, "recall": 0.4340309372156506}, "group": {"f1": 0.5914552736982643, "f1_ci": {"90": [0.5707880300178324, 0.6130815064249576], "95": [0.5670469135971191, 0.6169643378760042]}, "precision": 0.5994587280108254, "recall": 0.5836627140974967}, "location": {"f1": 0.6584415584415584, "f1_ci": {"90": [0.6291422043205595, 0.6852636263678726], "95": [0.6243413788002835, 0.6901146371455337]}, "precision": 0.6152912621359223, "recall": 0.7081005586592178}, "person": {"f1": 0.8392439243924392, "f1_ci": {"90": [0.8284389763971283, 0.8491030026023837], "95": [0.8267645014381084, 0.8509174642295299]}, "precision": 0.8199085473091804, "recall": 0.8595132743362832}, "product": {"f1": 0.6573208722741433, "f1_ci": {"90": [0.6353671840482944, 0.6793638106087693], "95": [0.6315494736842105, 0.682884859188648]}, "precision": 0.6635220125786163, "recall": 0.6512345679012346}}}, "2020.test": {"micro/f1": 0.642489851150203, "micro/f1_ci": {"90": [0.6231728409986848, 0.6615969581749049], "95": [0.6200368620037806, 0.665245816863449]}, "micro/recall": 0.6159833938764919, "micro/precision": 0.6713800904977375, "macro/f1": 0.6023293888599316, "macro/f1_ci": {"90": [0.5807455360504852, 0.6223504555748728], "95": [0.5765329255864473, 0.6263256800647661]}, "macro/recall": 0.5783022171044098, "macro/precision": 0.6319549874790182, "per_entity_metric": {"corporation": {"f1": 0.5858585858585857, "f1_ci": {"90": [0.5271310068649885, 0.6411705551086083], "95": [0.5164291386299996, 0.6514806378132117]}, "precision": 0.5658536585365853, "recall": 0.6073298429319371}, "creative_work": {"f1": 0.4894259818731118, "f1_ci": {"90": [0.4285714285714286, 0.5459332207429503], "95": [0.4135536723163841, 0.5538461538461538]}, "precision": 0.5328947368421053, "recall": 0.45251396648044695}, "event": {"f1": 0.4383561643835617, "f1_ci": {"90": [0.3850460933957987, 0.4915793621013133], "95": [0.37837565936157486, 0.500023020257827]}, "precision": 0.45528455284552843, "recall": 0.4226415094339623}, "group": {"f1": 0.5531135531135531, "f1_ci": {"90": [0.5047318665914491, 0.6014011350967873], "95": [0.49806744046427853, 0.6106442412597326]}, "precision": 0.6425531914893617, "recall": 0.4855305466237942}, "location": {"f1": 0.6563467492260061, "f1_ci": {"90": [0.5910379918588874, 0.7164217571934143], "95": [0.5790909090909092, 0.729731611834676]}, "precision": 0.6708860759493671, "recall": 0.6424242424242425}, "person": {"f1": 0.8200339558573854, "f1_ci": {"90": [0.7919374706548458, 0.8439227194913183], "95": [0.7872795232324625, 0.8492311695040038]}, "precision": 0.8298969072164949, "recall": 0.8104026845637584}, "product": {"f1": 0.673170731707317, "f1_ci": {"90": [0.617711019074841, 0.7227918554567322], "95": [0.6066718407764846, 0.7343802362600538]}, "precision": 0.7263157894736842, "recall": 0.6272727272727273}}}, "2021.test (span detection)": {"micro/f1": 0.7789270288701977, "micro/f1_ci": {}, "micro/recall": 0.7925292008789175, "micro/precision": 0.7657838864677617, "macro/f1": 0.7789270288701977, "macro/f1_ci": {}, "macro/recall": 0.7925292008789175, "macro/precision": 0.7657838864677617}, "2020.test (span detection)": {"micro/f1": 0.7480378890392421, "micro/f1_ci": {}, "micro/recall": 0.7171769590036325, "micro/precision": 0.7816742081447964, "macro/f1": 0.7480378890392421, "macro/f1_ci": {}, "macro/recall": 0.7171769590036325, "macro/precision": 0.7816742081447964}}
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.642489851150203, "micro/f1_ci": {"90": [0.6231728409986848, 0.6615969581749049], "95": [0.6200368620037806, 0.665245816863449]}, "micro/recall": 0.6159833938764919, "micro/precision": 0.6713800904977375, "macro/f1": 0.6023293888599316, "macro/f1_ci": {"90": [0.5807455360504852, 0.6223504555748728], "95": [0.5765329255864473, 0.6263256800647661]}, "macro/recall": 0.5783022171044098, "macro/precision": 0.6319549874790182, "per_entity_metric": {"corporation": {"f1": 0.5858585858585857, "f1_ci": {"90": [0.5271310068649885, 0.6411705551086083], "95": [0.5164291386299996, 0.6514806378132117]}, "precision": 0.5658536585365853, "recall": 0.6073298429319371}, "creative_work": {"f1": 0.4894259818731118, "f1_ci": {"90": [0.4285714285714286, 0.5459332207429503], "95": [0.4135536723163841, 0.5538461538461538]}, "precision": 0.5328947368421053, "recall": 0.45251396648044695}, "event": {"f1": 0.4383561643835617, "f1_ci": {"90": [0.3850460933957987, 0.4915793621013133], "95": [0.37837565936157486, 0.500023020257827]}, "precision": 0.45528455284552843, "recall": 0.4226415094339623}, "group": {"f1": 0.5531135531135531, "f1_ci": {"90": [0.5047318665914491, 0.6014011350967873], "95": [0.49806744046427853, 0.6106442412597326]}, "precision": 0.6425531914893617, "recall": 0.4855305466237942}, "location": {"f1": 0.6563467492260061, "f1_ci": {"90": [0.5910379918588874, 0.7164217571934143], "95": [0.5790909090909092, 0.729731611834676]}, "precision": 0.6708860759493671, "recall": 0.6424242424242425}, "person": {"f1": 0.8200339558573854, "f1_ci": {"90": [0.7919374706548458, 0.8439227194913183], "95": [0.7872795232324625, 0.8492311695040038]}, "precision": 0.8298969072164949, "recall": 0.8104026845637584}, "product": {"f1": 0.673170731707317, "f1_ci": {"90": [0.617711019074841, 0.7227918554567322], "95": [0.6066718407764846, 0.7343802362600538]}, "precision": 0.7263157894736842, "recall": 0.6272727272727273}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6421184225480168, "micro/f1_ci": {"90": [0.6329963447257968, 0.6512071883878683], "95": [0.6313662186691117, 0.6531901528182326]}, "micro/recall": 0.6533302497687327, "micro/precision": 0.6312849162011173, "macro/f1": 0.5910653350307403, "macro/f1_ci": {"90": [0.580811083611411, 0.6006051849025007], "95": [0.5786926369174525, 0.6019537723463372]}, "macro/recall": 0.604510675992635, "macro/precision": 0.5792905609274926, "per_entity_metric": {"corporation": {"f1": 0.5075268817204301, "f1_ci": {"90": [0.4824596104045469, 0.5321255741220724], "95": [0.4786678573496566, 0.5359074129334884]}, "precision": 0.49166666666666664, "recall": 0.5244444444444445}, "creative_work": {"f1": 0.4444444444444444, "f1_ci": {"90": [0.41206219991189397, 0.472399743395062], "95": [0.40429689645945094, 0.4781029004648966]}, "precision": 0.42105263157894735, "recall": 0.47058823529411764}, "event": {"f1": 0.4390243902439025, "f1_ci": {"90": [0.41618532179505363, 0.4613249997500841], "95": [0.4127254270752854, 0.46538424790791016]}, "precision": 0.4441340782122905, "recall": 0.4340309372156506}, "group": {"f1": 0.5914552736982643, "f1_ci": {"90": [0.5707880300178324, 0.6130815064249576], "95": [0.5670469135971191, 0.6169643378760042]}, "precision": 0.5994587280108254, "recall": 0.5836627140974967}, "location": {"f1": 0.6584415584415584, "f1_ci": {"90": [0.6291422043205595, 0.6852636263678726], "95": [0.6243413788002835, 0.6901146371455337]}, "precision": 0.6152912621359223, "recall": 0.7081005586592178}, "person": {"f1": 0.8392439243924392, "f1_ci": {"90": [0.8284389763971283, 0.8491030026023837], "95": [0.8267645014381084, 0.8509174642295299]}, "precision": 0.8199085473091804, "recall": 0.8595132743362832}, "product": {"f1": 0.6573208722741433, "f1_ci": {"90": [0.6353671840482944, 0.6793638106087693], "95": [0.6315494736842105, 0.682884859188648]}, "precision": 0.6635220125786163, "recall": 0.6512345679012346}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7480378890392421, "micro/f1_ci": {}, "micro/recall": 0.7171769590036325, "micro/precision": 0.7816742081447964, "macro/f1": 0.7480378890392421, "macro/f1_ci": {}, "macro/recall": 0.7171769590036325, "macro/precision": 0.7816742081447964}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7789270288701977, "micro/f1_ci": {}, "micro/recall": 0.7925292008789175, "micro/precision": 0.7657838864677617, "macro/f1": 0.7789270288701977, "macro/f1_ci": {}, "macro/recall": 0.7925292008789175, "macro/precision": 0.7657838864677617}
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": "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.15, "max_grad_norm": 1}
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_2020", "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.15, "max_grad_norm": 1}