asahi417 commited on
Commit
a66495e
1 Parent(s): 05af0fe

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-dec2020-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.6397858647986788
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6303445180114465
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6495143385753932
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5891304279072724
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5792901831181549
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6004916851711928
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7786763868322132
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7671417349343508
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7905632011102116
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.6307439824945295
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6668594563331406
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5983393876491956
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.5851265852701386
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6174792176025484
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5588985785349839
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7534883720930233
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.796875
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7145822522055008
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-dec2020-tweetner7-2021
88
+
89
+ This model is a fine-tuned version of [cardiffnlp/twitter-roberta-base-dec2020](https://huggingface.co/cardiffnlp/twitter-roberta-base-dec2020) 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.6397858647986788
94
+ - Precision (micro): 0.6303445180114465
95
+ - Recall (micro): 0.6495143385753932
96
+ - F1 (macro): 0.5891304279072724
97
+ - Precision (macro): 0.5792901831181549
98
+ - Recall (macro): 0.6004916851711928
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5104384133611691
104
+ - creative_work: 0.4085603112840467
105
+ - event: 0.46204311152764754
106
+ - group: 0.6021505376344086
107
+ - location: 0.6555407209612816
108
+ - person: 0.826392644672796
109
+ - product: 0.658787255909558
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6313701951851352, 0.6488151576987361]
114
+ - 95%: [0.6299593452104588, 0.6503478811637856]
115
+ - F1 (macro):
116
+ - 90%: [0.6313701951851352, 0.6488151576987361]
117
+ - 95%: [0.6299593452104588, 0.6503478811637856]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-dec2020-tweetner7-2021/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-dec2020-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-dec2020-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-dec2020
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.3
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-dec2020-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.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6307439824945295, "micro/f1_ci": {"90": [0.6102472947732527, 0.650404791893514], "95": [0.6066659244881646, 0.6551370800608569]}, "micro/recall": 0.5983393876491956, "micro/precision": 0.6668594563331406, "macro/f1": 0.5851265852701386, "macro/f1_ci": {"90": [0.5626100847663879, 0.6066985869733091], "95": [0.5586539588597282, 0.6118777410922309]}, "macro/recall": 0.5588985785349839, "macro/precision": 0.6174792176025484, "per_entity_metric": {"corporation": {"f1": 0.5326370757180157, "f1_ci": {"90": [0.4769179826795721, 0.5844542430690521], "95": [0.46745014245014244, 0.592230183609494]}, "precision": 0.53125, "recall": 0.5340314136125655}, "creative_work": {"f1": 0.47093023255813954, "f1_ci": {"90": [0.413991114256507, 0.5249247836611491], "95": [0.3999667774086378, 0.5404186843796873]}, "precision": 0.4909090909090909, "recall": 0.45251396648044695}, "event": {"f1": 0.40918580375782876, "f1_ci": {"90": [0.35343385463402127, 0.46590993956852067], "95": [0.34434854592571257, 0.47656826872362873]}, "precision": 0.45794392523364486, "recall": 0.36981132075471695}, "group": {"f1": 0.5645756457564576, "f1_ci": {"90": [0.513329584802793, 0.6181970970206264], "95": [0.5, 0.6299714678464579]}, "precision": 0.6623376623376623, "recall": 0.4919614147909968}, "location": {"f1": 0.6486486486486486, "f1_ci": {"90": [0.5855182926829268, 0.7062155275025566], "95": [0.5733322475570033, 0.7143000573723465]}, "precision": 0.6428571428571429, "recall": 0.6545454545454545}, "person": {"f1": 0.8209982788296041, "f1_ci": {"90": [0.7960340427408376, 0.8444893951553826], "95": [0.7903046285974032, 0.8484873021715126]}, "precision": 0.842756183745583, "recall": 0.8003355704697986}, "product": {"f1": 0.648910411622276, "f1_ci": {"90": [0.5963697060288989, 0.698992051833587], "95": [0.5846028037383177, 0.7090498852352677]}, "precision": 0.694300518134715, "recall": 0.6090909090909091}}}
eval/{metric.json → metric.test_2021.json} RENAMED
@@ -1 +1 @@
1
- {"2021.dev": {"micro/f1": 0.6339737108190091, "micro/f1_ci": {}, "micro/recall": 0.627, "micro/precision": 0.6411042944785276, "macro/f1": 0.5896661803293899, "macro/f1_ci": {}, "macro/recall": 0.5872880435385428, "macro/precision": 0.5936900880671295, "per_entity_metric": {"corporation": {"f1": 0.5849056603773585, "f1_ci": {}, "precision": 0.5636363636363636, "recall": 0.6078431372549019}, "creative_work": {"f1": 0.4743589743589744, "f1_ci": {}, "precision": 0.45121951219512196, "recall": 0.5}, "event": {"f1": 0.40800000000000003, "f1_ci": {}, "precision": 0.42857142857142855, "recall": 0.3893129770992366}, "group": {"f1": 0.6261682242990654, "f1_ci": {}, "precision": 0.6666666666666666, "recall": 0.5903083700440529}, "location": {"f1": 0.619718309859155, "f1_ci": {}, "precision": 0.6285714285714286, "recall": 0.6111111111111112}, "person": {"f1": 0.8181818181818181, "f1_ci": {}, "precision": 0.8096885813148789, "recall": 0.8268551236749117}, "product": {"f1": 0.5963302752293578, "f1_ci": {}, "precision": 0.6074766355140186, "recall": 0.5855855855855856}}}, "2021.test": {"micro/f1": 0.6397858647986788, "micro/f1_ci": {"90": [0.6313701951851352, 0.6488151576987361], "95": [0.6299593452104588, 0.6503478811637856]}, "micro/recall": 0.6495143385753932, "micro/precision": 0.6303445180114465, "macro/f1": 0.5891304279072724, "macro/f1_ci": {"90": [0.579831722519424, 0.5990703030466004], "95": [0.5785446223576134, 0.600957755164742]}, "macro/recall": 0.6004916851711928, "macro/precision": 0.5792901831181549, "per_entity_metric": {"corporation": {"f1": 0.5104384133611691, "f1_ci": {"90": [0.48464818510975904, 0.5356305362374818], "95": [0.4800820285084694, 0.540708357567894]}, "precision": 0.4812992125984252, "recall": 0.5433333333333333}, "creative_work": {"f1": 0.4085603112840467, "f1_ci": {"90": [0.38044431652186644, 0.4388461424718239], "95": [0.3756210936956249, 0.44642063710750324]}, "precision": 0.3884093711467324, "recall": 0.43091655266757867}, "event": {"f1": 0.46204311152764754, "f1_ci": {"90": [0.4365142040968089, 0.48499682354280577], "95": [0.43265719518867995, 0.48944974563413657]}, "precision": 0.47632850241545893, "recall": 0.44858962693357596}, "group": {"f1": 0.6021505376344086, "f1_ci": {"90": [0.5829088781500328, 0.6233689895493891], "95": [0.5796706980466934, 0.6273276006621189]}, "precision": 0.6145404663923183, "recall": 0.5902503293807642}, "location": {"f1": 0.6555407209612816, "f1_ci": {"90": [0.6288757917555804, 0.6832310667607882], "95": [0.6248056430748739, 0.6864471234713486]}, "precision": 0.6278772378516624, "recall": 0.6857541899441341}, "person": {"f1": 0.826392644672796, "f1_ci": {"90": [0.8161829713008001, 0.8365602955666955], "95": [0.8139679906043208, 0.838441808248624]}, "precision": 0.8084656084656084, "recall": 0.8451327433628318}, "product": {"f1": 0.658787255909558, "f1_ci": {"90": [0.6374469229500973, 0.6802850060689898], "95": [0.6341189720797799, 0.6837985569099514]}, "precision": 0.6581108829568788, "recall": 0.6594650205761317}}}, "2020.test": {"micro/f1": 0.6307439824945295, "micro/f1_ci": {"90": [0.6102472947732527, 0.650404791893514], "95": [0.6066659244881646, 0.6551370800608569]}, "micro/recall": 0.5983393876491956, "micro/precision": 0.6668594563331406, "macro/f1": 0.5851265852701386, "macro/f1_ci": {"90": [0.5626100847663879, 0.6066985869733091], "95": [0.5586539588597282, 0.6118777410922309]}, "macro/recall": 0.5588985785349839, "macro/precision": 0.6174792176025484, "per_entity_metric": {"corporation": {"f1": 0.5326370757180157, "f1_ci": {"90": [0.4769179826795721, 0.5844542430690521], "95": [0.46745014245014244, 0.592230183609494]}, "precision": 0.53125, "recall": 0.5340314136125655}, "creative_work": {"f1": 0.47093023255813954, "f1_ci": {"90": [0.413991114256507, 0.5249247836611491], "95": [0.3999667774086378, 0.5404186843796873]}, "precision": 0.4909090909090909, "recall": 0.45251396648044695}, "event": {"f1": 0.40918580375782876, "f1_ci": {"90": [0.35343385463402127, 0.46590993956852067], "95": [0.34434854592571257, 0.47656826872362873]}, "precision": 0.45794392523364486, "recall": 0.36981132075471695}, "group": {"f1": 0.5645756457564576, "f1_ci": {"90": [0.513329584802793, 0.6181970970206264], "95": [0.5, 0.6299714678464579]}, "precision": 0.6623376623376623, "recall": 0.4919614147909968}, "location": {"f1": 0.6486486486486486, "f1_ci": {"90": [0.5855182926829268, 0.7062155275025566], "95": [0.5733322475570033, 0.7143000573723465]}, "precision": 0.6428571428571429, "recall": 0.6545454545454545}, "person": {"f1": 0.8209982788296041, "f1_ci": {"90": [0.7960340427408376, 0.8444893951553826], "95": [0.7903046285974032, 0.8484873021715126]}, "precision": 0.842756183745583, "recall": 0.8003355704697986}, "product": {"f1": 0.648910411622276, "f1_ci": {"90": [0.5963697060288989, 0.698992051833587], "95": [0.5846028037383177, 0.7090498852352677]}, "precision": 0.694300518134715, "recall": 0.6090909090909091}}}, "2021.test (span detection)": {"micro/f1": 0.7786763868322132, "micro/f1_ci": {}, "micro/recall": 0.7905632011102116, "micro/precision": 0.7671417349343508, "macro/f1": 0.7786763868322132, "macro/f1_ci": {}, "macro/recall": 0.7905632011102116, "macro/precision": 0.7671417349343508}, "2020.test (span detection)": {"micro/f1": 0.7534883720930233, "micro/f1_ci": {}, "micro/recall": 0.7145822522055008, "micro/precision": 0.796875, "macro/f1": 0.7534883720930233, "macro/f1_ci": {}, "macro/recall": 0.7145822522055008, "macro/precision": 0.796875}}
 
