asahi417 commited on
Commit
7ad17aa
·
1 Parent(s): a652b48

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/roberta-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.7513434294088912
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.7090462042823481
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.7990071577003002
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.7165656135319811
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.6765580411075789
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.7685019796698731
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7936818107800032
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7490011269337158
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.8440314015238974
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/roberta-large-bionlp2004
53
+
54
+ This model is a fine-tuned version of [roberta-large](https://huggingface.co/roberta-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.7513434294088912
59
+ - Precision (micro): 0.7090462042823481
60
+ - Recall (micro): 0.7990071577003002
61
+ - F1 (macro): 0.7165656135319811
62
+ - Precision (macro): 0.6765580411075789
63
+ - Recall (macro): 0.7685019796698731
64
+
65
+ The per-entity breakdown of the F1 score on the test set are below:
66
+ - cell_line: 0.6080273270708796
67
+ - cell_type: 0.7536311318169361
68
+ - dna: 0.7150259067357512
69
+ - protein: 0.7738602374694099
70
+ - rna: 0.7322834645669293
71
+
72
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
73
+ - F1 (micro):
74
+ - 90%: [0.7433198691879565, 0.7598437899577305]
75
+ - 95%: [0.7420570442205622, 0.7606216680394585]
76
+ - F1 (macro):
77
+ - 90%: [0.7433198691879565, 0.7598437899577305]
78
+ - 95%: [0.7420570442205622, 0.7606216680394585]
79
+
80
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-bionlp2004/raw/main/eval/metric.json)
81
+ and [metric file of entity span](https://huggingface.co/tner/roberta-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/roberta-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: roberta-large
104
+ - crf: True
105
+ - max_length: 128
106
+ - epoch: 15
107
+ - batch_size: 64
108
+ - lr: 1e-05
109
+ - random_seed: 42
110
+ - gradient_accumulation_steps: 1
111
+ - weight_decay: 1e-07
112
+ - lr_warmup_step_ratio: 0.1
113
+ - max_grad_norm: 10.0
114
+
115
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/roberta-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_roberta_large/best_model",
3
  "architectures": [
4
  "RobertaForTokenClassification"
5
  ],
 
1
  {
2
+ "_name_or_path": "tner_ckpt/bionlp2004_roberta_large/model_nhosiz/epoch_5",
3
  "architectures": [
4
  "RobertaForTokenClassification"
5
  ],
eval/metric.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7513434294088912, "micro/f1_ci": {"90": [0.7433198691879565, 0.7598437899577305], "95": [0.7420570442205622, 0.7606216680394585]}, "micro/recall": 0.7990071577003002, "micro/precision": 0.7090462042823481, "macro/f1": 0.7165656135319811, "macro/f1_ci": {"90": [0.7002937185557381, 0.7321969535350632], "95": [0.6972270983192475, 0.7346600395389665]}, "macro/recall": 0.7685019796698731, "macro/precision": 0.6765580411075789, "per_entity_metric": {"cell_line": {"f1": 0.6080273270708796, "f1_ci": {"90": [0.5711689355062354, 0.6439245116433064], "95": [0.5646332431360657, 0.6512838392124692]}, "precision": 0.5305514157973175, "recall": 0.712}, "cell_type": {"f1": 0.7536311318169361, "f1_ci": {"90": [0.7377440562233388, 0.7696953060664288], "95": [0.734812150861425, 0.7715685683137088]}, "precision": 0.7957175925925926, "recall": 0.7157730348776679}, "dna": {"f1": 0.7150259067357512, "f1_ci": {"90": [0.6943567374473204, 0.735043845043845], "95": [0.6908566375260775, 0.7386313612968293]}, "precision": 0.6571428571428571, "recall": 0.7840909090909091}, "protein": {"f1": 0.7738602374694099, "f1_ci": {"90": [0.7639543086904872, 0.7835213383443399], "95": [0.7612824390243694, 0.7853303273853405]}, "precision": 0.7155548105933623, "recall": 0.84251036116045}, "rna": {"f1": 0.7322834645669293, "f1_ci": {"90": [0.6693211406343131, 0.7923219373219372], "95": [0.6514665889665888, 0.8032804033198435]}, "precision": 0.6838235294117647, "recall": 0.788135593220339}}}
eval/metric_span.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7936818107800032, "micro/f1_ci": {"90": [0.7864966635201485, 0.8008673786899809], "95": [0.7850648957246626, 0.8018852848485037]}, "micro/recall": 0.8440314015238974, "micro/precision": 0.7490011269337158, "macro/f1": 0.7936818107800032, "macro/f1_ci": {"90": [0.7864966635201485, 0.8008673786899809], "95": [0.7850648957246626, 0.8018852848485037]}, "macro/recall": 0.8440314015238974, "macro/precision": 0.7490011269337158}
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:44b3057a5f8066f6723b94fbe639672389048eca5382b405eeb01bfb19695bee
3
- size 1417416753
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6cf4cd8c50bc77db8f0b0a2986cde41f4968b2cd2805c3e71b59e8081641e71
3
+ size 1417422193
tokenizer_config.json CHANGED
@@ -6,7 +6,7 @@
6
  "errors": "replace",
7
  "mask_token": "<mask>",
8
  "model_max_length": 512,
9
- "name_or_path": "tner_ckpt/bionlp2004_roberta_large/best_model",
10
  "pad_token": "<pad>",
11
  "sep_token": "</s>",
12
  "special_tokens_map_file": "tner_ckpt/bionlp2004_roberta_large/model_nhosiz/epoch_5/special_tokens_map.json",
 
6
  "errors": "replace",
7
  "mask_token": "<mask>",
8
  "model_max_length": 512,
9
+ "name_or_path": "tner_ckpt/bionlp2004_roberta_large/model_nhosiz/epoch_5",
10
  "pad_token": "<pad>",
11
  "sep_token": "</s>",
12
  "special_tokens_map_file": "tner_ckpt/bionlp2004_roberta_large/model_nhosiz/epoch_5/special_tokens_map.json",
trainer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"dataset": ["tner/bionlp2004"], "dataset_split": "train", "dataset_name": null, "local_dataset": null, "model": "roberta-large", "crf": true, "max_length": 128, "epoch": 15, "batch_size": 64, "lr": 1e-05, "random_seed": 42, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.1, "max_grad_norm": 10.0}