asahi417 commited on
Commit
bb19784
1 Parent(s): a404d7f

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-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.6321284238886395
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6142015706806283
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6511332099907493
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.583682304736069
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5654677691354458
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6047150410746663
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7703620544484986
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7484729493891797
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7935700242858795
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.6368775235531628
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6616331096196868
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6139076284379865
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.5976605759407211
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6177069721428509
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5812570646484104
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7542395693135936
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7835570469798657
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7270368448365335
81
+
82
+ pipeline_tag: token-classification
83
+ widget:
84
+ - text: "Jacob Collier is a Grammy awarded artist from England."
85
+ example_title: "NER Example 1"
86
+ ---
87
+ # tner/twitter-roberta-base-dec2021-tweetner7-random
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.
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.6321284238886395
94
+ - Precision (micro): 0.6142015706806283
95
+ - Recall (micro): 0.6511332099907493
96
+ - F1 (macro): 0.583682304736069
97
+ - Precision (macro): 0.5654677691354458
98
+ - Recall (macro): 0.6047150410746663
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5019685039370079
104
+ - creative_work: 0.41401273885350315
105
+ - event: 0.4564727108705458
106
+ - group: 0.5892444737710327
107
+ - location: 0.6486486486486486
108
+ - person: 0.8268075031870332
109
+ - product: 0.6486215538847118
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6245116881258609, 0.6411928894306437]
114
+ - 95%: [0.6221686986039963, 0.642603475030015]
115
+ - F1 (macro):
116
+ - 90%: [0.6245116881258609, 0.6411928894306437]
117
+ - 95%: [0.6221686986039963, 0.642603475030015]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-dec2021-tweetner7-random/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-dec2021-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-dec2021-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-dec2021
143
+ - crf: True
144
+ - max_length: 128
145
+ - epoch: 30
146
+ - batch_size: 32
147
+ - lr: 0.0001
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-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.6390532544378698, "micro/f1_ci": {}, "micro/recall": 0.6342765616657768, "micro/precision": 0.6439024390243903, "macro/f1": 0.5948376345756554, "macro/f1_ci": {}, "macro/recall": 0.5917630600682918, "macro/precision": 0.5994147209089418, "per_entity_metric": {"corporation": {"f1": 0.5817307692307693, "f1_ci": {}, "precision": 0.5426008968609866, "recall": 0.6269430051813472}, "creative_work": {"f1": 0.4888888888888889, "f1_ci": {}, "precision": 0.5032679738562091, "recall": 0.47530864197530864}, "event": {"f1": 0.3907563025210084, "f1_ci": {}, "precision": 0.4025974025974026, "recall": 0.3795918367346939}, "group": {"f1": 0.6050670640834576, "f1_ci": {}, "precision": 0.6246153846153846, "recall": 0.5867052023121387}, "location": {"f1": 0.6191950464396285, "f1_ci": {}, "precision": 0.625, "recall": 0.6134969325153374}, "person": {"f1": 0.84593837535014, "f1_ci": {}, "precision": 0.8420074349442379, "recall": 0.849906191369606}, "product": {"f1": 0.632286995515695, "f1_ci": {}, "precision": 0.6558139534883721, "recall": 0.6103896103896104}}}, "2021.test": {"micro/f1": 0.6321284238886395, "micro/f1_ci": {"90": [0.6245116881258609, 0.6411928894306437], "95": [0.6221686986039963, 0.642603475030015]}, "micro/recall": 0.6511332099907493, "micro/precision": 0.6142015706806283, "macro/f1": 0.583682304736069, "macro/f1_ci": {"90": [0.5745215695064868, 0.5935538510061642], "95": [0.5721210274985685, 0.5949826139031175]}, "macro/recall": 0.6047150410746663, "macro/precision": 0.5654677691354458, "per_entity_metric": {"corporation": {"f1": 0.5019685039370079, "f1_ci": {"90": [0.4775046763935653, 0.5276263097468425], "95": [0.4708860124040466, 0.5322353978734399]}, "precision": 0.450530035335689, "recall": 0.5666666666666667}, "creative_work": {"f1": 0.41401273885350315, "f1_ci": {"90": [0.3838081951821538, 0.446030537527557], "95": [0.3785096669891205, 0.4516264083963575]}, "precision": 0.3873659117997616, "recall": 0.44459644322845415}, "event": {"f1": 0.4564727108705458, "f1_ci": {"90": [0.43317409571140686, 0.47845101312231], "95": [0.42696327577105797, 0.48275945643271434]}, "precision": 0.4525939177101968, "recall": 0.4604185623293904}, "group": {"f1": 0.5892444737710327, "f1_ci": {"90": [0.5689646859309015, 0.6108478406183305], "95": [0.564631734245271, 0.6146674362079695]}, "precision": 0.5902181097157965, "recall": 0.5882740447957839}, "location": {"f1": 0.6486486486486486, "f1_ci": {"90": [0.6209685619384042, 0.6762750470285591], "95": [0.6156787330316741, 0.6811199553135038]}, "precision": 0.6282722513089005, "recall": 0.6703910614525139}, "person": {"f1": 0.8268075031870332, "f1_ci": {"90": [0.8166678815298463, 0.8379175120851383], "95": [0.8152424612453091, 0.8395018891964325]}, "precision": 0.8168405901403383, "recall": 0.8370206489675516}, "product": {"f1": 0.6486215538847118, "f1_ci": {"90": [0.6270291403273055, 0.6710524317515882], "95": [0.6216769714725208, 0.674748088790642]}, "precision": 0.6324535679374389, "recall": 0.6656378600823045}}}, "2020.test": {"micro/f1": 0.6368775235531628, "micro/f1_ci": {"90": [0.6169064115810362, 0.6559384186705487], "95": [0.6141058003386577, 0.6594030324221372]}, "micro/recall": 0.6139076284379865, "micro/precision": 0.6616331096196868, "macro/f1": 0.5976605759407211, "macro/f1_ci": {"90": [0.5759632782880849, 0.6166251611368425], "95": [0.5736091476367275, 0.620115150872923]}, "macro/recall": 0.5812570646484104, "macro/precision": 0.6177069721428509, "per_entity_metric": {"corporation": {"f1": 0.56, "f1_ci": {"90": [0.5013616633738992, 0.6116487952836637], "95": [0.4910296600700221, 0.6227328614008941]}, "precision": 0.5358851674641149, "recall": 0.5863874345549738}, "creative_work": {"f1": 0.5166666666666666, "f1_ci": {"90": [0.46151629350476603, 0.5722086282622287], "95": [0.4514431946006749, 0.5835841303677111]}, "precision": 0.5138121546961326, "recall": 0.5195530726256983}, "event": {"f1": 0.4137931034482759, "f1_ci": {"90": [0.3618226809356626, 0.46421880458537457], "95": [0.35246839778317457, 0.47369129736369653]}, "precision": 0.4473684210526316, "recall": 0.3849056603773585}, "group": {"f1": 0.5693950177935941, "f1_ci": {"90": [0.5249356080118784, 0.6172953291232861], "95": [0.515244168484645, 0.6276404963608163]}, "precision": 0.6374501992031872, "recall": 0.5144694533762058}, "location": {"f1": 0.6747720364741642, "f1_ci": {"90": [0.6173401259613639, 0.7267984140530545], "95": [0.604807000719252, 0.7348546893498322]}, "precision": 0.676829268292683, "recall": 0.6727272727272727}, "person": {"f1": 0.8222029488291414, "f1_ci": {"90": [0.7938635459282011, 0.846929422548121], "95": [0.7895076867859065, 0.851171304347826]}, "precision": 0.8509874326750448, "recall": 0.7953020134228188}, "product": {"f1": 0.6267942583732058, "f1_ci": {"90": [0.5756898281700741, 0.6747046867175303], "95": [0.5657433380084151, 0.6810691357228119]}, "precision": 0.6616161616161617, "recall": 0.5954545454545455}}}, "2021.test (span detection)": {"micro/f1": 0.7703620544484986, "micro/f1_ci": {}, "micro/recall": 0.7935700242858795, "micro/precision": 0.7484729493891797, "macro/f1": 0.7703620544484986, "macro/f1_ci": {}, "macro/recall": 0.7935700242858795, "macro/precision": 0.7484729493891797}, "2020.test (span detection)": {"micro/f1": 0.7542395693135936, "micro/f1_ci": {}, "micro/recall": 0.7270368448365335, "micro/precision": 0.7835570469798657, "macro/f1": 0.7542395693135936, "macro/f1_ci": {}, "macro/recall": 0.7270368448365335, "macro/precision": 0.7835570469798657}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6368775235531628, "micro/f1_ci": {"90": [0.6169064115810362, 0.6559384186705487], "95": [0.6141058003386577, 0.6594030324221372]}, "micro/recall": 0.6139076284379865, "micro/precision": 0.6616331096196868, "macro/f1": 0.5976605759407211, "macro/f1_ci": {"90": [0.5759632782880849, 0.6166251611368425], "95": [0.5736091476367275, 0.620115150872923]}, "macro/recall": 0.5812570646484104, "macro/precision": 0.6177069721428509, "per_entity_metric": {"corporation": {"f1": 0.56, "f1_ci": {"90": [0.5013616633738992, 0.6116487952836637], "95": [0.4910296600700221, 0.6227328614008941]}, "precision": 0.5358851674641149, "recall": 0.5863874345549738}, "creative_work": {"f1": 0.5166666666666666, "f1_ci": {"90": [0.46151629350476603, 0.5722086282622287], "95": [0.4514431946006749, 0.5835841303677111]}, "precision": 0.5138121546961326, "recall": 0.5195530726256983}, "event": {"f1": 0.4137931034482759, "f1_ci": {"90": [0.3618226809356626, 0.46421880458537457], "95": [0.35246839778317457, 0.47369129736369653]}, "precision": 0.4473684210526316, "recall": 0.3849056603773585}, "group": {"f1": 0.5693950177935941, "f1_ci": {"90": [0.5249356080118784, 0.6172953291232861], "95": [0.515244168484645, 0.6276404963608163]}, "precision": 0.6374501992031872, "recall": 0.5144694533762058}, "location": {"f1": 0.6747720364741642, "f1_ci": {"90": [0.6173401259613639, 0.7267984140530545], "95": [0.604807000719252, 0.7348546893498322]}, "precision": 0.676829268292683, "recall": 0.6727272727272727}, "person": {"f1": 0.8222029488291414, "f1_ci": {"90": [0.7938635459282011, 0.846929422548121], "95": [0.7895076867859065, 0.851171304347826]}, "precision": 0.8509874326750448, "recall": 0.7953020134228188}, "product": {"f1": 0.6267942583732058, "f1_ci": {"90": [0.5756898281700741, 0.6747046867175303], "95": [0.5657433380084151, 0.6810691357228119]}, "precision": 0.6616161616161617, "recall": 0.5954545454545455}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6321284238886395, "micro/f1_ci": {"90": [0.6245116881258609, 0.6411928894306437], "95": [0.6221686986039963, 0.642603475030015]}, "micro/recall": 0.6511332099907493, "micro/precision": 0.6142015706806283, "macro/f1": 0.583682304736069, "macro/f1_ci": {"90": [0.5745215695064868, 0.5935538510061642], "95": [0.5721210274985685, 0.5949826139031175]}, "macro/recall": 0.6047150410746663, "macro/precision": 0.5654677691354458, "per_entity_metric": {"corporation": {"f1": 0.5019685039370079, "f1_ci": {"90": [0.4775046763935653, 0.5276263097468425], "95": [0.4708860124040466, 0.5322353978734399]}, "precision": 0.450530035335689, "recall": 0.5666666666666667}, "creative_work": {"f1": 0.41401273885350315, "f1_ci": {"90": [0.3838081951821538, 0.446030537527557], "95": [0.3785096669891205, 0.4516264083963575]}, "precision": 0.3873659117997616, "recall": 0.44459644322845415}, "event": {"f1": 0.4564727108705458, "f1_ci": {"90": [0.43317409571140686, 0.47845101312231], "95": [0.42696327577105797, 0.48275945643271434]}, "precision": 0.4525939177101968, "recall": 0.4604185623293904}, "group": {"f1": 0.5892444737710327, "f1_ci": {"90": [0.5689646859309015, 0.6108478406183305], "95": [0.564631734245271, 0.6146674362079695]}, "precision": 0.5902181097157965, "recall": 0.5882740447957839}, "location": {"f1": 0.6486486486486486, "f1_ci": {"90": [0.6209685619384042, 0.6762750470285591], "95": [0.6156787330316741, 0.6811199553135038]}, "precision": 0.6282722513089005, "recall": 0.6703910614525139}, "person": {"f1": 0.8268075031870332, "f1_ci": {"90": [0.8166678815298463, 0.8379175120851383], "95": [0.8152424612453091, 0.8395018891964325]}, "precision": 0.8168405901403383, "recall": 0.8370206489675516}, "product": {"f1": 0.6486215538847118, "f1_ci": {"90": [0.6270291403273055, 0.6710524317515882], "95": [0.6216769714725208, 0.674748088790642]}, "precision": 0.6324535679374389, "recall": 0.6656378600823045}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7542395693135936, "micro/f1_ci": {}, "micro/recall": 0.7270368448365335, "micro/precision": 0.7835570469798657, "macro/f1": 0.7542395693135936, "macro/f1_ci": {}, "macro/recall": 0.7270368448365335, "macro/precision": 0.7835570469798657}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7703620544484986, "micro/f1_ci": {}, "micro/recall": 0.7935700242858795, "micro/precision": 0.7484729493891797, "macro/f1": 0.7703620544484986, "macro/f1_ci": {}, "macro/recall": 0.7935700242858795, "macro/precision": 0.7484729493891797}
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-dec2021", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 0.0001, "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-dec2021", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 0.0001, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.15, "max_grad_norm": 1}