model update
Browse files- README.md +150 -0
- config.json +1 -1
- eval/metric.json +1 -0
- eval/metric_span.json +1 -0
- eval/prediction.validation.json +0 -0
- pytorch_model.bin +2 -2
- tokenizer_config.json +1 -1
- trainer_config.json +1 -0
README.md
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- tner/ontonotes5
|
4 |
+
metrics:
|
5 |
+
- f1
|
6 |
+
- precision
|
7 |
+
- recall
|
8 |
+
model-index:
|
9 |
+
- name: tner/deberta-v3-large-ontonotes5
|
10 |
+
results:
|
11 |
+
- task:
|
12 |
+
name: Token Classification
|
13 |
+
type: token-classification
|
14 |
+
dataset:
|
15 |
+
name: tner/ontonotes5
|
16 |
+
type: tner/ontonotes5
|
17 |
+
args: tner/ontonotes5
|
18 |
+
metrics:
|
19 |
+
- name: F1
|
20 |
+
type: f1
|
21 |
+
value: 0.9069623608411381
|
22 |
+
- name: Precision
|
23 |
+
type: precision
|
24 |
+
value: 0.902100360312857
|
25 |
+
- name: Recall
|
26 |
+
type: recall
|
27 |
+
value: 0.9118770542773386
|
28 |
+
- name: F1 (macro)
|
29 |
+
type: f1_macro
|
30 |
+
value: 0.834586960779896
|
31 |
+
- name: Precision (macro)
|
32 |
+
type: precision_macro
|
33 |
+
value: 0.8237351069457466
|
34 |
+
- name: Recall (macro)
|
35 |
+
type: recall_macro
|
36 |
+
value: 0.8475169311172334
|
37 |
+
- name: F1 (entity span)
|
38 |
+
type: f1_entity_span
|
39 |
+
value: 0.9267538434352359
|
40 |
+
- name: Precision (entity span)
|
41 |
+
type: precision_entity_span
|
42 |
+
value: 0.9217857456718517
|
43 |
+
- name: Recall (entity span)
|
44 |
+
type: recall_entity_span
|
45 |
+
value: 0.9317757839566492
|
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-ontonotes5
|
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/ontonotes5](https://huggingface.co/datasets/tner/ontonotes5) 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.9069623608411381
|
59 |
+
- Precision (micro): 0.902100360312857
|
60 |
+
- Recall (micro): 0.9118770542773386
|
61 |
+
- F1 (macro): 0.834586960779896
|
62 |
+
- Precision (macro): 0.8237351069457466
|
63 |
+
- Recall (macro): 0.8475169311172334
|
64 |
+
|
65 |
+
The per-entity breakdown of the F1 score on the test set are below:
|
66 |
+
- cardinal_number: 0.853475935828877
|
67 |
+
- date: 0.8815545959284392
|
68 |
+
- event: 0.8030303030303031
|
69 |
+
- facility: 0.7896678966789669
|
70 |
+
- geopolitical_area: 0.9650033867690223
|
71 |
+
- group: 0.9337209302325581
|
72 |
+
- language: 0.8372093023255814
|
73 |
+
- law: 0.6756756756756757
|
74 |
+
- location: 0.7624020887728459
|
75 |
+
- money: 0.8818897637795275
|
76 |
+
- ordinal_number: 0.8635235732009926
|
77 |
+
- organization: 0.914952751528627
|
78 |
+
- percent: 0.9
|
79 |
+
- person: 0.9609866599546942
|
80 |
+
- product: 0.7901234567901234
|
81 |
+
- quantity: 0.8161434977578474
|
82 |
+
- time: 0.674364896073903
|
83 |
+
- work_of_art: 0.7188405797101449
|
84 |
+
|
85 |
+
For F1 scores, the confidence interval is obtained by bootstrap as below:
|
86 |
+
- F1 (micro):
|
87 |
+
- 90%: [0.9019409960743083, 0.911751130722053]
|
88 |
+
- 95%: [0.9010822890967028, 0.9125611412371442]
|
89 |
+
- F1 (macro):
|
90 |
+
- 90%: [0.9019409960743083, 0.911751130722053]
|
91 |
+
- 95%: [0.9010822890967028, 0.9125611412371442]
|
92 |
+
|
93 |
+
Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/deberta-v3-large-ontonotes5/raw/main/eval/metric.json)
|
94 |
+
and [metric file of entity span](https://huggingface.co/tner/deberta-v3-large-ontonotes5/raw/main/eval/metric_span.json).
|
95 |
+
|
96 |
+
### Usage
|
97 |
+
This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
|
98 |
+
```shell
|
99 |
+
pip install tner
|
100 |
+
```
|
101 |
+
and activate model as below.
|
102 |
+
```python
|
103 |
+
from tner import TransformersNER
|
104 |
+
model = TransformersNER("tner/deberta-v3-large-ontonotes5")
|
105 |
+
model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
|
106 |
+
```
|
107 |
+
It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
|
108 |
+
|
109 |
+
### Training hyperparameters
|
110 |
+
|
111 |
+
The following hyperparameters were used during training:
|
112 |
+
- dataset: ['tner/ontonotes5']
|
113 |
+
- dataset_split: train
|
114 |
+
- dataset_name: None
|
115 |
+
- local_dataset: None
|
116 |
+
- model: microsoft/deberta-v3-large
|
117 |
+
- crf: True
|
118 |
+
- max_length: 128
|
119 |
+
- epoch: 15
|
120 |
+
- batch_size: 16
|
121 |
+
- lr: 1e-05
|
122 |
+
- random_seed: 42
|
123 |
+
- gradient_accumulation_steps: 4
|
124 |
+
- weight_decay: 1e-07
|
125 |
+
- lr_warmup_step_ratio: 0.1
|
126 |
+
- max_grad_norm: 10.0
|
127 |
+
|
128 |
+
The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/deberta-v3-large-ontonotes5/raw/main/trainer_config.json).
|
129 |
+
|
130 |
+
### Reference
|
131 |
+
If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
|
132 |
+
|
133 |
+
```
|
134 |
+
|
135 |
+
@inproceedings{ushio-camacho-collados-2021-ner,
|
136 |
+
title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
|
137 |
+
author = "Ushio, Asahi and
|
138 |
+
Camacho-Collados, Jose",
|
139 |
+
booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
|
140 |
+
month = apr,
|
141 |
+
year = "2021",
|
142 |
+
address = "Online",
|
143 |
+
publisher = "Association for Computational Linguistics",
|
144 |
+
url = "https://aclanthology.org/2021.eacl-demos.7",
|
145 |
+
doi = "10.18653/v1/2021.eacl-demos.7",
|
146 |
+
pages = "53--62",
|
147 |
+
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.",
|
148 |
+
}
|
149 |
+
|
150 |
+
```
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "tner_ckpt/ontonotes5_deberta_v3_large/
|
3 |
"architectures": [
|
4 |
"DebertaV2ForTokenClassification"
|
5 |
],
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "tner_ckpt/ontonotes5_deberta_v3_large/model_ayzfwn/epoch_5",
|
3 |
"architectures": [
|
4 |
"DebertaV2ForTokenClassification"
|
5 |
],
|
eval/metric.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"micro/f1": 0.9069623608411381, "micro/f1_ci": {"90": [0.9019409960743083, 0.911751130722053], "95": [0.9010822890967028, 0.9125611412371442]}, "micro/recall": 0.9118770542773386, "micro/precision": 0.902100360312857, "macro/f1": 0.834586960779896, "macro/f1_ci": {"90": [0.8209804467128787, 0.8467249999163714], "95": [0.8183331796999228, 0.8488775156564468]}, "macro/recall": 0.8475169311172334, "macro/precision": 0.8237351069457466, "per_entity_metric": {"cardinal_number": {"f1": 0.853475935828877, "f1_ci": {"90": [0.8330497989081731, 0.8718031833104767], "95": [0.8292140789883788, 0.875]}, "precision": 0.853475935828877, "recall": 0.853475935828877}, "date": {"f1": 0.8815545959284392, "f1_ci": {"90": [0.8680905896697763, 0.8941108258988675], "95": [0.8660710010497302, 0.8963422156536515]}, "precision": 0.8713414634146341, "recall": 0.8920099875156055}, "event": {"f1": 0.8030303030303031, "f1_ci": {"90": [0.7258064516129032, 0.8676990493166965], "95": [0.7121147919876734, 0.8799999999999999]}, "precision": 0.7681159420289855, "recall": 0.8412698412698413}, "facility": {"f1": 0.7896678966789669, "f1_ci": {"90": [0.733052273663965, 0.8432094752717251], "95": [0.725635331440975, 0.8512490002665958]}, "precision": 0.7867647058823529, "recall": 0.7925925925925926}, "geopolitical_area": {"f1": 0.9650033867690223, "f1_ci": {"90": [0.959691207666892, 0.9698219691594531], "95": [0.9588066921705949, 0.970889877651981]}, "precision": 0.9762448606669712, "recall": 0.9540178571428571}, "group": {"f1": 0.9337209302325581, "f1_ci": {"90": [0.9186619111684506, 0.9476157489809728], "95": [0.9160821541280667, 0.9494624796759169]}, "precision": 0.9135381114903299, "recall": 0.9548156956004756}, "language": {"f1": 0.8372093023255814, "f1_ci": {"90": [0.7317073170731707, 0.9230769230769231], "95": [0.7058823529411765, 0.9411764705882353]}, "precision": 0.8571428571428571, "recall": 0.8181818181818182}, "law": {"f1": 0.6756756756756757, "f1_ci": {"90": [0.5507246376811594, 0.7858225108225106], "95": [0.5194564694564695, 0.8048859676908459]}, "precision": 0.7352941176470589, "recall": 0.625}, "location": {"f1": 0.7624020887728459, "f1_ci": {"90": [0.7159090909090909, 0.8052948402948403], "95": [0.7052152460836314, 0.8146637915859885]}, "precision": 0.7156862745098039, "recall": 0.8156424581005587}, "money": {"f1": 0.8818897637795275, "f1_ci": {"90": [0.8486692716920033, 0.9141318240683817], "95": [0.8442179400941717, 0.9222977161045344]}, "precision": 0.8722741433021807, "recall": 0.89171974522293}, "ordinal_number": {"f1": 0.8635235732009926, "f1_ci": {"90": [0.8323637555580891, 0.8932087017273362], "95": [0.824452588940783, 0.8984027892294282]}, "precision": 0.8365384615384616, "recall": 0.8923076923076924}, "organization": {"f1": 0.914952751528627, "f1_ci": {"90": [0.9040703443911496, 0.9256022910341289], "95": [0.9023951322353315, 0.9270120526085166]}, "precision": 0.9129229062673322, "recall": 0.916991643454039}, "percent": {"f1": 0.9, "f1_ci": {"90": [0.8643685509834927, 0.9322760755538995], "95": [0.858823101292919, 0.9376177922077923]}, "precision": 0.8974358974358975, "recall": 0.9025787965616046}, "person": {"f1": 0.9609866599546942, "f1_ci": {"90": [0.9549051480350558, 0.9671870030430941], "95": [0.9536727221285938, 0.9684061859032064]}, "precision": 0.961712846347607, "recall": 0.960261569416499}, "product": {"f1": 0.7901234567901234, "f1_ci": {"90": [0.7134465675866949, 0.8588271382172501], "95": [0.6945750544365813, 0.8689675697865352]}, "precision": 0.7441860465116279, "recall": 0.8421052631578947}, "quantity": {"f1": 0.8161434977578474, "f1_ci": {"90": [0.7536101904204847, 0.8716280602159256], "95": [0.7377543859649123, 0.8820588235294119]}, "precision": 0.7711864406779662, "recall": 0.8666666666666667}, "time": {"f1": 0.674364896073903, "f1_ci": {"90": [0.6221192233423761, 0.721523216148403], "95": [0.6117517618294261, 0.7317103734947124]}, "precision": 0.6606334841628959, "recall": 0.6886792452830188}, "work_of_art": {"f1": 0.7188405797101449, "f1_ci": {"90": [0.6665750915750914, 0.7664173228346457], "95": [0.6527626811594202, 0.7781568101472706]}, "precision": 0.6927374301675978, "recall": 0.7469879518072289}}}
|
eval/metric_span.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"micro/f1": 0.9267538434352359, "micro/f1_ci": {"90": [0.922241598332788, 0.9310239217571861], "95": [0.9214101526505009, 0.9317962848686707]}, "micro/recall": 0.9317757839566492, "micro/precision": 0.9217857456718517, "macro/f1": 0.9267538434352359, "macro/f1_ci": {"90": [0.922241598332788, 0.9310239217571861], "95": [0.9214101526505009, 0.9317962848686707]}, "macro/recall": 0.9317757839566492, "macro/precision": 0.9217857456718517}
|
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:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bf457f85553cfc6301d4ec312cc1723387adcca7d8d8e001b5f52c357b4bac45
|
3 |
+
size 1736337839
|
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/ontonotes5_deberta_v3_large/
|
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/ontonotes5_deberta_v3_large/model_ayzfwn/epoch_5",
|
8 |
"pad_token": "[PAD]",
|
9 |
"sep_token": "[SEP]",
|
10 |
"sp_model_kwargs": {},
|
trainer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"dataset": ["tner/ontonotes5"], "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": 4, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.1, "max_grad_norm": 10.0}
|