1
+ {"micro/f1": 0.6397858647986788, "micro/f1_ci": {"90": [0.6313701951851352, 0.6488151576987361], "95": [0.6299593452104588, 0.6503478811637856]}, "micro/recall": 0.6495143385753932, "micro/precision": 0.6303445180114465, "macro/f1": 0.5891304279072724, "macro/f1_ci": {"90": [0.579831722519424, 0.5990703030466004], "95": [0.5785446223576134, 0.600957755164742]}, "macro/recall": 0.6004916851711928, "macro/precision": 0.5792901831181549, "per_entity_metric": {"corporation": {"f1": 0.5104384133611691, "f1_ci": {"90": [0.48464818510975904, 0.5356305362374818], "95": [0.4800820285084694, 0.540708357567894]}, "precision": 0.4812992125984252, "recall": 0.5433333333333333}, "creative_work": {"f1": 0.4085603112840467, "f1_ci": {"90": [0.38044431652186644, 0.4388461424718239], "95": [0.3756210936956249, 0.44642063710750324]}, "precision": 0.3884093711467324, "recall": 0.43091655266757867}, "event": {"f1": 0.46204311152764754, "f1_ci": {"90": [0.4365142040968089, 0.48499682354280577], "95": [0.43265719518867995, 0.48944974563413657]}, "precision": 0.47632850241545893, "recall": 0.44858962693357596}, "group": {"f1": 0.6021505376344086, "f1_ci": {"90": [0.5829088781500328, 0.6233689895493891], "95": [0.5796706980466934, 0.6273276006621189]}, "precision": 0.6145404663923183, "recall": 0.5902503293807642}, "location": {"f1": 0.6555407209612816, "f1_ci": {"90": [0.6288757917555804, 0.6832310667607882], "95": [0.6248056430748739, 0.6864471234713486]}, "precision": 0.6278772378516624, "recall": 0.6857541899441341}, "person": {"f1": 0.826392644672796, "f1_ci": {"90": [0.8161829713008001, 0.8365602955666955], "95": [0.8139679906043208, 0.838441808248624]}, "precision": 0.8084656084656084, "recall": 0.8451327433628318}, "product": {"f1": 0.658787255909558, "f1_ci": {"90": [0.6374469229500973, 0.6802850060689898], "95": [0.6341189720797799, 0.6837985569099514]}, "precision": 0.6581108829568788, "recall": 0.6594650205761317}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7534883720930233, "micro/f1_ci": {}, "micro/recall": 0.7145822522055008, "micro/precision": 0.796875, "macro/f1": 0.7534883720930233, "macro/f1_ci": {}, "macro/recall": 0.7145822522055008, "macro/precision": 0.796875}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7786763868322132, "micro/f1_ci": {}, "micro/recall": 0.7905632011102116, "micro/precision": 0.7671417349343508, "macro/f1": 0.7786763868322132, "macro/f1_ci": {}, "macro/recall": 0.7905632011102116, "macro/precision": 0.7671417349343508}
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-dec2020", "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.3, "max_grad_norm": 1}
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_2021", "dataset_name": null, "local_dataset": null, "model": "cardiffnlp/twitter-roberta-base-dec2020", "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.3, "max_grad_norm": 1}