asahi417 commited on
Commit
5664b12
1 Parent(s): 3cc6ff7

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/bertweet-base-tweetner7-random
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.6555135815794207
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6807821646531323
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6320536540240518
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5958197063152341
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.6249946723205074
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5736622995381765
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7780043175821539
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.8079461950429693
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7502023823291315
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.6389047347404451
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.7093096896770108
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5812143227815257
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.586121467459777
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6621669635440725
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5294767225396645
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7438676554478039
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8258391386953768
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.6766995329527763
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/bertweet-base-tweetner7-random
88
+
89
+ This model is a fine-tuned version of [vinai/bertweet-base](https://huggingface.co/vinai/bertweet-base) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_random` 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.6555135815794207
94
+ - Precision (micro): 0.6807821646531323
95
+ - Recall (micro): 0.6320536540240518
96
+ - F1 (macro): 0.5958197063152341
97
+ - Precision (macro): 0.6249946723205074
98
+ - Recall (macro): 0.5736622995381765
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.49599012954966076
104
+ - creative_work: 0.40063091482649843
105
+ - event: 0.47287615148413514
106
+ - group: 0.6206664422753282
107
+ - location: 0.6798096532970768
108
+ - person: 0.8351528384279476
109
+ - product: 0.6656118143459916
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6458952197843215, 0.6643997426393443]
114
+ - 95%: [0.6443089692503373, 0.6658257158915145]
115
+ - F1 (macro):
116
+ - 90%: [0.6458952197843215, 0.6643997426393443]
117
+ - 95%: [0.6443089692503373, 0.6658257158915145]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bertweet-base-tweetner7-random/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bertweet-base-tweetner7-random/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/bertweet-base-tweetner7-random")
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_random
140
+ - dataset_name: None
141
+ - local_dataset: None
142
+ - model: vinai/bertweet-base
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/bertweet-base-tweetner7-random/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 → metric.test_2020.json} RENAMED
@@ -1 +1 @@
1
- {"random.dev": {"micro/f1": 0.6552217453505008, "micro/f1_ci": {}, "micro/recall": 0.611318739989322, "micro/precision": 0.7059186189889026, "macro/f1": 0.5988762510196898, "macro/f1_ci": {}, "macro/recall": 0.5542334451605068, "macro/precision": 0.6593285098237874, "per_entity_metric": {"corporation": {"f1": 0.5209580838323353, "f1_ci": {}, "precision": 0.6170212765957447, "recall": 0.45077720207253885}, "creative_work": {"f1": 0.50187265917603, "f1_ci": {}, "precision": 0.638095238095238, "recall": 0.41358024691358025}, "event": {"f1": 0.38875878220140514, "f1_ci": {}, "precision": 0.45604395604395603, "recall": 0.33877551020408164}, "group": {"f1": 0.6428571428571428, "f1_ci": {}, "precision": 0.6625766871165644, "recall": 0.6242774566473989}, "location": {"f1": 0.637223974763407, "f1_ci": {}, "precision": 0.6558441558441559, "recall": 0.6196319018404908}, "person": {"f1": 0.8627819548872181, "f1_ci": {}, "precision": 0.864406779661017, "recall": 0.8611632270168855}, "product": {"f1": 0.6376811594202898, "f1_ci": {}, "precision": 0.7213114754098361, "recall": 0.5714285714285714}}}, "2021.test": {"micro/f1": 0.6555135815794207, "micro/f1_ci": {"90": [0.6458952197843215, 0.6643997426393443], "95": [0.6443089692503373, 0.6658257158915145]}, "micro/recall": 0.6320536540240518, "micro/precision": 0.6807821646531323, "macro/f1": 0.5958197063152341, "macro/f1_ci": {"90": [0.585785434411046, 0.6053748531850129], "95": [0.5838402026896898, 0.6072114575354797]}, "macro/recall": 0.5736622995381765, "macro/precision": 0.6249946723205074, "per_entity_metric": {"corporation": {"f1": 0.49599012954966076, "f1_ci": {"90": [0.46883518739617464, 0.522878197204526], "95": [0.4619099785663253, 0.5290631359930873]}, "precision": 0.5575589459084604, "recall": 0.44666666666666666}, "creative_work": {"f1": 0.40063091482649843, "f1_ci": {"90": [0.36874728260869566, 0.43303929430633514], "95": [0.3629171852523146, 0.43848724048960525]}, "precision": 0.4729981378026071, "recall": 0.34746922024623805}, "event": {"f1": 0.47287615148413514, "f1_ci": {"90": [0.44740757125719577, 0.49634094981119414], "95": [0.4430748367654445, 0.5009967828889779]}, "precision": 0.5403508771929825, "recall": 0.42038216560509556}, "group": {"f1": 0.6206664422753282, "f1_ci": {"90": [0.5997751796772071, 0.6415149815388977], "95": [0.5964844757099186, 0.6457991975341445]}, "precision": 0.6345492085340675, "recall": 0.6073781291172595}, "location": {"f1": 0.6798096532970768, "f1_ci": {"90": [0.6518312969865437, 0.7069473970234486], "95": [0.6458321283960411, 0.7113758984903604]}, "precision": 0.6622516556291391, "recall": 0.6983240223463687}, "person": {"f1": 0.8351528384279476, "f1_ci": {"90": [0.8242736044555532, 0.8456305452479886], "95": [0.8225215199841636, 0.8476744109543876]}, "precision": 0.8243534482758621, "recall": 0.8462389380530974}, "product": {"f1": 0.6656118143459916, "f1_ci": {"90": [0.6426097657451765, 0.6862539349422875], "95": [0.6373492325760903, 0.6910826330952685]}, "precision": 0.6829004329004329, "recall": 0.6491769547325102}}}, "2020.test": {"micro/f1": 0.6389047347404451, "micro/f1_ci": {"90": [0.6187593935345156, 0.6584639871206162], "95": [0.6145490760162841, 0.6627502292906674]}, "micro/recall": 0.5812143227815257, "micro/precision": 0.7093096896770108, "macro/f1": 0.586121467459777, "macro/f1_ci": {"90": [0.5621903624073958, 0.6070822851718417], "95": [0.5579615035485642, 0.6117235352428714]}, "macro/recall": 0.5294767225396645, "macro/precision": 0.6621669635440725, "per_entity_metric": {"corporation": {"f1": 0.5438066465256798, "f1_ci": {"90": [0.4757904290634208, 0.6006616735627367], "95": [0.4604531711048777, 0.6162243446453973]}, "precision": 0.6428571428571429, "recall": 0.4712041884816754}, "creative_work": {"f1": 0.45051194539249145, "f1_ci": {"90": [0.3833661885663789, 0.5145250175345909], "95": [0.3745328676905309, 0.5244931327665141]}, "precision": 0.5789473684210527, "recall": 0.3687150837988827}, "event": {"f1": 0.4197002141327623, "f1_ci": {"90": [0.3664302564646572, 0.46942169328928907], "95": [0.35712632275132267, 0.47826311071268485]}, "precision": 0.48514851485148514, "recall": 0.36981132075471695}, "group": {"f1": 0.5588235294117647, "f1_ci": {"90": [0.5081523214770568, 0.6080405121136144], "95": [0.49904922344448926, 0.6185954944178629]}, "precision": 0.6523605150214592, "recall": 0.4887459807073955}, "location": {"f1": 0.6602564102564102, "f1_ci": {"90": [0.5993669608811564, 0.7197252248114239], "95": [0.5878272065772066, 0.7295617970622579]}, "precision": 0.7006802721088435, "recall": 0.6242424242424243}, "person": {"f1": 0.8336192109777015, "f1_ci": {"90": [0.8076141024001363, 0.8562484124105687], "95": [0.8038348561764808, 0.8596338619451357]}, "precision": 0.8526315789473684, "recall": 0.8154362416107382}, "product": {"f1": 0.6361323155216285, "f1_ci": {"90": [0.5794345441276866, 0.6856165902940188], "95": [0.5674891662127922, 0.6944029017164559]}, "precision": 0.7225433526011561, "recall": 0.5681818181818182}}}, "2021.test (span detection)": {"micro/f1": 0.7780043175821539, "micro/f1_ci": {}, "micro/recall": 0.7502023823291315, "micro/precision": 0.8079461950429693, "macro/f1": 0.7780043175821539, "macro/f1_ci": {}, "macro/recall": 0.7502023823291315, "macro/precision": 0.8079461950429693}, "2020.test (span detection)": {"micro/f1": 0.7438676554478039, "micro/f1_ci": {}, "micro/recall": 0.6766995329527763, "micro/precision": 0.8258391386953768, "macro/f1": 0.7438676554478039, "macro/f1_ci": {}, "macro/recall": 0.6766995329527763, "macro/precision": 0.8258391386953768}}
 
