asahi417 commited on
Commit
ba2eea8
1 Parent(s): c910506

model update

Browse files
README.md ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - bionlp2004
4
+ metrics:
5
+ - f1
6
+ - precision
7
+ - recall
8
+ model-index:
9
+ - name: tner/deberta-v3-large-bionlp2004
10
+ results:
11
+ - task:
12
+ name: Token Classification
13
+ type: token-classification
14
+ dataset:
15
+ name: bionlp2004
16
+ type: bionlp2004
17
+ args: bionlp2004
18
+ metrics:
19
+ - name: F1
20
+ type: f1
21
+ value: 0.758624442267929
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.7174763277068753
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.8047794966520434
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.7195387988303987
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.681309505763584
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.7691804743892025
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.796539152201121
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7533710756562018
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.8449549757561764
46
+
47
+ pipeline_tag: token-classification
48
+ widget:
49
+ - text: "Jacob Collier is a Grammy awarded artist from England."
50
+ example_title: "NER Example 1"
51
+ ---
52
+ # tner/deberta-v3-large-bionlp2004
53
+
54
+ This model is a fine-tuned version of [microsoft/deberta-v3-large](https://huggingface.co/microsoft/deberta-v3-large) on the
55
+ [tner/bionlp2004](https://huggingface.co/datasets/tner/bionlp2004) dataset.
56
+ Model fine-tuning is done via [T-NER](https://github.com/asahi417/tner)'s hyper-parameter search (see the repository
57
+ for more detail). It achieves the following results on the test set:
58
+ - F1 (micro): 0.758624442267929
59
+ - Precision (micro): 0.7174763277068753
60
+ - Recall (micro): 0.8047794966520434
61
+ - F1 (macro): 0.7195387988303987
62
+ - Precision (macro): 0.681309505763584
63
+ - Recall (macro): 0.7691804743892025
64
+
65
+ The per-entity breakdown of the F1 score on the test set are below:
66
+ - cell_line: 0.6465517241379309
67
+ - cell_type: 0.7562483203439935
68
+ - dna: 0.7449506810709253
69
+ - protein: 0.7757859652283577
70
+ - rna: 0.6741573033707865
71
+
72
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
73
+ - F1 (micro):
74
+ - 90%: [0.7508836679942893, 0.7667327003308145]
75
+ - 95%: [0.7498144548458301, 0.7680807868080707]
76
+ - F1 (macro):
77
+ - 90%: [0.7508836679942893, 0.7667327003308145]
78
+ - 95%: [0.7498144548458301, 0.7680807868080707]
79
+
80
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/deberta-v3-large-bionlp2004/raw/main/eval/metric.json)
81
+ and [metric file of entity span](https://huggingface.co/tner/deberta-v3-large-bionlp2004/raw/main/eval/metric_span.json).
82
+
83
+ ### Usage
84
+ This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
85
+ ```shell
86
+ pip install tner
87
+ ```
88
+ and activate model as below.
89
+ ```python
90
+ from tner import TransformersNER
91
+ model = TransformersNER("tner/deberta-v3-large-bionlp2004")
92
+ model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
93
+ ```
94
+ It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
95
+
96
+ ### Training hyperparameters
97
+
98
+ The following hyperparameters were used during training:
99
+ - dataset: ['tner/bionlp2004']
100
+ - dataset_split: train
101
+ - dataset_name: None
102
+ - local_dataset: None
103
+ - model: microsoft/deberta-v3-large
104
+ - crf: True
105
+ - max_length: 128
106
+ - epoch: 15
107
+ - batch_size: 16
108
+ - lr: 1e-05
109
+ - random_seed: 42
110
+ - gradient_accumulation_steps: 8
111
+ - weight_decay: 1e-07
112
+ - lr_warmup_step_ratio: 0.1
113
+ - max_grad_norm: None
114
+
115
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/deberta-v3-large-bionlp2004/raw/main/trainer_config.json).
116
+
117
+ ### Reference
118
+ If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
119
+
120
+ ```
121
+
122
+ @inproceedings{ushio-camacho-collados-2021-ner,
123
+ title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
124
+ author = "Ushio, Asahi and
125
+ Camacho-Collados, Jose",
126
+ booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
127
+ month = apr,
128
+ year = "2021",
129
+ address = "Online",
130
+ publisher = "Association for Computational Linguistics",
131
+ url = "https://aclanthology.org/2021.eacl-demos.7",
132
+ doi = "10.18653/v1/2021.eacl-demos.7",
133
+ pages = "53--62",
134
+ 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.",
135
+ }
136
+
137
+ ```
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "tner_ckpt/bionlp2004_deberta_v3_large/best_model",
3
  "architectures": [
4
  "DebertaV2ForTokenClassification"
5
  ],
 
1
  {
2
+ "_name_or_path": "tner_ckpt/bionlp2004_deberta_v3_large/model_cghqta/epoch_5",
3
  "architectures": [
4
  "DebertaV2ForTokenClassification"
5
  ],
eval/metric.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.758624442267929, "micro/f1_ci": {"90": [0.7508836679942893, 0.7667327003308145], "95": [0.7498144548458301, 0.7680807868080707]}, "micro/recall": 0.8047794966520434, "micro/precision": 0.7174763277068753, "macro/f1": 0.7195387988303987, "macro/f1_ci": {"90": [0.704160346303814, 0.734315970324062], "95": [0.7011867069041885, 0.7369915261120946]}, "macro/recall": 0.7691804743892025, "macro/precision": 0.681309505763584, "per_entity_metric": {"cell_line": {"f1": 0.6465517241379309, "f1_ci": {"90": [0.6089615709080467, 0.681785134696527], "95": [0.5990760017778193, 0.6864572985282207]}, "precision": 0.5681818181818182, "recall": 0.75}, "cell_type": {"f1": 0.7562483203439935, "f1_ci": {"90": [0.7410739312769105, 0.771535982706181], "95": [0.738658976728006, 0.7751383966368984]}, "precision": 0.7816666666666666, "recall": 0.7324310255075481}, "dna": {"f1": 0.7449506810709253, "f1_ci": {"90": [0.7242533665740931, 0.7645011134479772], "95": [0.7196239737811436, 0.766789450954474]}, "precision": 0.739049394221808, "recall": 0.7509469696969697}, "protein": {"f1": 0.7757859652283577, "f1_ci": {"90": [0.766777076592289, 0.7852282635428913], "95": [0.7643832732252224, 0.7869697999538529]}, "precision": 0.7136228041100431, "recall": 0.8498125123347148}, "rna": {"f1": 0.6741573033707865, "f1_ci": {"90": [0.6153561253561253, 0.7310969549109966], "95": [0.6008369098712445, 0.7422877290950747]}, "precision": 0.6040268456375839, "recall": 0.7627118644067796}}}
eval/metric_span.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.796539152201121, "micro/f1_ci": {"90": [0.7896444164716317, 0.8039723864322159], "95": [0.7886216488815425, 0.8053749479886999]}, "micro/recall": 0.8449549757561764, "micro/precision": 0.7533710756562018, "macro/f1": 0.796539152201121, "macro/f1_ci": {"90": [0.7896444164716317, 0.8039723864322159], "95": [0.7886216488815425, 0.8053749479886999]}, "macro/recall": 0.8449549757561764, "macro/precision": 0.7533710756562018}
eval/prediction.validation.json ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:cf80a5659925b9c2ee6c1edf422f492c55032cde3599ec38f6e7d05e266bc68a
3
- size 1736225711
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c759ae61f9ee75129e6c3eb9cdba9e8fcb2840ce7bc4cf0357c64f317eb9695f
3
+ size 1736231215
tokenizer_config.json CHANGED
@@ -4,7 +4,7 @@
4
  "do_lower_case": false,
5
  "eos_token": "[SEP]",
6
  "mask_token": "[MASK]",
7
- "name_or_path": "tner_ckpt/bionlp2004_deberta_v3_large/best_model",
8
  "pad_token": "[PAD]",
9
  "sep_token": "[SEP]",
10
  "sp_model_kwargs": {},
 
4
  "do_lower_case": false,
5
  "eos_token": "[SEP]",
6
  "mask_token": "[MASK]",
7
+ "name_or_path": "tner_ckpt/bionlp2004_deberta_v3_large/model_cghqta/epoch_5",
8
  "pad_token": "[PAD]",
9
  "sep_token": "[SEP]",
10
  "sp_model_kwargs": {},
trainer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"dataset": ["tner/bionlp2004"], "dataset_split": "train", "dataset_name": null, "local_dataset": null, "model": "microsoft/deberta-v3-large", "crf": true, "max_length": 128, "epoch": 15, "batch_size": 16, "lr": 1e-05, "random_seed": 42, "gradient_accumulation_steps": 8, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.1, "max_grad_norm": null}