asahi417 commited on
Commit
c73032f
1 Parent(s): 8ec4407

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-2021
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.6346897022050466
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6240500670540903
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6456984273820536
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.586830362928695
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5777962671668668
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5983908809408913
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.77487922705314
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7618462226195798
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7883659072510697
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.6225596529284164
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6519023282226007
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5957446808510638
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.578847416026638
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6085991227224318
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5537596756202443
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7413232104121477
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7762634866553095
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7093928386092372
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-2021
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_2021` 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.6346897022050466
94
+ - Precision (micro): 0.6240500670540903
95
+ - Recall (micro): 0.6456984273820536
96
+ - F1 (macro): 0.586830362928695
97
+ - Precision (macro): 0.5777962671668668
98
+ - Recall (macro): 0.5983908809408913
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.47679083094555874
104
+ - creative_work: 0.4394942805538832
105
+ - event: 0.4638082065467958
106
+ - group: 0.5936801787424194
107
+ - location: 0.646505376344086
108
+ - person: 0.8201674554058972
109
+ - product: 0.6673662119622246
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6258493958055198, 0.6436753593746133]
114
+ - 95%: [0.6239476803844971, 0.645859449522042]
115
+ - F1 (macro):
116
+ - 90%: [0.6258493958055198, 0.6436753593746133]
117
+ - 95%: [0.6239476803844971, 0.645859449522042]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-dec2021-tweetner7-2021/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-dec2021-tweetner7-2021/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-2021")
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_2021
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-2021/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
- {"2021.dev": {"micro/f1": 0.6218655967903711, "micro/f1_ci": {}, "micro/recall": 0.62, "micro/precision": 0.6237424547283702, "macro/f1": 0.5760577473801914, "macro/f1_ci": {}, "macro/recall": 0.5737958267673842, "macro/precision": 0.5822767568872816, "per_entity_metric": {"corporation": {"f1": 0.5670103092783505, "f1_ci": {}, "precision": 0.5978260869565217, "recall": 0.5392156862745098}, "creative_work": {"f1": 0.43529411764705883, "f1_ci": {}, "precision": 0.3854166666666667, "recall": 0.5}, "event": {"f1": 0.40944881889763773, "f1_ci": {}, "precision": 0.42276422764227645, "recall": 0.3969465648854962}, "group": {"f1": 0.6085011185682326, "f1_ci": {}, "precision": 0.6181818181818182, "recall": 0.5991189427312775}, "location": {"f1": 0.591549295774648, "f1_ci": {}, "precision": 0.6, "recall": 0.5833333333333334}, "person": {"f1": 0.8089500860585198, "f1_ci": {}, "precision": 0.7885906040268457, "recall": 0.8303886925795053}, "product": {"f1": 0.6116504854368933, "f1_ci": {}, "precision": 0.6631578947368421, "recall": 0.5675675675675675}}}, "2021.test": {"micro/f1": 0.6346897022050466, "micro/f1_ci": {"90": [0.6258493958055198, 0.6436753593746133], "95": [0.6239476803844971, 0.645859449522042]}, "micro/recall": 0.6456984273820536, "micro/precision": 0.6240500670540903, "macro/f1": 0.586830362928695, "macro/f1_ci": {"90": [0.5771640962569892, 0.5964231357348152], "95": [0.5752576281332251, 0.5978908050403762]}, "macro/recall": 0.5983908809408913, "macro/precision": 0.5777962671668668, "per_entity_metric": {"corporation": {"f1": 0.47679083094555874, "f1_ci": {"90": [0.44962110787681986, 0.5026906852126324], "95": [0.44365607999181766, 0.5066567600970541]}, "precision": 0.49230769230769234, "recall": 0.4622222222222222}, "creative_work": {"f1": 0.4394942805538832, "f1_ci": {"90": [0.4094896245645097, 0.47030672977531146], "95": [0.4045742789092769, 0.47468701533345065]}, "precision": 0.3924731182795699, "recall": 0.4993160054719562}, "event": {"f1": 0.4638082065467958, "f1_ci": {"90": [0.43910944336457225, 0.4870765791700006], "95": [0.4365052503299458, 0.49078351018856553]}, "precision": 0.4700934579439252, "recall": 0.45768880800727935}, "group": {"f1": 0.5936801787424194, "f1_ci": {"90": [0.572508763379824, 0.6152662972615333], "95": [0.5691102521455328, 0.6196567468373919]}, "precision": 0.5758513931888545, "recall": 0.6126482213438735}, "location": {"f1": 0.646505376344086, "f1_ci": {"90": [0.6196162284066153, 0.6739581938679877], "95": [0.6134858292007842, 0.6786011609002209]}, "precision": 0.6230569948186528, "recall": 0.6717877094972067}, "person": {"f1": 0.8201674554058972, "f1_ci": {"90": [0.8092938133961863, 0.831688063557384], "95": [0.8071047952694514, 0.8335989757976281]}, "precision": 0.8098490294751977, "recall": 0.8307522123893806}, "product": {"f1": 0.6673662119622246, "f1_ci": {"90": [0.645805115139754, 0.6879920293654955], "95": [0.6426681184443668, 0.6919908598661983]}, "precision": 0.6809421841541756, "recall": 0.654320987654321}}}, "2020.test": {"micro/f1": 0.6225596529284164, "micro/f1_ci": {"90": [0.6019905097377952, 0.6423539604890164], "95": [0.5983476899788864, 0.6462412396621156]}, "micro/recall": 0.5957446808510638, "micro/precision": 0.6519023282226007, "macro/f1": 0.578847416026638, "macro/f1_ci": {"90": [0.5562972923933772, 0.5997658810655637], "95": [0.5527899851014745, 0.6043389771515122]}, "macro/recall": 0.5537596756202443, "macro/precision": 0.6085991227224318, "per_entity_metric": {"corporation": {"f1": 0.534435261707989, "f1_ci": {"90": [0.47284258230309767, 0.5900909519728407], "95": [0.4602715480664323, 0.6000127226463106]}, "precision": 0.563953488372093, "recall": 0.5078534031413613}, "creative_work": {"f1": 0.4754098360655738, "f1_ci": {"90": [0.4173550724637681, 0.5336544456167273], "95": [0.40729210272464195, 0.5422017152091206]}, "precision": 0.46524064171123, "recall": 0.4860335195530726}, "event": {"f1": 0.4296875, "f1_ci": {"90": [0.37522969052224375, 0.4818120260021668], "95": [0.3632396449704142, 0.48974936278674613]}, "precision": 0.44534412955465585, "recall": 0.41509433962264153}, "group": {"f1": 0.5376344086021505, "f1_ci": {"90": [0.4799852398523985, 0.5894486870704341], "95": [0.4690353394343622, 0.5983626121961282]}, "precision": 0.6072874493927125, "recall": 0.48231511254019294}, "location": {"f1": 0.6149068322981366, "f1_ci": {"90": [0.5443919770773639, 0.6801455414358639], "95": [0.5262757654592755, 0.6942954434100932]}, "precision": 0.6305732484076433, "recall": 0.6}, "person": {"f1": 0.8164665523156088, "f1_ci": {"90": [0.7882536040376671, 0.8402708997285495], "95": [0.7829841079059829, 0.8457393226658165]}, "precision": 0.8350877192982457, "recall": 0.7986577181208053}, "product": {"f1": 0.6433915211970074, "f1_ci": {"90": [0.5870512960868032, 0.6978238860148408], "95": [0.5771771057252095, 0.7093856924920999]}, "precision": 0.712707182320442, "recall": 0.5863636363636363}}}, "2021.test (span detection)": {"micro/f1": 0.77487922705314, "micro/f1_ci": {}, "micro/recall": 0.7883659072510697, "micro/precision": 0.7618462226195798, "macro/f1": 0.77487922705314, "macro/f1_ci": {}, "macro/recall": 0.7883659072510697, "macro/precision": 0.7618462226195798}, "2020.test (span detection)": {"micro/f1": 0.7413232104121477, "micro/f1_ci": {}, "micro/recall": 0.7093928386092372, "micro/precision": 0.7762634866553095, "macro/f1": 0.7413232104121477, "macro/f1_ci": {}, "macro/recall": 0.7093928386092372, "macro/precision": 0.7762634866553095}}
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6225596529284164, "micro/f1_ci": {"90": [0.6019905097377952, 0.6423539604890164], "95": [0.5983476899788864, 0.6462412396621156]}, "micro/recall": 0.5957446808510638, "micro/precision": 0.6519023282226007, "macro/f1": 0.578847416026638, "macro/f1_ci": {"90": [0.5562972923933772, 0.5997658810655637], "95": [0.5527899851014745, 0.6043389771515122]}, "macro/recall": 0.5537596756202443, "macro/precision": 0.6085991227224318, "per_entity_metric": {"corporation": {"f1": 0.534435261707989, "f1_ci": {"90": [0.47284258230309767, 0.5900909519728407], "95": [0.4602715480664323, 0.6000127226463106]}, "precision": 0.563953488372093, "recall": 0.5078534031413613}, "creative_work": {"f1": 0.4754098360655738, "f1_ci": {"90": [0.4173550724637681, 0.5336544456167273], "95": [0.40729210272464195, 0.5422017152091206]}, "precision": 0.46524064171123, "recall": 0.4860335195530726}, "event": {"f1": 0.4296875, "f1_ci": {"90": [0.37522969052224375, 0.4818120260021668], "95": [0.3632396449704142, 0.48974936278674613]}, "precision": 0.44534412955465585, "recall": 0.41509433962264153}, "group": {"f1": 0.5376344086021505, "f1_ci": {"90": [0.4799852398523985, 0.5894486870704341], "95": [0.4690353394343622, 0.5983626121961282]}, "precision": 0.6072874493927125, "recall": 0.48231511254019294}, "location": {"f1": 0.6149068322981366, "f1_ci": {"90": [0.5443919770773639, 0.6801455414358639], "95": [0.5262757654592755, 0.6942954434100932]}, "precision": 0.6305732484076433, "recall": 0.6}, "person": {"f1": 0.8164665523156088, "f1_ci": {"90": [0.7882536040376671, 0.8402708997285495], "95": [0.7829841079059829, 0.8457393226658165]}, "precision": 0.8350877192982457, "recall": 0.7986577181208053}, "product": {"f1": 0.6433915211970074, "f1_ci": {"90": [0.5870512960868032, 0.6978238860148408], "95": [0.5771771057252095, 0.7093856924920999]}, "precision": 0.712707182320442, "recall": 0.5863636363636363}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6346897022050466, "micro/f1_ci": {"90": [0.6258493958055198, 0.6436753593746133], "95": [0.6239476803844971, 0.645859449522042]}, "micro/recall": 0.6456984273820536, "micro/precision": 0.6240500670540903, "macro/f1": 0.586830362928695, "macro/f1_ci": {"90": [0.5771640962569892, 0.5964231357348152], "95": [0.5752576281332251, 0.5978908050403762]}, "macro/recall": 0.5983908809408913, "macro/precision": 0.5777962671668668, "per_entity_metric": {"corporation": {"f1": 0.47679083094555874, "f1_ci": {"90": [0.44962110787681986, 0.5026906852126324], "95": [0.44365607999181766, 0.5066567600970541]}, "precision": 0.49230769230769234, "recall": 0.4622222222222222}, "creative_work": {"f1": 0.4394942805538832, "f1_ci": {"90": [0.4094896245645097, 0.47030672977531146], "95": [0.4045742789092769, 0.47468701533345065]}, "precision": 0.3924731182795699, "recall": 0.4993160054719562}, "event": {"f1": 0.4638082065467958, "f1_ci": {"90": [0.43910944336457225, 0.4870765791700006], "95": [0.4365052503299458, 0.49078351018856553]}, "precision": 0.4700934579439252, "recall": 0.45768880800727935}, "group": {"f1": 0.5936801787424194, "f1_ci": {"90": [0.572508763379824, 0.6152662972615333], "95": [0.5691102521455328, 0.6196567468373919]}, "precision": 0.5758513931888545, "recall": 0.6126482213438735}, "location": {"f1": 0.646505376344086, "f1_ci": {"90": [0.6196162284066153, 0.6739581938679877], "95": [0.6134858292007842, 0.6786011609002209]}, "precision": 0.6230569948186528, "recall": 0.6717877094972067}, "person": {"f1": 0.8201674554058972, "f1_ci": {"90": [0.8092938133961863, 0.831688063557384], "95": [0.8071047952694514, 0.8335989757976281]}, "precision": 0.8098490294751977, "recall": 0.8307522123893806}, "product": {"f1": 0.6673662119622246, "f1_ci": {"90": [0.645805115139754, 0.6879920293654955], "95": [0.6426681184443668, 0.6919908598661983]}, "precision": 0.6809421841541756, "recall": 0.654320987654321}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7413232104121477, "micro/f1_ci": {}, "micro/recall": 0.7093928386092372, "micro/precision": 0.7762634866553095, "macro/f1": 0.7413232104121477, "macro/f1_ci": {}, "macro/recall": 0.7093928386092372, "macro/precision": 0.7762634866553095}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.77487922705314, "micro/f1_ci": {}, "micro/recall": 0.7883659072510697, "micro/precision": 0.7618462226195798, "macro/f1": 0.77487922705314, "macro/f1_ci": {}, "macro/recall": 0.7883659072510697, "macro/precision": 0.7618462226195798}
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.dev.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": "2021.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_2021", "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}