asahi417 commited on
Commit
7c53f4c
1 Parent(s): a1b8499

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-selflabel2020-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.6514522821576764
22
+ - name: Precision (test_2021)
23
+ type: precision
24
+ value: 0.6323753537992598
25
+ - name: Recall (test_2021)
26
+ type: recall
27
+ value: 0.6717160037002775
28
+ - name: Macro F1 (test_2021)
29
+ type: f1_macro
30
+ value: 0.6022910652688035
31
+ - name: Macro Precision (test_2021)
32
+ type: precision_macro
33
+ value: 0.5829347583676058
34
+ - name: Macro Recall (test_2021)
35
+ type: recall_macro
36
+ value: 0.6268182581614908
37
+ - name: Entity Span F1 (test_2021)
38
+ type: f1_entity_span
39
+ value: 0.787304435596927
40
+ - name: Entity Span Precision (test_2020)
41
+ type: precision_entity_span
42
+ value: 0.7642064010450685
43
+ - name: Entity Span Recall (test_2021)
44
+ type: recall_entity_span
45
+ value: 0.8118422574303227
46
+ - name: F1 (test_2020)
47
+ type: f1
48
+ value: 0.667024993281376
49
+ - name: Precision (test_2020)
50
+ type: precision
51
+ value: 0.6917502787068004
52
+ - name: Recall (test_2020)
53
+ type: recall
54
+ value: 0.6440062272963155
55
+ - name: Macro F1 (test_2020)
56
+ type: f1_macro
57
+ value: 0.6285598697810462
58
+ - name: Macro Precision (test_2020)
59
+ type: precision_macro
60
+ value: 0.649215603090582
61
+ - name: Macro Recall (test_2020)
62
+ type: recall_macro
63
+ value: 0.6128675304056594
64
+ - name: Entity Span F1 (test_2020)
65
+ type: f1_entity_span
66
+ value: 0.7711750470556602
67
+ - name: Entity Span Precision (test_2020)
68
+ type: precision_entity_span
69
+ value: 0.8002232142857143
70
+ - name: Entity Span Recall (test_2020)
71
+ type: recall_entity_span
72
+ value: 0.7441619097042034
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-selflabel2020-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_2020` 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.6514522821576764
86
+ - Precision (micro): 0.6323753537992598
87
+ - Recall (micro): 0.6717160037002775
88
+ - F1 (macro): 0.6022910652688035
89
+ - Precision (macro): 0.5829347583676058
90
+ - Recall (macro): 0.6268182581614908
91
+
92
+
93
+
94
+ The per-entity breakdown of the F1 score on the test set are below:
95
+ - corporation: 0.5252837977296182
96
+ - creative_work: 0.4650306748466258
97
+ - event: 0.46176911544227883
98
+ - group: 0.608667941363926
99
+ - location: 0.6666666666666666
100
+ - person: 0.8382696104828578
101
+ - product: 0.6503496503496504
102
+
103
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
104
+ - F1 (micro):
105
+ - 90%: [0.6429569959405362, 0.6605302879870334]
106
+ - 95%: [0.6410815271146394, 0.6628490227012314]
107
+ - F1 (macro):
108
+ - 90%: [0.6429569959405362, 0.6605302879870334]
109
+ - 95%: [0.6410815271146394, 0.6628490227012314]
110
+
111
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-tweetner7-2020-selflabel2020-continuous/raw/main/eval/metric.json)
112
+ and [metric file of entity span](https://huggingface.co/tner/roberta-large-tweetner7-2020-selflabel2020-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-selflabel2020-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/2020.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-selflabel2020-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.648399348887683, "micro/f1_ci": {}, "micro/recall": 0.6243469174503657, "micro/precision": 0.6743792325056434, "macro/f1": 0.5909644689649175, "macro/f1_ci": {}, "macro/recall": 0.5766214441252561, "macro/precision": 0.6111093659335289, "per_entity_metric": {"corporation": {"f1": 0.5117493472584856, "f1_ci": {}, "precision": 0.5444444444444444, "recall": 0.4827586206896552}, "creative_work": {"f1": 0.5172413793103448, "f1_ci": {}, "precision": 0.5303030303030303, "recall": 0.5048076923076923}, "event": {"f1": 0.3615560640732265, "f1_ci": {}, "precision": 0.43646408839779005, "recall": 0.30859375}, "group": {"f1": 0.5714285714285715, "f1_ci": {}, "precision": 0.579185520361991, "recall": 0.5638766519823789}, "location": {"f1": 0.6531645569620254, "f1_ci": {}, "precision": 0.602803738317757, "recall": 0.712707182320442}, "person": {"f1": 0.8781331028522039, "f1_ci": {}, "precision": 0.9087656529516994, "recall": 0.8494983277591973}, "product": {"f1": 0.6434782608695652, "f1_ci": {}, "precision": 0.6757990867579908, "recall": 0.6141078838174274}}}, "2021.test": {"micro/f1": 0.6514522821576764, "micro/f1_ci": {"90": [0.6429569959405362, 0.6605302879870334], "95": [0.6410815271146394, 0.6628490227012314]}, "micro/recall": 0.6717160037002775, "micro/precision": 0.6323753537992598, "macro/f1": 0.6022910652688035, "macro/f1_ci": {"90": [0.5926768159935056, 0.6116335368191376], "95": [0.5909206316142176, 0.6143321683898024]}, "macro/recall": 0.6268182581614908, "macro/precision": 0.5829347583676058, "per_entity_metric": {"corporation": {"f1": 0.5252837977296182, "f1_ci": {"90": [0.5017318062264439, 0.5492394810681811], "95": [0.4969478277714551, 0.5549366440877337]}, "precision": 0.4903660886319846, "recall": 0.5655555555555556}, "creative_work": {"f1": 0.4650306748466258, "f1_ci": {"90": [0.4350009909824847, 0.49549433532532633], "95": [0.43058084497165894, 0.5005915659244724]}, "precision": 0.42157953281423804, "recall": 0.518467852257182}, "event": {"f1": 0.46176911544227883, "f1_ci": {"90": [0.4377705513051409, 0.48587064030403615], "95": [0.4335950663509719, 0.4906232955871996]}, "precision": 0.5121951219512195, "recall": 0.42038216560509556}, "group": {"f1": 0.608667941363926, "f1_ci": {"90": [0.5887827974494642, 0.630985261576994], "95": [0.5852987582327822, 0.6351036898111154]}, "precision": 0.5895061728395061, "recall": 0.6291172595520421}, "location": {"f1": 0.6666666666666666, "f1_ci": {"90": [0.6391991938404371, 0.6920817369093231], "95": [0.6337259083517713, 0.6975266062278282]}, "precision": 0.6181384248210023, "recall": 0.723463687150838}, "person": {"f1": 0.8382696104828578, "f1_ci": {"90": [0.8279126000262365, 0.8493670331047011], "95": [0.8259703577817044, 0.8508948921014351]}, "precision": 0.8167191325638335, "recall": 0.8609882005899705}, "product": {"f1": 0.6503496503496504, "f1_ci": {"90": [0.6280545085679369, 0.6716338102519296], "95": [0.624125459824057, 0.6750003009147809]}, "precision": 0.6320388349514563, "recall": 0.6697530864197531}}}, "2020.test": {"micro/f1": 0.667024993281376, "micro/f1_ci": {"90": [0.6466483696976761, 0.6850849057591648], "95": [0.6436743243865384, 0.6890168875048278]}, "micro/recall": 0.6440062272963155, "micro/precision": 0.6917502787068004, "macro/f1": 0.6285598697810462, "macro/f1_ci": {"90": [0.6062904363883691, 0.6482978043911523], "95": [0.6038447309391324, 0.6523739773360004]}, "macro/recall": 0.6128675304056594, "macro/precision": 0.649215603090582, "per_entity_metric": {"corporation": {"f1": 0.5935162094763092, "f1_ci": {"90": [0.5359767215497031, 0.6460952232612215], "95": [0.5249477762803234, 0.6574728389230041]}, "precision": 0.5666666666666667, "recall": 0.6230366492146597}, "creative_work": {"f1": 0.5444444444444444, "f1_ci": {"90": [0.48537777777777774, 0.5994252016113202], "95": [0.47648156441259887, 0.6054173290937997]}, "precision": 0.5414364640883977, "recall": 0.547486033519553}, "event": {"f1": 0.48275862068965514, "f1_ci": {"90": [0.4299044276229543, 0.5339366515837104], "95": [0.4217935585792183, 0.5421691882502304]}, "precision": 0.5628140703517588, "recall": 0.4226415094339623}, "group": {"f1": 0.5944055944055943, "f1_ci": {"90": [0.5538405492503853, 0.6375911754490146], "95": [0.5468783927472158, 0.6455727638527957]}, "precision": 0.6513409961685823, "recall": 0.5466237942122186}, "location": {"f1": 0.6766467065868264, "f1_ci": {"90": [0.6157607504149832, 0.7339152974622686], "95": [0.604803715999767, 0.7449669237130055]}, "precision": 0.6686390532544378, "recall": 0.6848484848484848}, "person": {"f1": 0.8336192109777015, "f1_ci": {"90": [0.8083917283340442, 0.8571428571428572], "95": [0.8027000095812972, 0.8622965016363554]}, "precision": 0.8526315789473684, "recall": 0.8154362416107382}, "product": {"f1": 0.6745283018867924, "f1_ci": {"90": [0.6244026793457135, 0.7244172642191439], "95": [0.6130380563874831, 0.7365985667588634]}, "precision": 0.7009803921568627, "recall": 0.65}}}, "2021.test (span detection)": {"micro/f1": 0.787304435596927, "micro/f1_ci": {}, "micro/recall": 0.8118422574303227, "micro/precision": 0.7642064010450685, "macro/f1": 0.787304435596927, "macro/f1_ci": {}, "macro/recall": 0.8118422574303227, "macro/precision": 0.7642064010450685}, "2020.test (span detection)": {"micro/f1": 0.7711750470556602, "micro/f1_ci": {}, "micro/recall": 0.7441619097042034, "micro/precision": 0.8002232142857143, "macro/f1": 0.7711750470556602, "macro/f1_ci": {}, "macro/recall": 0.7441619097042034, "macro/precision": 0.8002232142857143}}
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.667024993281376, "micro/f1_ci": {"90": [0.6466483696976761, 0.6850849057591648], "95": [0.6436743243865384, 0.6890168875048278]}, "micro/recall": 0.6440062272963155, "micro/precision": 0.6917502787068004, "macro/f1": 0.6285598697810462, "macro/f1_ci": {"90": [0.6062904363883691, 0.6482978043911523], "95": [0.6038447309391324, 0.6523739773360004]}, "macro/recall": 0.6128675304056594, "macro/precision": 0.649215603090582, "per_entity_metric": {"corporation": {"f1": 0.5935162094763092, "f1_ci": {"90": [0.5359767215497031, 0.6460952232612215], "95": [0.5249477762803234, 0.6574728389230041]}, "precision": 0.5666666666666667, "recall": 0.6230366492146597}, "creative_work": {"f1": 0.5444444444444444, "f1_ci": {"90": [0.48537777777777774, 0.5994252016113202], "95": [0.47648156441259887, 0.6054173290937997]}, "precision": 0.5414364640883977, "recall": 0.547486033519553}, "event": {"f1": 0.48275862068965514, "f1_ci": {"90": [0.4299044276229543, 0.5339366515837104], "95": [0.4217935585792183, 0.5421691882502304]}, "precision": 0.5628140703517588, "recall": 0.4226415094339623}, "group": {"f1": 0.5944055944055943, "f1_ci": {"90": [0.5538405492503853, 0.6375911754490146], "95": [0.5468783927472158, 0.6455727638527957]}, "precision": 0.6513409961685823, "recall": 0.5466237942122186}, "location": {"f1": 0.6766467065868264, "f1_ci": {"90": [0.6157607504149832, 0.7339152974622686], "95": [0.604803715999767, 0.7449669237130055]}, "precision": 0.6686390532544378, "recall": 0.6848484848484848}, "person": {"f1": 0.8336192109777015, "f1_ci": {"90": [0.8083917283340442, 0.8571428571428572], "95": [0.8027000095812972, 0.8622965016363554]}, "precision": 0.8526315789473684, "recall": 0.8154362416107382}, "product": {"f1": 0.6745283018867924, "f1_ci": {"90": [0.6244026793457135, 0.7244172642191439], "95": [0.6130380563874831, 0.7365985667588634]}, "precision": 0.7009803921568627, "recall": 0.65}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6514522821576764, "micro/f1_ci": {"90": [0.6429569959405362, 0.6605302879870334], "95": [0.6410815271146394, 0.6628490227012314]}, "micro/recall": 0.6717160037002775, "micro/precision": 0.6323753537992598, "macro/f1": 0.6022910652688035, "macro/f1_ci": {"90": [0.5926768159935056, 0.6116335368191376], "95": [0.5909206316142176, 0.6143321683898024]}, "macro/recall": 0.6268182581614908, "macro/precision": 0.5829347583676058, "per_entity_metric": {"corporation": {"f1": 0.5252837977296182, "f1_ci": {"90": [0.5017318062264439, 0.5492394810681811], "95": [0.4969478277714551, 0.5549366440877337]}, "precision": 0.4903660886319846, "recall": 0.5655555555555556}, "creative_work": {"f1": 0.4650306748466258, "f1_ci": {"90": [0.4350009909824847, 0.49549433532532633], "95": [0.43058084497165894, 0.5005915659244724]}, "precision": 0.42157953281423804, "recall": 0.518467852257182}, "event": {"f1": 0.46176911544227883, "f1_ci": {"90": [0.4377705513051409, 0.48587064030403615], "95": [0.4335950663509719, 0.4906232955871996]}, "precision": 0.5121951219512195, "recall": 0.42038216560509556}, "group": {"f1": 0.608667941363926, "f1_ci": {"90": [0.5887827974494642, 0.630985261576994], "95": [0.5852987582327822, 0.6351036898111154]}, "precision": 0.5895061728395061, "recall": 0.6291172595520421}, "location": {"f1": 0.6666666666666666, "f1_ci": {"90": [0.6391991938404371, 0.6920817369093231], "95": [0.6337259083517713, 0.6975266062278282]}, "precision": 0.6181384248210023, "recall": 0.723463687150838}, "person": {"f1": 0.8382696104828578, "f1_ci": {"90": [0.8279126000262365, 0.8493670331047011], "95": [0.8259703577817044, 0.8508948921014351]}, "precision": 0.8167191325638335, "recall": 0.8609882005899705}, "product": {"f1": 0.6503496503496504, "f1_ci": {"90": [0.6280545085679369, 0.6716338102519296], "95": [0.624125459824057, 0.6750003009147809]}, "precision": 0.6320388349514563, "recall": 0.6697530864197531}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7711750470556602, "micro/f1_ci": {}, "micro/recall": 0.7441619097042034, "micro/precision": 0.8002232142857143, "macro/f1": 0.7711750470556602, "macro/f1_ci": {}, "macro/recall": 0.7441619097042034, "macro/precision": 0.8002232142857143}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.787304435596927, "micro/f1_ci": {}, "micro/recall": 0.8118422574303227, "micro/precision": 0.7642064010450685, "macro/f1": 0.787304435596927, "macro/f1_ci": {}, "macro/recall": 0.8118422574303227, "macro/precision": 0.7642064010450685}
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "2020.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/2020.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}