asahi417 commited on
Commit
d6275a4
1 Parent(s): ef71d4b

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-concat
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.6545742216194834
22
+ - name: Precision (test_2021)
23
+ type: precision
24
+ value: 0.640070726047077
25
+ - name: Recall (test_2021)
26
+ type: recall
27
+ value: 0.669750231267345
28
+ - name: Macro F1 (test_2021)
29
+ type: f1_macro
30
+ value: 0.6038933000880791
31
+ - name: Macro Precision (test_2021)
32
+ type: precision_macro
33
+ value: 0.5872465756589016
34
+ - name: Macro Recall (test_2021)
35
+ type: recall_macro
36
+ value: 0.6275044421067731
37
+ - name: Entity Span F1 (test_2021)
38
+ type: f1_entity_span
39
+ value: 0.7917043399638336
40
+ - name: Entity Span Precision (test_2020)
41
+ type: precision_entity_span
42
+ value: 0.7741186871477511
43
+ - name: Entity Span Recall (test_2021)
44
+ type: recall_entity_span
45
+ value: 0.8101075517520527
46
+ - name: F1 (test_2020)
47
+ type: f1
48
+ value: 0.6623235613463626
49
+ - name: Precision (test_2020)
50
+ type: precision
51
+ value: 0.6943653955606147
52
+ - name: Recall (test_2020)
53
+ type: recall
54
+ value: 0.6331084587441619
55
+ - name: Macro F1 (test_2020)
56
+ type: f1_macro
57
+ value: 0.6225690518125756
58
+ - name: Macro Precision (test_2020)
59
+ type: precision_macro
60
+ value: 0.6499146769265831
61
+ - name: Macro Recall (test_2020)
62
+ type: recall_macro
63
+ value: 0.6036807965123165
64
+ - name: Entity Span F1 (test_2020)
65
+ type: f1_entity_span
66
+ value: 0.7716535433070866
67
+ - name: Entity Span Precision (test_2020)
68
+ type: precision_entity_span
69
+ value: 0.8092255125284739
70
+ - name: Entity Span Recall (test_2020)
71
+ type: recall_entity_span
72
+ value: 0.7374156720290607
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-concat
80
+
81
+ This model is a fine-tuned version of [roberta-large](https://huggingface.co/roberta-large) 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.
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.6545742216194834
86
+ - Precision (micro): 0.640070726047077
87
+ - Recall (micro): 0.669750231267345
88
+ - F1 (macro): 0.6038933000880791
89
+ - Precision (macro): 0.5872465756589016
90
+ - Recall (macro): 0.6275044421067731
91
+
92
+
93
+
94
+ The per-entity breakdown of the F1 score on the test set are below:
95
+ - corporation: 0.5255936675461742
96
+ - creative_work: 0.4611679711017459
97
+ - event: 0.4583333333333333
98
+ - group: 0.6170427753452341
99
+ - location: 0.6717267552182163
100
+ - person: 0.8439139084825467
101
+ - product: 0.6494746895893028
102
+
103
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
104
+ - F1 (micro):
105
+ - 90%: [0.6459013617167609, 0.6637399915981033]
106
+ - 95%: [0.6439605146787715, 0.6661442289789786]
107
+ - F1 (macro):
108
+ - 90%: [0.6459013617167609, 0.6637399915981033]
109
+ - 95%: [0.6439605146787715, 0.6661442289789786]
110
+
111
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-tweetner7-2020-selflabel2020-concat/raw/main/eval/metric.json)
112
+ and [metric file of entity span](https://huggingface.co/tner/roberta-large-tweetner7-2020-selflabel2020-concat/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-concat")
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_2020.extra.tner/roberta-large-2020.txt', 'validation': 'tweet_ner/2020.dev.txt'}
134
+ - model: roberta-large
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.15
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-concat/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.649414328520839, "micro/f1_ci": {}, "micro/recall": 0.6227795193312434, "micro/precision": 0.678429140580535, "macro/f1": 0.590650897262125, "macro/f1_ci": {}, "macro/recall": 0.5744024079725654, "macro/precision": 0.6134283006959169, "per_entity_metric": {"corporation": {"f1": 0.49871465295629824, "f1_ci": {}, "precision": 0.521505376344086, "recall": 0.47783251231527096}, "creative_work": {"f1": 0.48258706467661694, "f1_ci": {}, "precision": 0.5, "recall": 0.46634615384615385}, "event": {"f1": 0.38337182448036955, "f1_ci": {}, "precision": 0.4689265536723164, "recall": 0.32421875}, "group": {"f1": 0.5794392523364486, "f1_ci": {}, "precision": 0.6169154228855721, "recall": 0.5462555066079295}, "location": {"f1": 0.6548223350253807, "f1_ci": {}, "precision": 0.6056338028169014, "recall": 0.712707182320442}, "person": {"f1": 0.8815331010452963, "f1_ci": {}, "precision": 0.92, "recall": 0.8461538461538461}, "product": {"f1": 0.6540880503144655, "f1_ci": {}, "precision": 0.6610169491525424, "recall": 0.6473029045643154}}}, "2021.test": {"micro/f1": 0.6545742216194834, "micro/f1_ci": {"90": [0.6459013617167609, 0.6637399915981033], "95": [0.6439605146787715, 0.6661442289789786]}, "micro/recall": 0.669750231267345, "micro/precision": 0.640070726047077, "macro/f1": 0.6038933000880791, "macro/f1_ci": {"90": [0.594478037324853, 0.613471230347705], "95": [0.5921218092360883, 0.615869972921379]}, "macro/recall": 0.6275044421067731, "macro/precision": 0.5872465756589016, "per_entity_metric": {"corporation": {"f1": 0.5255936675461742, "f1_ci": {"90": [0.5012547500758194, 0.551666427374269], "95": [0.4980840722696223, 0.5558710225982962]}, "precision": 0.5005025125628141, "recall": 0.5533333333333333}, "creative_work": {"f1": 0.4611679711017459, "f1_ci": {"90": [0.4312413847117795, 0.49084488005046123], "95": [0.4248320534266514, 0.4955962167603389]}, "precision": 0.4118279569892473, "recall": 0.5239398084815321}, "event": {"f1": 0.4583333333333333, "f1_ci": {"90": [0.4341053653001964, 0.48240018380694033], "95": [0.43086896520427154, 0.48663339577486764]}, "precision": 0.5189873417721519, "recall": 0.4103730664240218}, "group": {"f1": 0.6170427753452341, "f1_ci": {"90": [0.5971090680081758, 0.6395583815950936], "95": [0.5932359545008398, 0.6434986114965837]}, "precision": 0.631288766368022, "recall": 0.6034255599472991}, "location": {"f1": 0.6717267552182163, "f1_ci": {"90": [0.6452836612195251, 0.6974786576390933], "95": [0.6398442569759896, 0.7024897121350432]}, "precision": 0.6138728323699422, "recall": 0.7416201117318436}, "person": {"f1": 0.8439139084825467, "f1_ci": {"90": [0.833604517822505, 0.8540160799803808], "95": [0.8317777251893184, 0.8557604409045942]}, "precision": 0.8281860134895279, "recall": 0.8602507374631269}, "product": {"f1": 0.6494746895893028, "f1_ci": {"90": [0.6273696986005467, 0.6714700871761391], "95": [0.6241423028879639, 0.6750002697453603]}, "precision": 0.6060606060606061, "recall": 0.6995884773662552}}}, "2020.test": {"micro/f1": 0.6623235613463626, "micro/f1_ci": {"90": [0.6422474302424246, 0.6811324728997347], "95": [0.6389031826951058, 0.6850053691756447]}, "micro/recall": 0.6331084587441619, "micro/precision": 0.6943653955606147, "macro/f1": 0.6225690518125756, "macro/f1_ci": {"90": [0.6008525675448059, 0.6437197639424065], "95": [0.5962025204396408, 0.6474952948771053]}, "macro/recall": 0.6036807965123165, "macro/precision": 0.6499146769265831, "per_entity_metric": {"corporation": {"f1": 0.5750000000000001, "f1_ci": {"90": [0.5147291967415961, 0.6288765247654537], "95": [0.504878881260727, 0.6379375324900364]}, "precision": 0.5502392344497608, "recall": 0.6020942408376964}, "creative_work": {"f1": 0.5420054200542006, "f1_ci": {"90": [0.48349650349650347, 0.5967239555790587], "95": [0.4748140470674308, 0.6045342912754751]}, "precision": 0.5263157894736842, "recall": 0.5586592178770949}, "event": {"f1": 0.4675324675324675, "f1_ci": {"90": [0.41508036338225013, 0.5208786231884058], "95": [0.4035317955783264, 0.5322652223706814]}, "precision": 0.5482233502538071, "recall": 0.4075471698113208}, "group": {"f1": 0.5831775700934579, "f1_ci": {"90": [0.5351875463306153, 0.6303075786002615], "95": [0.526305305095408, 0.6420861887190302]}, "precision": 0.6964285714285714, "recall": 0.5016077170418006}, "location": {"f1": 0.6785714285714286, "f1_ci": {"90": [0.6144280090659667, 0.7387809684684685], "95": [0.6031520562770563, 0.7486189183112234]}, "precision": 0.6666666666666666, "recall": 0.6909090909090909}, "person": {"f1": 0.8356401384083046, "f1_ci": {"90": [0.8096005342802151, 0.8583135368553761], "95": [0.804469034180745, 0.8641178093692118]}, "precision": 0.8625, "recall": 0.8104026845637584}, "product": {"f1": 0.6760563380281691, "f1_ci": {"90": [0.6243472081218274, 0.7256235827664399], "95": [0.6153753026634383, 0.7338220562790275]}, "precision": 0.6990291262135923, "recall": 0.6545454545454545}}}, "2021.test (span detection)": {"micro/f1": 0.7917043399638336, "micro/f1_ci": {}, "micro/recall": 0.8101075517520527, "micro/precision": 0.7741186871477511, "macro/f1": 0.7917043399638336, "macro/f1_ci": {}, "macro/recall": 0.8101075517520527, "macro/precision": 0.7741186871477511}, "2020.test (span detection)": {"micro/f1": 0.7716535433070866, "micro/f1_ci": {}, "micro/recall": 0.7374156720290607, "micro/precision": 0.8092255125284739, "macro/f1": 0.7716535433070866, "macro/f1_ci": {}, "macro/recall": 0.7374156720290607, "macro/precision": 0.8092255125284739}}
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6623235613463626, "micro/f1_ci": {"90": [0.6422474302424246, 0.6811324728997347], "95": [0.6389031826951058, 0.6850053691756447]}, "micro/recall": 0.6331084587441619, "micro/precision": 0.6943653955606147, "macro/f1": 0.6225690518125756, "macro/f1_ci": {"90": [0.6008525675448059, 0.6437197639424065], "95": [0.5962025204396408, 0.6474952948771053]}, "macro/recall": 0.6036807965123165, "macro/precision": 0.6499146769265831, "per_entity_metric": {"corporation": {"f1": 0.5750000000000001, "f1_ci": {"90": [0.5147291967415961, 0.6288765247654537], "95": [0.504878881260727, 0.6379375324900364]}, "precision": 0.5502392344497608, "recall": 0.6020942408376964}, "creative_work": {"f1": 0.5420054200542006, "f1_ci": {"90": [0.48349650349650347, 0.5967239555790587], "95": [0.4748140470674308, 0.6045342912754751]}, "precision": 0.5263157894736842, "recall": 0.5586592178770949}, "event": {"f1": 0.4675324675324675, "f1_ci": {"90": [0.41508036338225013, 0.5208786231884058], "95": [0.4035317955783264, 0.5322652223706814]}, "precision": 0.5482233502538071, "recall": 0.4075471698113208}, "group": {"f1": 0.5831775700934579, "f1_ci": {"90": [0.5351875463306153, 0.6303075786002615], "95": [0.526305305095408, 0.6420861887190302]}, "precision": 0.6964285714285714, "recall": 0.5016077170418006}, "location": {"f1": 0.6785714285714286, "f1_ci": {"90": [0.6144280090659667, 0.7387809684684685], "95": [0.6031520562770563, 0.7486189183112234]}, "precision": 0.6666666666666666, "recall": 0.6909090909090909}, "person": {"f1": 0.8356401384083046, "f1_ci": {"90": [0.8096005342802151, 0.8583135368553761], "95": [0.804469034180745, 0.8641178093692118]}, "precision": 0.8625, "recall": 0.8104026845637584}, "product": {"f1": 0.6760563380281691, "f1_ci": {"90": [0.6243472081218274, 0.7256235827664399], "95": [0.6153753026634383, 0.7338220562790275]}, "precision": 0.6990291262135923, "recall": 0.6545454545454545}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6545742216194834, "micro/f1_ci": {"90": [0.6459013617167609, 0.6637399915981033], "95": [0.6439605146787715, 0.6661442289789786]}, "micro/recall": 0.669750231267345, "micro/precision": 0.640070726047077, "macro/f1": 0.6038933000880791, "macro/f1_ci": {"90": [0.594478037324853, 0.613471230347705], "95": [0.5921218092360883, 0.615869972921379]}, "macro/recall": 0.6275044421067731, "macro/precision": 0.5872465756589016, "per_entity_metric": {"corporation": {"f1": 0.5255936675461742, "f1_ci": {"90": [0.5012547500758194, 0.551666427374269], "95": [0.4980840722696223, 0.5558710225982962]}, "precision": 0.5005025125628141, "recall": 0.5533333333333333}, "creative_work": {"f1": 0.4611679711017459, "f1_ci": {"90": [0.4312413847117795, 0.49084488005046123], "95": [0.4248320534266514, 0.4955962167603389]}, "precision": 0.4118279569892473, "recall": 0.5239398084815321}, "event": {"f1": 0.4583333333333333, "f1_ci": {"90": [0.4341053653001964, 0.48240018380694033], "95": [0.43086896520427154, 0.48663339577486764]}, "precision": 0.5189873417721519, "recall": 0.4103730664240218}, "group": {"f1": 0.6170427753452341, "f1_ci": {"90": [0.5971090680081758, 0.6395583815950936], "95": [0.5932359545008398, 0.6434986114965837]}, "precision": 0.631288766368022, "recall": 0.6034255599472991}, "location": {"f1": 0.6717267552182163, "f1_ci": {"90": [0.6452836612195251, 0.6974786576390933], "95": [0.6398442569759896, 0.7024897121350432]}, "precision": 0.6138728323699422, "recall": 0.7416201117318436}, "person": {"f1": 0.8439139084825467, "f1_ci": {"90": [0.833604517822505, 0.8540160799803808], "95": [0.8317777251893184, 0.8557604409045942]}, "precision": 0.8281860134895279, "recall": 0.8602507374631269}, "product": {"f1": 0.6494746895893028, "f1_ci": {"90": [0.6273696986005467, 0.6714700871761391], "95": [0.6241423028879639, 0.6750002697453603]}, "precision": 0.6060606060606061, "recall": 0.6995884773662552}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7716535433070866, "micro/f1_ci": {}, "micro/recall": 0.7374156720290607, "micro/precision": 0.8092255125284739, "macro/f1": 0.7716535433070866, "macro/f1_ci": {}, "macro/recall": 0.7374156720290607, "macro/precision": 0.8092255125284739}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7917043399638336, "micro/f1_ci": {}, "micro/recall": 0.8101075517520527, "micro/precision": 0.7741186871477511, "macro/f1": 0.7917043399638336, "macro/f1_ci": {}, "macro/recall": 0.8101075517520527, "macro/precision": 0.7741186871477511}
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "2020_2020.extra.roberta-large-2020", "model": "roberta-large", "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", "dataset_name": null, "local_dataset": {"train": "tweet_ner/2020_2020.extra.tner/roberta-large-2020.txt", "validation": "tweet_ner/2020.dev.txt"}, "model": "roberta-large", "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}