asahi417 commited on
Commit
554741b
1 Parent(s): d199959

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-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.6404223573969929
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6356801093643198
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6452358926919519
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5923474605228576
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5882611136070073
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6009576961702408
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7803730272596844
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7745500113921167
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7862842604371458
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.6413755458515283
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6764536557282671
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6097560975609756
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.5978359372811374
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6331635922016912
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5696483348245823
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7425607425607427
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.783410138248848
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7057602490918526
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-random
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_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.6404223573969929
94
+ - Precision (micro): 0.6356801093643198
95
+ - Recall (micro): 0.6452358926919519
96
+ - F1 (macro): 0.5923474605228576
97
+ - Precision (macro): 0.5882611136070073
98
+ - Recall (macro): 0.6009576961702408
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5073313782991202
104
+ - creative_work: 0.4235127478753541
105
+ - event: 0.4598470363288719
106
+ - group: 0.5972820682797481
107
+ - location: 0.6794871794871795
108
+ - person: 0.8231629100238226
109
+ - product: 0.6558089033659067
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6318442200239734, 0.6492710692925945]
114
+ - 95%: [0.6304569517689761, 0.6507742568199575]
115
+ - F1 (macro):
116
+ - 90%: [0.6318442200239734, 0.6492710692925945]
117
+ - 95%: [0.6304569517689761, 0.6507742568199575]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-base-tweetner7-random/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/roberta-base-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-base-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-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-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.6366382861851139, "micro/f1_ci": {}, "micro/recall": 0.6187933796049119, "micro/precision": 0.6555429864253394, "macro/f1": 0.5877085684942696, "macro/f1_ci": {}, "macro/recall": 0.5721804509246399, "macro/precision": 0.6073972739006512, "per_entity_metric": {"corporation": {"f1": 0.57356608478803, "f1_ci": {}, "precision": 0.5528846153846154, "recall": 0.5958549222797928}, "creative_work": {"f1": 0.46258503401360546, "f1_ci": {}, "precision": 0.5151515151515151, "recall": 0.41975308641975306}, "event": {"f1": 0.3905579399141631, "f1_ci": {}, "precision": 0.4117647058823529, "recall": 0.37142857142857144}, "group": {"f1": 0.61236802413273, "f1_ci": {}, "precision": 0.6403785488958991, "recall": 0.5867052023121387}, "location": {"f1": 0.6246246246246248, "f1_ci": {}, "precision": 0.611764705882353, "recall": 0.6380368098159509}, "person": {"f1": 0.8488262910798122, "f1_ci": {}, "precision": 0.849624060150376, "recall": 0.8480300187617261}, "product": {"f1": 0.6014319809069213, "f1_ci": {}, "precision": 0.6702127659574468, "recall": 0.5454545454545454}}}, "2021.test": {"micro/f1": 0.6404223573969929, "micro/f1_ci": {"90": [0.6318442200239734, 0.6492710692925945], "95": [0.6304569517689761, 0.6507742568199575]}, "micro/recall": 0.6452358926919519, "micro/precision": 0.6356801093643198, "macro/f1": 0.5923474605228576, "macro/f1_ci": {"90": [0.5834248476754859, 0.6017201600387958], "95": [0.5814450008984621, 0.6034547429897775]}, "macro/recall": 0.6009576961702408, "macro/precision": 0.5882611136070073, "per_entity_metric": {"corporation": {"f1": 0.5073313782991202, "f1_ci": {"90": [0.48285841008729546, 0.5319891471347782], "95": [0.4769294748422465, 0.5359498674646497]}, "precision": 0.45287958115183247, "recall": 0.5766666666666667}, "creative_work": {"f1": 0.4235127478753541, "f1_ci": {"90": [0.3920038797569273, 0.4535109162157119], "95": [0.3865055698995115, 0.45722587346643756]}, "precision": 0.4390602055800294, "recall": 0.40902872777017785}, "event": {"f1": 0.4598470363288719, "f1_ci": {"90": [0.4361915405444048, 0.4815770919408292], "95": [0.43228713377486544, 0.48659304158476635]}, "precision": 0.48439073514602216, "recall": 0.43767060964513194}, "group": {"f1": 0.5972820682797481, "f1_ci": {"90": [0.5769763743967469, 0.6182142646082546], "95": [0.5723013739350298, 0.6231996920200187]}, "precision": 0.6010673782521682, "recall": 0.5935441370223979}, "location": {"f1": 0.6794871794871795, "f1_ci": {"90": [0.6532722132111245, 0.7069142033886049], "95": [0.6483586531023602, 0.711041212742627]}, "precision": 0.6279620853080569, "recall": 0.7402234636871509}, "person": {"f1": 0.8231629100238226, "f1_ci": {"90": [0.8123723616450855, 0.8337047799239938], "95": [0.8103268247356568, 0.8359212540153715]}, "precision": 0.8182149362477231, "recall": 0.8281710914454278}, "product": {"f1": 0.6558089033659067, "f1_ci": {"90": [0.6343529502269406, 0.6783496906386242], "95": [0.6296462048936172, 0.6817721129053114]}, "precision": 0.6942528735632184, "recall": 0.6213991769547325}}}, "2020.test": {"micro/f1": 0.6413755458515283, "micro/f1_ci": {"90": [0.6222555476147691, 0.6597865946700048], "95": [0.6193131081459617, 0.6639230650053427]}, "micro/recall": 0.6097560975609756, "micro/precision": 0.6764536557282671, "macro/f1": 0.5978359372811374, "macro/f1_ci": {"90": [0.5764363670094901, 0.618103079896346], "95": [0.5718154248562978, 0.6229228623936891]}, "macro/recall": 0.5696483348245823, "macro/precision": 0.6331635922016912, "per_entity_metric": {"corporation": {"f1": 0.5757575757575757, "f1_ci": {"90": [0.5194705037892698, 0.6281803562144057], "95": [0.5085437100213219, 0.6400349854227406]}, "precision": 0.5560975609756098, "recall": 0.5968586387434555}, "creative_work": {"f1": 0.4761904761904763, "f1_ci": {"90": [0.4155083554583789, 0.5296136875104415], "95": [0.404413869605668, 0.5397183276493623]}, "precision": 0.5514705882352942, "recall": 0.41899441340782123}, "event": {"f1": 0.42190669371196754, "f1_ci": {"90": [0.3673381231542293, 0.4758234343588129], "95": [0.3601694915254237, 0.48509915610074]}, "precision": 0.45614035087719296, "recall": 0.39245283018867927}, "group": {"f1": 0.5648312611012433, "f1_ci": {"90": [0.5137745892154593, 0.6134932533733134], "95": [0.5036973180076628, 0.6260172918988073]}, "precision": 0.6309523809523809, "recall": 0.5112540192926045}, "location": {"f1": 0.6707317073170732, "f1_ci": {"90": [0.6065793065793067, 0.7238615901724621], "95": [0.5954137077134027, 0.7374486720829003]}, "precision": 0.6748466257668712, "recall": 0.6666666666666666}, "person": {"f1": 0.8270547945205479, "f1_ci": {"90": [0.7992982351897211, 0.8511725937669974], "95": [0.7930445979361251, 0.8559374070770146]}, "precision": 0.8444055944055944, "recall": 0.8104026845637584}, "product": {"f1": 0.6483790523690773, "f1_ci": {"90": [0.5959166297912384, 0.7033119235335302], "95": [0.5850000000000001, 0.7156025968817367]}, "precision": 0.7182320441988951, "recall": 0.5909090909090909}}}, "2021.test (span detection)": {"micro/f1": 0.7803730272596844, "micro/f1_ci": {}, "micro/recall": 0.7862842604371458, "micro/precision": 0.7745500113921167, "macro/f1": 0.7803730272596844, "macro/f1_ci": {}, "macro/recall": 0.7862842604371458, "macro/precision": 0.7745500113921167}, "2020.test (span detection)": {"micro/f1": 0.7425607425607427, "micro/f1_ci": {}, "micro/recall": 0.7057602490918526, "micro/precision": 0.783410138248848, "macro/f1": 0.7425607425607427, "macro/f1_ci": {}, "macro/recall": 0.7057602490918526, "macro/precision": 0.783410138248848}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6413755458515283, "micro/f1_ci": {"90": [0.6222555476147691, 0.6597865946700048], "95": [0.6193131081459617, 0.6639230650053427]}, "micro/recall": 0.6097560975609756, "micro/precision": 0.6764536557282671, "macro/f1": 0.5978359372811374, "macro/f1_ci": {"90": [0.5764363670094901, 0.618103079896346], "95": [0.5718154248562978, 0.6229228623936891]}, "macro/recall": 0.5696483348245823, "macro/precision": 0.6331635922016912, "per_entity_metric": {"corporation": {"f1": 0.5757575757575757, "f1_ci": {"90": [0.5194705037892698, 0.6281803562144057], "95": [0.5085437100213219, 0.6400349854227406]}, "precision": 0.5560975609756098, "recall": 0.5968586387434555}, "creative_work": {"f1": 0.4761904761904763, "f1_ci": {"90": [0.4155083554583789, 0.5296136875104415], "95": [0.404413869605668, 0.5397183276493623]}, "precision": 0.5514705882352942, "recall": 0.41899441340782123}, "event": {"f1": 0.42190669371196754, "f1_ci": {"90": [0.3673381231542293, 0.4758234343588129], "95": [0.3601694915254237, 0.48509915610074]}, "precision": 0.45614035087719296, "recall": 0.39245283018867927}, "group": {"f1": 0.5648312611012433, "f1_ci": {"90": [0.5137745892154593, 0.6134932533733134], "95": [0.5036973180076628, 0.6260172918988073]}, "precision": 0.6309523809523809, "recall": 0.5112540192926045}, "location": {"f1": 0.6707317073170732, "f1_ci": {"90": [0.6065793065793067, 0.7238615901724621], "95": [0.5954137077134027, 0.7374486720829003]}, "precision": 0.6748466257668712, "recall": 0.6666666666666666}, "person": {"f1": 0.8270547945205479, "f1_ci": {"90": [0.7992982351897211, 0.8511725937669974], "95": [0.7930445979361251, 0.8559374070770146]}, "precision": 0.8444055944055944, "recall": 0.8104026845637584}, "product": {"f1": 0.6483790523690773, "f1_ci": {"90": [0.5959166297912384, 0.7033119235335302], "95": [0.5850000000000001, 0.7156025968817367]}, "precision": 0.7182320441988951, "recall": 0.5909090909090909}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6404223573969929, "micro/f1_ci": {"90": [0.6318442200239734, 0.6492710692925945], "95": [0.6304569517689761, 0.6507742568199575]}, "micro/recall": 0.6452358926919519, "micro/precision": 0.6356801093643198, "macro/f1": 0.5923474605228576, "macro/f1_ci": {"90": [0.5834248476754859, 0.6017201600387958], "95": [0.5814450008984621, 0.6034547429897775]}, "macro/recall": 0.6009576961702408, "macro/precision": 0.5882611136070073, "per_entity_metric": {"corporation": {"f1": 0.5073313782991202, "f1_ci": {"90": [0.48285841008729546, 0.5319891471347782], "95": [0.4769294748422465, 0.5359498674646497]}, "precision": 0.45287958115183247, "recall": 0.5766666666666667}, "creative_work": {"f1": 0.4235127478753541, "f1_ci": {"90": [0.3920038797569273, 0.4535109162157119], "95": [0.3865055698995115, 0.45722587346643756]}, "precision": 0.4390602055800294, "recall": 0.40902872777017785}, "event": {"f1": 0.4598470363288719, "f1_ci": {"90": [0.4361915405444048, 0.4815770919408292], "95": [0.43228713377486544, 0.48659304158476635]}, "precision": 0.48439073514602216, "recall": 0.43767060964513194}, "group": {"f1": 0.5972820682797481, "f1_ci": {"90": [0.5769763743967469, 0.6182142646082546], "95": [0.5723013739350298, 0.6231996920200187]}, "precision": 0.6010673782521682, "recall": 0.5935441370223979}, "location": {"f1": 0.6794871794871795, "f1_ci": {"90": [0.6532722132111245, 0.7069142033886049], "95": [0.6483586531023602, 0.711041212742627]}, "precision": 0.6279620853080569, "recall": 0.7402234636871509}, "person": {"f1": 0.8231629100238226, "f1_ci": {"90": [0.8123723616450855, 0.8337047799239938], "95": [0.8103268247356568, 0.8359212540153715]}, "precision": 0.8182149362477231, "recall": 0.8281710914454278}, "product": {"f1": 0.6558089033659067, "f1_ci": {"90": [0.6343529502269406, 0.6783496906386242], "95": [0.6296462048936172, 0.6817721129053114]}, "precision": 0.6942528735632184, "recall": 0.6213991769547325}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7425607425607427, "micro/f1_ci": {}, "micro/recall": 0.7057602490918526, "micro/precision": 0.783410138248848, "macro/f1": 0.7425607425607427, "macro/f1_ci": {}, "macro/recall": 0.7057602490918526, "macro/precision": 0.783410138248848}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7803730272596844, "micro/f1_ci": {}, "micro/recall": 0.7862842604371458, "micro/precision": 0.7745500113921167, "macro/f1": 0.7803730272596844, "macro/f1_ci": {}, "macro/recall": 0.7862842604371458, "macro/precision": 0.7745500113921167}
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-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_random", "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}