asahi417 commited on
Commit
4fda3c6
1 Parent(s): 64d0943

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-selflabel2020
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.6455908683974932
22
+ - name: Precision (test_2021)
23
+ type: precision
24
+ value: 0.6254336513443192
25
+ - name: Recall (test_2021)
26
+ type: recall
27
+ value: 0.6670906567992599
28
+ - name: Macro F1 (test_2021)
29
+ type: f1_macro
30
+ value: 0.5962839441412403
31
+ - name: Macro Precision (test_2021)
32
+ type: precision_macro
33
+ value: 0.5727192958380657
34
+ - name: Macro Recall (test_2021)
35
+ type: recall_macro
36
+ value: 0.6267698180905158
37
+ - name: Entity Span F1 (test_2021)
38
+ type: f1_entity_span
39
+ value: 0.7846231324492194
40
+ - name: Entity Span Precision (test_2020)
41
+ type: precision_entity_span
42
+ value: 0.7600823937554206
43
+ - name: Entity Span Recall (test_2021)
44
+ type: recall_entity_span
45
+ value: 0.8108014340233607
46
+ - name: F1 (test_2020)
47
+ type: f1
48
+ value: 0.6589874095901421
49
+ - name: Precision (test_2020)
50
+ type: precision
51
+ value: 0.6810631229235881
52
+ - name: Recall (test_2020)
53
+ type: recall
54
+ value: 0.6382978723404256
55
+ - name: Macro F1 (test_2020)
56
+ type: f1_macro
57
+ value: 0.6185133813760935
58
+ - name: Macro Precision (test_2020)
59
+ type: precision_macro
60
+ value: 0.6351153721439261
61
+ - name: Macro Recall (test_2020)
62
+ type: recall_macro
63
+ value: 0.6085669577041991
64
+ - name: Entity Span F1 (test_2020)
65
+ type: f1_entity_span
66
+ value: 0.7670865719646207
67
+ - name: Entity Span Precision (test_2020)
68
+ type: precision_entity_span
69
+ value: 0.7932372505543237
70
+ - name: Entity Span Recall (test_2020)
71
+ type: recall_entity_span
72
+ value: 0.7426050856253243
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-selflabel2020
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.6455908683974932
86
+ - Precision (micro): 0.6254336513443192
87
+ - Recall (micro): 0.6670906567992599
88
+ - F1 (macro): 0.5962839441412403
89
+ - Precision (macro): 0.5727192958380657
90
+ - Recall (macro): 0.6267698180905158
91
+
92
+
93
+
94
+ The per-entity breakdown of the F1 score on the test set are below:
95
+ - corporation: 0.522762148337596
96
+ - creative_work: 0.468235294117647
97
+ - event: 0.4446564885496183
98
+ - group: 0.6155398587285571
99
+ - location: 0.6423718344657197
100
+ - person: 0.840225906358171
101
+ - product: 0.6401960784313725
102
+
103
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
104
+ - F1 (micro):
105
+ - 90%: [0.6371204057050158, 0.6550747724054871]
106
+ - 95%: [0.6350657043101348, 0.6568098006368783]
107
+ - F1 (macro):
108
+ - 90%: [0.6371204057050158, 0.6550747724054871]
109
+ - 95%: [0.6350657043101348, 0.6568098006368783]
110
+
111
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-tweetner7-selflabel2020/raw/main/eval/metric.json)
112
+ and [metric file of entity span](https://huggingface.co/tner/roberta-large-tweetner7-selflabel2020/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-selflabel2020")
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: 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-selflabel2020/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.6497159859345416, "micro/f1_ci": {}, "micro/recall": 0.6274817136886103, "micro/precision": 0.6735838474481212, "macro/f1": 0.595168476497736, "macro/f1_ci": {}, "macro/recall": 0.5823140804003363, "macro/precision": 0.6134127256594191, "per_entity_metric": {"corporation": {"f1": 0.503896103896104, "f1_ci": {}, "precision": 0.532967032967033, "recall": 0.47783251231527096}, "creative_work": {"f1": 0.5169082125603864, "f1_ci": {}, "precision": 0.5194174757281553, "recall": 0.5144230769230769}, "event": {"f1": 0.3747276688453159, "f1_ci": {}, "precision": 0.4236453201970443, "recall": 0.3359375}, "group": {"f1": 0.5687203791469194, "f1_ci": {}, "precision": 0.6153846153846154, "recall": 0.5286343612334802}, "location": {"f1": 0.6716417910447762, "f1_ci": {}, "precision": 0.6108597285067874, "recall": 0.7458563535911602}, "person": {"f1": 0.8765217391304349, "f1_ci": {}, "precision": 0.9130434782608695, "recall": 0.842809364548495}, "product": {"f1": 0.6537634408602151, "f1_ci": {}, "precision": 0.6785714285714286, "recall": 0.6307053941908713}}}, "2021.test": {"micro/f1": 0.6455908683974932, "micro/f1_ci": {"90": [0.6371204057050158, 0.6550747724054871], "95": [0.6350657043101348, 0.6568098006368783]}, "micro/recall": 0.6670906567992599, "micro/precision": 0.6254336513443192, "macro/f1": 0.5962839441412403, "macro/f1_ci": {"90": [0.5866402556988275, 0.6060444749938684], "95": [0.5847471469279276, 0.6077635044702457]}, "macro/recall": 0.6267698180905158, "macro/precision": 0.5727192958380657, "per_entity_metric": {"corporation": {"f1": 0.522762148337596, "f1_ci": {"90": [0.49973681393417374, 0.5471596100193149], "95": [0.4945873783946403, 0.5525733399971992]}, "precision": 0.4843601895734597, "recall": 0.5677777777777778}, "creative_work": {"f1": 0.468235294117647, "f1_ci": {"90": [0.4391420478553882, 0.4976060818012257], "95": [0.43346081582227297, 0.5044102177633336]}, "precision": 0.4107327141382869, "recall": 0.5444596443228454}, "event": {"f1": 0.4446564885496183, "f1_ci": {"90": [0.42187388657957237, 0.46923141953822195], "95": [0.4184013216599329, 0.4749416023012337]}, "precision": 0.4674022066198596, "recall": 0.4240218380345769}, "group": {"f1": 0.6155398587285571, "f1_ci": {"90": [0.5951667589966113, 0.6381605192440433], "95": [0.5920980489275562, 0.6428354803338648]}, "precision": 0.6288659793814433, "recall": 0.6027667984189723}, "location": {"f1": 0.6423718344657197, "f1_ci": {"90": [0.6144162449467848, 0.6682611851729876], "95": [0.61024506683641, 0.6720074834037416]}, "precision": 0.5758582502768549, "recall": 0.7262569832402235}, "person": {"f1": 0.840225906358171, "f1_ci": {"90": [0.8297661584761087, 0.851118291744757], "95": [0.8284000592006534, 0.8525454107688213]}, "precision": 0.8303925099027728, "recall": 0.8502949852507374}, "product": {"f1": 0.6401960784313725, "f1_ci": {"90": [0.6188782031721285, 0.6619447156064523], "95": [0.6147969820761672, 0.6654252026481837]}, "precision": 0.6114232209737828, "recall": 0.6718106995884774}}}, "2020.test": {"micro/f1": 0.6589874095901421, "micro/f1_ci": {"90": [0.6385021699858212, 0.6777882762990388], "95": [0.6344556724262541, 0.6809892848641955]}, "micro/recall": 0.6382978723404256, "micro/precision": 0.6810631229235881, "macro/f1": 0.6185133813760935, "macro/f1_ci": {"90": [0.5945654495892557, 0.6390184922948274], "95": [0.5910565487766962, 0.6431119627935548]}, "macro/recall": 0.6085669577041991, "macro/precision": 0.6351153721439261, "per_entity_metric": {"corporation": {"f1": 0.581453634085213, "f1_ci": {"90": [0.5203143050197259, 0.6341570860642527], "95": [0.5087267380681245, 0.645339211120602]}, "precision": 0.5576923076923077, "recall": 0.6073298429319371}, "creative_work": {"f1": 0.519893899204244, "f1_ci": {"90": [0.45919192076494225, 0.5729194819819821], "95": [0.4496993234778251, 0.5788147694818441]}, "precision": 0.494949494949495, "recall": 0.547486033519553}, "event": {"f1": 0.48049281314168374, "f1_ci": {"90": [0.4285569985569985, 0.5315007805396874], "95": [0.4188008130081301, 0.5401474904055986]}, "precision": 0.527027027027027, "recall": 0.44150943396226416}, "group": {"f1": 0.5724907063197026, "f1_ci": {"90": [0.5248468820106881, 0.6198803159753711], "95": [0.5152538655348761, 0.6319220978293597]}, "precision": 0.6784140969162996, "recall": 0.49517684887459806}, "location": {"f1": 0.6685878962536022, "f1_ci": {"90": [0.6005705705705706, 0.7272727272727272], "95": [0.5917728867357167, 0.7374579124579128]}, "precision": 0.6373626373626373, "recall": 0.703030303030303}, "person": {"f1": 0.8415584415584415, "f1_ci": {"90": [0.8165424697279215, 0.8626729733238138], "95": [0.8128192329092423, 0.8676861375030747]}, "precision": 0.8694096601073346, "recall": 0.8154362416107382}, "product": {"f1": 0.6651162790697673, "f1_ci": {"90": [0.6157048774126238, 0.7126683307139996], "95": [0.6045411621182, 0.723205128986824]}, "precision": 0.680952380952381, "recall": 0.65}}}, "2021.test (span detection)": {"micro/f1": 0.7846231324492194, "micro/f1_ci": {}, "micro/recall": 0.8108014340233607, "micro/precision": 0.7600823937554206, "macro/f1": 0.7846231324492194, "macro/f1_ci": {}, "macro/recall": 0.8108014340233607, "macro/precision": 0.7600823937554206}, "2020.test (span detection)": {"micro/f1": 0.7670865719646207, "micro/f1_ci": {}, "micro/recall": 0.7426050856253243, "micro/precision": 0.7932372505543237, "macro/f1": 0.7670865719646207, "macro/f1_ci": {}, "macro/recall": 0.7426050856253243, "macro/precision": 0.7932372505543237}}
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6589874095901421, "micro/f1_ci": {"90": [0.6385021699858212, 0.6777882762990388], "95": [0.6344556724262541, 0.6809892848641955]}, "micro/recall": 0.6382978723404256, "micro/precision": 0.6810631229235881, "macro/f1": 0.6185133813760935, "macro/f1_ci": {"90": [0.5945654495892557, 0.6390184922948274], "95": [0.5910565487766962, 0.6431119627935548]}, "macro/recall": 0.6085669577041991, "macro/precision": 0.6351153721439261, "per_entity_metric": {"corporation": {"f1": 0.581453634085213, "f1_ci": {"90": [0.5203143050197259, 0.6341570860642527], "95": [0.5087267380681245, 0.645339211120602]}, "precision": 0.5576923076923077, "recall": 0.6073298429319371}, "creative_work": {"f1": 0.519893899204244, "f1_ci": {"90": [0.45919192076494225, 0.5729194819819821], "95": [0.4496993234778251, 0.5788147694818441]}, "precision": 0.494949494949495, "recall": 0.547486033519553}, "event": {"f1": 0.48049281314168374, "f1_ci": {"90": [0.4285569985569985, 0.5315007805396874], "95": [0.4188008130081301, 0.5401474904055986]}, "precision": 0.527027027027027, "recall": 0.44150943396226416}, "group": {"f1": 0.5724907063197026, "f1_ci": {"90": [0.5248468820106881, 0.6198803159753711], "95": [0.5152538655348761, 0.6319220978293597]}, "precision": 0.6784140969162996, "recall": 0.49517684887459806}, "location": {"f1": 0.6685878962536022, "f1_ci": {"90": [0.6005705705705706, 0.7272727272727272], "95": [0.5917728867357167, 0.7374579124579128]}, "precision": 0.6373626373626373, "recall": 0.703030303030303}, "person": {"f1": 0.8415584415584415, "f1_ci": {"90": [0.8165424697279215, 0.8626729733238138], "95": [0.8128192329092423, 0.8676861375030747]}, "precision": 0.8694096601073346, "recall": 0.8154362416107382}, "product": {"f1": 0.6651162790697673, "f1_ci": {"90": [0.6157048774126238, 0.7126683307139996], "95": [0.6045411621182, 0.723205128986824]}, "precision": 0.680952380952381, "recall": 0.65}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6455908683974932, "micro/f1_ci": {"90": [0.6371204057050158, 0.6550747724054871], "95": [0.6350657043101348, 0.6568098006368783]}, "micro/recall": 0.6670906567992599, "micro/precision": 0.6254336513443192, "macro/f1": 0.5962839441412403, "macro/f1_ci": {"90": [0.5866402556988275, 0.6060444749938684], "95": [0.5847471469279276, 0.6077635044702457]}, "macro/recall": 0.6267698180905158, "macro/precision": 0.5727192958380657, "per_entity_metric": {"corporation": {"f1": 0.522762148337596, "f1_ci": {"90": [0.49973681393417374, 0.5471596100193149], "95": [0.4945873783946403, 0.5525733399971992]}, "precision": 0.4843601895734597, "recall": 0.5677777777777778}, "creative_work": {"f1": 0.468235294117647, "f1_ci": {"90": [0.4391420478553882, 0.4976060818012257], "95": [0.43346081582227297, 0.5044102177633336]}, "precision": 0.4107327141382869, "recall": 0.5444596443228454}, "event": {"f1": 0.4446564885496183, "f1_ci": {"90": [0.42187388657957237, 0.46923141953822195], "95": [0.4184013216599329, 0.4749416023012337]}, "precision": 0.4674022066198596, "recall": 0.4240218380345769}, "group": {"f1": 0.6155398587285571, "f1_ci": {"90": [0.5951667589966113, 0.6381605192440433], "95": [0.5920980489275562, 0.6428354803338648]}, "precision": 0.6288659793814433, "recall": 0.6027667984189723}, "location": {"f1": 0.6423718344657197, "f1_ci": {"90": [0.6144162449467848, 0.6682611851729876], "95": [0.61024506683641, 0.6720074834037416]}, "precision": 0.5758582502768549, "recall": 0.7262569832402235}, "person": {"f1": 0.840225906358171, "f1_ci": {"90": [0.8297661584761087, 0.851118291744757], "95": [0.8284000592006534, 0.8525454107688213]}, "precision": 0.8303925099027728, "recall": 0.8502949852507374}, "product": {"f1": 0.6401960784313725, "f1_ci": {"90": [0.6188782031721285, 0.6619447156064523], "95": [0.6147969820761672, 0.6654252026481837]}, "precision": 0.6114232209737828, "recall": 0.6718106995884774}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7670865719646207, "micro/f1_ci": {}, "micro/recall": 0.7426050856253243, "micro/precision": 0.7932372505543237, "macro/f1": 0.7670865719646207, "macro/f1_ci": {}, "macro/recall": 0.7426050856253243, "macro/precision": 0.7932372505543237}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7846231324492194, "micro/f1_ci": {}, "micro/recall": 0.8108014340233607, "micro/precision": 0.7600823937554206, "macro/f1": 0.7846231324492194, "macro/f1_ci": {}, "macro/recall": 0.8108014340233607, "macro/precision": 0.7600823937554206}
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "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.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}