asahi417 commited on
Commit
9bb8d82
1 Parent(s): e56a09a

model update

Browse files
README.md ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - tner/tweetner7
4
+ metrics:
5
+ - f1
6
+ - precision
7
+ - recall
8
+ model-index:
9
+ - name: tner/roberta-large-tweetner7-2020-selflabel2021-continuous
10
+ results:
11
+ - task:
12
+ name: Token Classification
13
+ type: token-classification
14
+ dataset:
15
+ name: tner/tweetner7
16
+ type: tner/tweetner7
17
+ args: tner/tweetner7
18
+ metrics:
19
+ - name: F1 (test_2021)
20
+ type: f1
21
+ value: 0.644817329816488
22
+ - name: Precision (test_2021)
23
+ type: precision
24
+ value: 0.6264311416421328
25
+ - name: Recall (test_2021)
26
+ type: recall
27
+ value: 0.6643154486586494
28
+ - name: Macro F1 (test_2021)
29
+ type: f1_macro
30
+ value: 0.5941147287547678
31
+ - name: Macro Precision (test_2021)
32
+ type: precision_macro
33
+ value: 0.5756979462999651
34
+ - name: Macro Recall (test_2021)
35
+ type: recall_macro
36
+ value: 0.6198566504961354
37
+ - name: Entity Span F1 (test_2021)
38
+ type: f1_entity_span
39
+ value: 0.7835896284655965
40
+ - name: Entity Span Precision (test_2020)
41
+ type: precision_entity_span
42
+ value: 0.7612037945698397
43
+ - name: Entity Span Recall (test_2021)
44
+ type: recall_entity_span
45
+ value: 0.8073320226668209
46
+ - name: F1 (test_2020)
47
+ type: f1
48
+ value: 0.6548100242522231
49
+ - name: Precision (test_2020)
50
+ type: precision
51
+ value: 0.6810538116591929
52
+ - name: Recall (test_2020)
53
+ type: recall
54
+ value: 0.6305137519460301
55
+ - name: Macro F1 (test_2020)
56
+ type: f1_macro
57
+ value: 0.6141867781768393
58
+ - name: Macro Precision (test_2020)
59
+ type: precision_macro
60
+ value: 0.6354522364268572
61
+ - name: Macro Recall (test_2020)
62
+ type: recall_macro
63
+ value: 0.5987967256237715
64
+ - name: Entity Span F1 (test_2020)
65
+ type: f1_entity_span
66
+ value: 0.7649595687331536
67
+ - name: Entity Span Precision (test_2020)
68
+ type: precision_entity_span
69
+ value: 0.7958496915311273
70
+ - name: Entity Span Recall (test_2020)
71
+ type: recall_entity_span
72
+ value: 0.736377789309808
73
+
74
+ pipeline_tag: token-classification
75
+ widget:
76
+ - text: "Get the all-analog Classic Vinyl Edition of `Takin' Off` Album from {{@Herbie Hancock@}} via {{USERNAME}} link below: {{URL}}"
77
+ example_title: "NER Example 1"
78
+ ---
79
+ # tner/roberta-large-tweetner7-2020-selflabel2021-continuous
80
+
81
+ This model is a fine-tuned version of [tner/roberta-large-tweetner-2020](https://huggingface.co/tner/roberta-large-tweetner-2020) on the
82
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train` split). This model is fine-tuned on self-labeled dataset which is the `extra_2021` split of the [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) annotated by [tner/roberta-large](https://huggingface.co/tner/tner/roberta-large-tweetner7-2020)). Please check [https://github.com/asahi417/tner/tree/master/examples/tweetner7_paper#model-fine-tuning-self-labeling](https://github.com/asahi417/tner/tree/master/examples/tweetner7_paper#model-fine-tuning-self-labeling) for more detail of reproducing the model. The model is first fine-tuned on `train_2020`, and then continuously fine-tuned on the self-labeled dataset.
83
+ Model fine-tuning is done via [T-NER](https://github.com/asahi417/tner)'s hyper-parameter search (see the repository
84
+ for more detail). It achieves the following results on the test set of 2021:
85
+ - F1 (micro): 0.644817329816488
86
+ - Precision (micro): 0.6264311416421328
87
+ - Recall (micro): 0.6643154486586494
88
+ - F1 (macro): 0.5941147287547678
89
+ - Precision (macro): 0.5756979462999651
90
+ - Recall (macro): 0.6198566504961354
91
+
92
+
93
+
94
+ The per-entity breakdown of the F1 score on the test set are below:
95
+ - corporation: 0.5058051489146896
96
+ - creative_work: 0.4567022538552788
97
+ - event: 0.4439876670092498
98
+ - group: 0.6109472304162569
99
+ - location: 0.6636304489264802
100
+ - person: 0.8363309352517986
101
+ - product: 0.6413994169096211
102
+
103
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
104
+ - F1 (micro):
105
+ - 90%: [0.6360417063561062, 0.6548454319775926]
106
+ - 95%: [0.6341460646789854, 0.6560370464501823]
107
+ - F1 (macro):
108
+ - 90%: [0.6360417063561062, 0.6548454319775926]
109
+ - 95%: [0.6341460646789854, 0.6560370464501823]
110
+
111
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-tweetner7-2020-selflabel2021-continuous/raw/main/eval/metric.json)
112
+ and [metric file of entity span](https://huggingface.co/tner/roberta-large-tweetner7-2020-selflabel2021-continuous/raw/main/eval/metric_span.json).
113
+
114
+ ### Usage
115
+ This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
116
+ ```shell
117
+ pip install tner
118
+ ```
119
+ and activate model as below.
120
+ ```python
121
+ from tner import TransformersNER
122
+ model = TransformersNER("tner/roberta-large-tweetner7-2020-selflabel2021-continuous")
123
+ model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
124
+ ```
125
+ It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
126
+
127
+ ### Training hyperparameters
128
+
129
+ The following hyperparameters were used during training:
130
+ - dataset: ['tner/tweetner7']
131
+ - dataset_split: train
132
+ - dataset_name: None
133
+ - local_dataset: {'train': 'tweet_ner/2021.extra.tner/roberta-large-2020.txt', 'validation': 'tweet_ner/2020.dev.txt'}
134
+ - model: tner/roberta-large-tweetner-2020
135
+ - crf: True
136
+ - max_length: 128
137
+ - epoch: 30
138
+ - batch_size: 32
139
+ - lr: 1e-05
140
+ - random_seed: 0
141
+ - gradient_accumulation_steps: 1
142
+ - weight_decay: 1e-07
143
+ - lr_warmup_step_ratio: 0.3
144
+ - max_grad_norm: 1
145
+
146
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/roberta-large-tweetner7-2020-selflabel2021-continuous/raw/main/trainer_config.json).
147
+
148
+ ### Reference
149
+ If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
150
+
151
+ ```
152
+
153
+ @inproceedings{ushio-camacho-collados-2021-ner,
154
+ title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
155
+ author = "Ushio, Asahi and
156
+ Camacho-Collados, Jose",
157
+ booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
158
+ month = apr,
159
+ year = "2021",
160
+ address = "Online",
161
+ publisher = "Association for Computational Linguistics",
162
+ url = "https://aclanthology.org/2021.eacl-demos.7",
163
+ doi = "10.18653/v1/2021.eacl-demos.7",
164
+ pages = "53--62",
165
+ 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.",
166
+ }
167
+
168
+ ```
eval/metric.json DELETED
@@ -1 +0,0 @@
1
- {"2020.dev": {"micro/f1": 0.6524093123984841, "micro/f1_ci": {}, "micro/recall": 0.6295715778474399, "micro/precision": 0.6769662921348315, "macro/f1": 0.5953364408334074, "macro/f1_ci": {}, "macro/recall": 0.582165610190696, "macro/precision": 0.6144459451639951, "per_entity_metric": {"corporation": {"f1": 0.4948453608247423, "f1_ci": {}, "precision": 0.518918918918919, "recall": 0.4729064039408867}, "creative_work": {"f1": 0.5311004784688995, "f1_ci": {}, "precision": 0.5285714285714286, "recall": 0.5336538461538461}, "event": {"f1": 0.38604651162790693, "f1_ci": {}, "precision": 0.47701149425287354, "recall": 0.32421875}, "group": {"f1": 0.5839080459770116, "f1_ci": {}, "precision": 0.6105769230769231, "recall": 0.5594713656387665}, "location": {"f1": 0.6597938144329896, "f1_ci": {}, "precision": 0.6183574879227053, "recall": 0.7071823204419889}, "person": {"f1": 0.8798617113223853, "f1_ci": {}, "precision": 0.9105545617173524, "recall": 0.8511705685618729}, "product": {"f1": 0.6317991631799162, "f1_ci": {}, "precision": 0.6371308016877637, "recall": 0.6265560165975104}}}, "2021.test": {"micro/f1": 0.644817329816488, "micro/f1_ci": {"90": [0.6360417063561062, 0.6548454319775926], "95": [0.6341460646789854, 0.6560370464501823]}, "micro/recall": 0.6643154486586494, "micro/precision": 0.6264311416421328, "macro/f1": 0.5941147287547678, "macro/f1_ci": {"90": [0.5848414121578911, 0.6038057826115886], "95": [0.5820350845478711, 0.6060513462576288]}, "macro/recall": 0.6198566504961354, "macro/precision": 0.5756979462999651, "per_entity_metric": {"corporation": {"f1": 0.5058051489146896, "f1_ci": {"90": [0.48313912449808494, 0.530618218018915], "95": [0.47849280777812037, 0.5364444847786444]}, "precision": 0.46345975948196116, "recall": 0.5566666666666666}, "creative_work": {"f1": 0.4567022538552788, "f1_ci": {"90": [0.4278100225875855, 0.48546083866545087], "95": [0.42264104037430955, 0.4888449366028564]}, "precision": 0.4031413612565445, "recall": 0.5266757865937073}, "event": {"f1": 0.4439876670092498, "f1_ci": {"90": [0.41927814019962656, 0.46943924364462264], "95": [0.41511298597332785, 0.4726621822818196]}, "precision": 0.5100354191263282, "recall": 0.39308462238398545}, "group": {"f1": 0.6109472304162569, "f1_ci": {"90": [0.5912129562296317, 0.6328091890001382], "95": [0.5873284405198267, 0.6381933587682634]}, "precision": 0.6079582517938682, "recall": 0.613965744400527}, "location": {"f1": 0.6636304489264802, "f1_ci": {"90": [0.6359840503874383, 0.6900245167821328], "95": [0.6290236787920385, 0.6962843529176078]}, "precision": 0.6211936662606578, "recall": 0.7122905027932961}, "person": {"f1": 0.8363309352517986, "f1_ci": {"90": [0.8258310265077387, 0.8472827346138416], "95": [0.8238782456842353, 0.849028697845626]}, "precision": 0.8163623595505618, "recall": 0.8573008849557522}, "product": {"f1": 0.6413994169096211, "f1_ci": {"90": [0.6184853422878562, 0.6632819776388246], "95": [0.6137694360418035, 0.6673396278232638]}, "precision": 0.6077348066298343, "recall": 0.6790123456790124}}}, "2020.test": {"micro/f1": 0.6548100242522231, "micro/f1_ci": {"90": [0.6363849446917261, 0.6729678638941399], "95": [0.632988010266229, 0.6761782355773874]}, "micro/recall": 0.6305137519460301, "micro/precision": 0.6810538116591929, "macro/f1": 0.6141867781768393, "macro/f1_ci": {"90": [0.5927615570590863, 0.63339395597405], "95": [0.5897139460819198, 0.636699176958749]}, "macro/recall": 0.5987967256237715, "macro/precision": 0.6354522364268572, "per_entity_metric": {"corporation": {"f1": 0.5692695214105794, "f1_ci": {"90": [0.5148995365693302, 0.6194248948969875], "95": [0.5027287012656078, 0.625371078975007]}, "precision": 0.5485436893203883, "recall": 0.5916230366492147}, "creative_work": {"f1": 0.5175202156334232, "f1_ci": {"90": [0.4563687180673989, 0.5714285714285714], "95": [0.44505477308294206, 0.5831416826926255]}, "precision": 0.5, "recall": 0.5363128491620112}, "event": {"f1": 0.48717948717948717, "f1_ci": {"90": [0.43264831514000945, 0.540037854540933], "95": [0.42521228455095883, 0.5504527673138222]}, "precision": 0.5615763546798029, "recall": 0.43018867924528303}, "group": {"f1": 0.5760869565217392, "f1_ci": {"90": [0.5303798588309314, 0.6225573951434877], "95": [0.5220381872555786, 0.6298225641481745]}, "precision": 0.6597510373443983, "recall": 0.5112540192926045}, "location": {"f1": 0.6726726726726727, "f1_ci": {"90": [0.609375, 0.7296064977715223], "95": [0.5945904108442808, 0.7398181434720504]}, "precision": 0.6666666666666666, "recall": 0.6787878787878788}, "person": {"f1": 0.8329004329004328, "f1_ci": {"90": [0.8083653320335719, 0.8557735620235621], "95": [0.8018252663622527, 0.8603972670726598]}, "precision": 0.8604651162790697, "recall": 0.8070469798657718}, "product": {"f1": 0.6436781609195402, "f1_ci": {"90": [0.5947132077841678, 0.690951871657754], "95": [0.5843611624292543, 0.6995135009595522]}, "precision": 0.6511627906976745, "recall": 0.6363636363636364}}}, "2021.test (span detection)": {"micro/f1": 0.7835896284655965, "micro/f1_ci": {}, "micro/recall": 0.8073320226668209, "micro/precision": 0.7612037945698397, "macro/f1": 0.7835896284655965, "macro/f1_ci": {}, "macro/recall": 0.8073320226668209, "macro/precision": 0.7612037945698397}, "2020.test (span detection)": {"micro/f1": 0.7649595687331536, "micro/f1_ci": {}, "micro/recall": 0.736377789309808, "micro/precision": 0.7958496915311273, "macro/f1": 0.7649595687331536, "macro/f1_ci": {}, "macro/recall": 0.736377789309808, "macro/precision": 0.7958496915311273}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6548100242522231, "micro/f1_ci": {"90": [0.6363849446917261, 0.6729678638941399], "95": [0.632988010266229, 0.6761782355773874]}, "micro/recall": 0.6305137519460301, "micro/precision": 0.6810538116591929, "macro/f1": 0.6141867781768393, "macro/f1_ci": {"90": [0.5927615570590863, 0.63339395597405], "95": [0.5897139460819198, 0.636699176958749]}, "macro/recall": 0.5987967256237715, "macro/precision": 0.6354522364268572, "per_entity_metric": {"corporation": {"f1": 0.5692695214105794, "f1_ci": {"90": [0.5148995365693302, 0.6194248948969875], "95": [0.5027287012656078, 0.625371078975007]}, "precision": 0.5485436893203883, "recall": 0.5916230366492147}, "creative_work": {"f1": 0.5175202156334232, "f1_ci": {"90": [0.4563687180673989, 0.5714285714285714], "95": [0.44505477308294206, 0.5831416826926255]}, "precision": 0.5, "recall": 0.5363128491620112}, "event": {"f1": 0.48717948717948717, "f1_ci": {"90": [0.43264831514000945, 0.540037854540933], "95": [0.42521228455095883, 0.5504527673138222]}, "precision": 0.5615763546798029, "recall": 0.43018867924528303}, "group": {"f1": 0.5760869565217392, "f1_ci": {"90": [0.5303798588309314, 0.6225573951434877], "95": [0.5220381872555786, 0.6298225641481745]}, "precision": 0.6597510373443983, "recall": 0.5112540192926045}, "location": {"f1": 0.6726726726726727, "f1_ci": {"90": [0.609375, 0.7296064977715223], "95": [0.5945904108442808, 0.7398181434720504]}, "precision": 0.6666666666666666, "recall": 0.6787878787878788}, "person": {"f1": 0.8329004329004328, "f1_ci": {"90": [0.8083653320335719, 0.8557735620235621], "95": [0.8018252663622527, 0.8603972670726598]}, "precision": 0.8604651162790697, "recall": 0.8070469798657718}, "product": {"f1": 0.6436781609195402, "f1_ci": {"90": [0.5947132077841678, 0.690951871657754], "95": [0.5843611624292543, 0.6995135009595522]}, "precision": 0.6511627906976745, "recall": 0.6363636363636364}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.644817329816488, "micro/f1_ci": {"90": [0.6360417063561062, 0.6548454319775926], "95": [0.6341460646789854, 0.6560370464501823]}, "micro/recall": 0.6643154486586494, "micro/precision": 0.6264311416421328, "macro/f1": 0.5941147287547678, "macro/f1_ci": {"90": [0.5848414121578911, 0.6038057826115886], "95": [0.5820350845478711, 0.6060513462576288]}, "macro/recall": 0.6198566504961354, "macro/precision": 0.5756979462999651, "per_entity_metric": {"corporation": {"f1": 0.5058051489146896, "f1_ci": {"90": [0.48313912449808494, 0.530618218018915], "95": [0.47849280777812037, 0.5364444847786444]}, "precision": 0.46345975948196116, "recall": 0.5566666666666666}, "creative_work": {"f1": 0.4567022538552788, "f1_ci": {"90": [0.4278100225875855, 0.48546083866545087], "95": [0.42264104037430955, 0.4888449366028564]}, "precision": 0.4031413612565445, "recall": 0.5266757865937073}, "event": {"f1": 0.4439876670092498, "f1_ci": {"90": [0.41927814019962656, 0.46943924364462264], "95": [0.41511298597332785, 0.4726621822818196]}, "precision": 0.5100354191263282, "recall": 0.39308462238398545}, "group": {"f1": 0.6109472304162569, "f1_ci": {"90": [0.5912129562296317, 0.6328091890001382], "95": [0.5873284405198267, 0.6381933587682634]}, "precision": 0.6079582517938682, "recall": 0.613965744400527}, "location": {"f1": 0.6636304489264802, "f1_ci": {"90": [0.6359840503874383, 0.6900245167821328], "95": [0.6290236787920385, 0.6962843529176078]}, "precision": 0.6211936662606578, "recall": 0.7122905027932961}, "person": {"f1": 0.8363309352517986, "f1_ci": {"90": [0.8258310265077387, 0.8472827346138416], "95": [0.8238782456842353, 0.849028697845626]}, "precision": 0.8163623595505618, "recall": 0.8573008849557522}, "product": {"f1": 0.6413994169096211, "f1_ci": {"90": [0.6184853422878562, 0.6632819776388246], "95": [0.6137694360418035, 0.6673396278232638]}, "precision": 0.6077348066298343, "recall": 0.6790123456790124}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7649595687331536, "micro/f1_ci": {}, "micro/recall": 0.736377789309808, "micro/precision": 0.7958496915311273, "macro/f1": 0.7649595687331536, "macro/f1_ci": {}, "macro/recall": 0.736377789309808, "macro/precision": 0.7958496915311273}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7835896284655965, "micro/f1_ci": {}, "micro/recall": 0.8073320226668209, "micro/precision": 0.7612037945698397, "macro/f1": 0.7835896284655965, "macro/f1_ci": {}, "macro/recall": 0.8073320226668209, "macro/precision": 0.7612037945698397}
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "2021.extra.roberta-large-2020", "model": "tner/roberta-large-tweetner-2020", "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.3, "max_grad_norm": 1}
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train", "dataset_name": null, "local_dataset": {"train": "tweet_ner/2021.extra.tner/roberta-large-2020.txt", "validation": "tweet_ner/2020.dev.txt"}, "model": "tner/roberta-large-tweetner-2020", "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.3, "max_grad_norm": 1}