1
+ {"micro/f1": 0.6389047347404451, "micro/f1_ci": {"90": [0.6187593935345156, 0.6584639871206162], "95": [0.6145490760162841, 0.6627502292906674]}, "micro/recall": 0.5812143227815257, "micro/precision": 0.7093096896770108, "macro/f1": 0.586121467459777, "macro/f1_ci": {"90": [0.5621903624073958, 0.6070822851718417], "95": [0.5579615035485642, 0.6117235352428714]}, "macro/recall": 0.5294767225396645, "macro/precision": 0.6621669635440725, "per_entity_metric": {"corporation": {"f1": 0.5438066465256798, "f1_ci": {"90": [0.4757904290634208, 0.6006616735627367], "95": [0.4604531711048777, 0.6162243446453973]}, "precision": 0.6428571428571429, "recall": 0.4712041884816754}, "creative_work": {"f1": 0.45051194539249145, "f1_ci": {"90": [0.3833661885663789, 0.5145250175345909], "95": [0.3745328676905309, 0.5244931327665141]}, "precision": 0.5789473684210527, "recall": 0.3687150837988827}, "event": {"f1": 0.4197002141327623, "f1_ci": {"90": [0.3664302564646572, 0.46942169328928907], "95": [0.35712632275132267, 0.47826311071268485]}, "precision": 0.48514851485148514, "recall": 0.36981132075471695}, "group": {"f1": 0.5588235294117647, "f1_ci": {"90": [0.5081523214770568, 0.6080405121136144], "95": [0.49904922344448926, 0.6185954944178629]}, "precision": 0.6523605150214592, "recall": 0.4887459807073955}, "location": {"f1": 0.6602564102564102, "f1_ci": {"90": [0.5993669608811564, 0.7197252248114239], "95": [0.5878272065772066, 0.7295617970622579]}, "precision": 0.7006802721088435, "recall": 0.6242424242424243}, "person": {"f1": 0.8336192109777015, "f1_ci": {"90": [0.8076141024001363, 0.8562484124105687], "95": [0.8038348561764808, 0.8596338619451357]}, "precision": 0.8526315789473684, "recall": 0.8154362416107382}, "product": {"f1": 0.6361323155216285, "f1_ci": {"90": [0.5794345441276866, 0.6856165902940188], "95": [0.5674891662127922, 0.6944029017164559]}, "precision": 0.7225433526011561, "recall": 0.5681818181818182}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6555135815794207, "micro/f1_ci": {"90": [0.6458952197843215, 0.6643997426393443], "95": [0.6443089692503373, 0.6658257158915145]}, "micro/recall": 0.6320536540240518, "micro/precision": 0.6807821646531323, "macro/f1": 0.5958197063152341, "macro/f1_ci": {"90": [0.585785434411046, 0.6053748531850129], "95": [0.5838402026896898, 0.6072114575354797]}, "macro/recall": 0.5736622995381765, "macro/precision": 0.6249946723205074, "per_entity_metric": {"corporation": {"f1": 0.49599012954966076, "f1_ci": {"90": [0.46883518739617464, 0.522878197204526], "95": [0.4619099785663253, 0.5290631359930873]}, "precision": 0.5575589459084604, "recall": 0.44666666666666666}, "creative_work": {"f1": 0.40063091482649843, "f1_ci": {"90": [0.36874728260869566, 0.43303929430633514], "95": [0.3629171852523146, 0.43848724048960525]}, "precision": 0.4729981378026071, "recall": 0.34746922024623805}, "event": {"f1": 0.47287615148413514, "f1_ci": {"90": [0.44740757125719577, 0.49634094981119414], "95": [0.4430748367654445, 0.5009967828889779]}, "precision": 0.5403508771929825, "recall": 0.42038216560509556}, "group": {"f1": 0.6206664422753282, "f1_ci": {"90": [0.5997751796772071, 0.6415149815388977], "95": [0.5964844757099186, 0.6457991975341445]}, "precision": 0.6345492085340675, "recall": 0.6073781291172595}, "location": {"f1": 0.6798096532970768, "f1_ci": {"90": [0.6518312969865437, 0.7069473970234486], "95": [0.6458321283960411, 0.7113758984903604]}, "precision": 0.6622516556291391, "recall": 0.6983240223463687}, "person": {"f1": 0.8351528384279476, "f1_ci": {"90": [0.8242736044555532, 0.8456305452479886], "95": [0.8225215199841636, 0.8476744109543876]}, "precision": 0.8243534482758621, "recall": 0.8462389380530974}, "product": {"f1": 0.6656118143459916, "f1_ci": {"90": [0.6426097657451765, 0.6862539349422875], "95": [0.6373492325760903, 0.6910826330952685]}, "precision": 0.6829004329004329, "recall": 0.6491769547325102}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7438676554478039, "micro/f1_ci": {}, "micro/recall": 0.6766995329527763, "micro/precision": 0.8258391386953768, "macro/f1": 0.7438676554478039, "macro/f1_ci": {}, "macro/recall": 0.6766995329527763, "macro/precision": 0.8258391386953768}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7780043175821539, "micro/f1_ci": {}, "micro/recall": 0.7502023823291315, "micro/precision": 0.8079461950429693, "macro/f1": 0.7780043175821539, "macro/f1_ci": {}, "macro/recall": 0.7502023823291315, "macro/precision": 0.8079461950429693}
eval/prediction.2020.test.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
 
eval/prediction.random.dev.json DELETED
The diff for this file is too large to render. See raw diff
 
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "random.train", "model": "vinai/bertweet-base", "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_random", "dataset_name": null, "local_dataset": null, "model": "vinai/bertweet-base", "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}