model update
Browse files- README.md +135 -0
- config.json +1 -1
- eval/metric.json +1 -0
- eval/metric_span.json +1 -0
- eval/prediction.validation.json +0 -0
- tokenizer_config.json +1 -1
- trainer_config.json +1 -0
README.md
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- tner/btc
|
4 |
+
metrics:
|
5 |
+
- f1
|
6 |
+
- precision
|
7 |
+
- recall
|
8 |
+
model-index:
|
9 |
+
- name: tner/deberta-v3-large-btc
|
10 |
+
results:
|
11 |
+
- task:
|
12 |
+
name: Token Classification
|
13 |
+
type: token-classification
|
14 |
+
dataset:
|
15 |
+
name: tner/btc
|
16 |
+
type: tner/btc
|
17 |
+
args: tner/btc
|
18 |
+
metrics:
|
19 |
+
- name: F1
|
20 |
+
type: f1
|
21 |
+
value: 0.8399238265934805
|
22 |
+
- name: Precision
|
23 |
+
type: precision
|
24 |
+
value: 0.8237749945067018
|
25 |
+
- name: Recall
|
26 |
+
type: recall
|
27 |
+
value: 0.8567184643510055
|
28 |
+
- name: F1 (macro)
|
29 |
+
type: f1_macro
|
30 |
+
value: 0.7921150390682584
|
31 |
+
- name: Precision (macro)
|
32 |
+
type: precision_macro
|
33 |
+
value: 0.7766126681668878
|
34 |
+
- name: Recall (macro)
|
35 |
+
type: recall_macro
|
36 |
+
value: 0.8103758198218992
|
37 |
+
- name: F1 (entity span)
|
38 |
+
type: f1_entity_span
|
39 |
+
value: 0.9134087599417496
|
40 |
+
- name: Precision (entity span)
|
41 |
+
type: precision_entity_span
|
42 |
+
value: 0.8958470665787739
|
43 |
+
- name: Recall (entity span)
|
44 |
+
type: recall_entity_span
|
45 |
+
value: 0.931672760511883
|
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-btc
|
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/btc](https://huggingface.co/datasets/tner/btc) 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.8399238265934805
|
59 |
+
- Precision (micro): 0.8237749945067018
|
60 |
+
- Recall (micro): 0.8567184643510055
|
61 |
+
- F1 (macro): 0.7921150390682584
|
62 |
+
- Precision (macro): 0.7766126681668878
|
63 |
+
- Recall (macro): 0.8103758198218992
|
64 |
+
|
65 |
+
The per-entity breakdown of the F1 score on the test set are below:
|
66 |
+
- location: 0.7503949447077408
|
67 |
+
- organization: 0.7042372881355932
|
68 |
+
- person: 0.9217128843614413
|
69 |
+
|
70 |
+
For F1 scores, the confidence interval is obtained by bootstrap as below:
|
71 |
+
- F1 (micro):
|
72 |
+
- 90%: [0.8283024935970381, 0.8507400882379221]
|
73 |
+
- 95%: [0.8260021524132041, 0.8526162579659953]
|
74 |
+
- F1 (macro):
|
75 |
+
- 90%: [0.8283024935970381, 0.8507400882379221]
|
76 |
+
- 95%: [0.8260021524132041, 0.8526162579659953]
|
77 |
+
|
78 |
+
Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/deberta-v3-large-btc/raw/main/eval/metric.json)
|
79 |
+
and [metric file of entity span](https://huggingface.co/tner/deberta-v3-large-btc/raw/main/eval/metric_span.json).
|
80 |
+
|
81 |
+
### Usage
|
82 |
+
This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
|
83 |
+
```shell
|
84 |
+
pip install tner
|
85 |
+
```
|
86 |
+
and activate model as below.
|
87 |
+
```python
|
88 |
+
from tner import TransformersNER
|
89 |
+
model = TransformersNER("tner/deberta-v3-large-btc")
|
90 |
+
model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
|
91 |
+
```
|
92 |
+
It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
|
93 |
+
|
94 |
+
### Training hyperparameters
|
95 |
+
|
96 |
+
The following hyperparameters were used during training:
|
97 |
+
- dataset: ['tner/btc']
|
98 |
+
- dataset_split: train
|
99 |
+
- dataset_name: None
|
100 |
+
- local_dataset: None
|
101 |
+
- model: microsoft/deberta-v3-large
|
102 |
+
- crf: True
|
103 |
+
- max_length: 128
|
104 |
+
- epoch: 15
|
105 |
+
- batch_size: 16
|
106 |
+
- lr: 1e-05
|
107 |
+
- random_seed: 42
|
108 |
+
- gradient_accumulation_steps: 8
|
109 |
+
- weight_decay: None
|
110 |
+
- lr_warmup_step_ratio: 0.1
|
111 |
+
- max_grad_norm: None
|
112 |
+
|
113 |
+
The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/deberta-v3-large-btc/raw/main/trainer_config.json).
|
114 |
+
|
115 |
+
### Reference
|
116 |
+
If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
|
117 |
+
|
118 |
+
```
|
119 |
+
|
120 |
+
@inproceedings{ushio-camacho-collados-2021-ner,
|
121 |
+
title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
|
122 |
+
author = "Ushio, Asahi and
|
123 |
+
Camacho-Collados, Jose",
|
124 |
+
booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
|
125 |
+
month = apr,
|
126 |
+
year = "2021",
|
127 |
+
address = "Online",
|
128 |
+
publisher = "Association for Computational Linguistics",
|
129 |
+
url = "https://aclanthology.org/2021.eacl-demos.7",
|
130 |
+
doi = "10.18653/v1/2021.eacl-demos.7",
|
131 |
+
pages = "53--62",
|
132 |
+
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.",
|
133 |
+
}
|
134 |
+
|
135 |
+
```
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "tner_ckpt/btc_deberta_v3_large/
|
3 |
"architectures": [
|
4 |
"DebertaV2ForTokenClassification"
|
5 |
],
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "tner_ckpt/btc_deberta_v3_large/model_lzavco/epoch_5",
|
3 |
"architectures": [
|
4 |
"DebertaV2ForTokenClassification"
|
5 |
],
|
eval/metric.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"micro/f1": 0.8399238265934805, "micro/f1_ci": {"90": [0.8283024935970381, 0.8507400882379221], "95": [0.8260021524132041, 0.8526162579659953]}, "micro/recall": 0.8567184643510055, "micro/precision": 0.8237749945067018, "macro/f1": 0.7921150390682584, "macro/f1_ci": {"90": [0.7778836465333343, 0.8064908270960832], "95": [0.7744530632383323, 0.8088306344266144]}, "macro/recall": 0.8103758198218992, "macro/precision": 0.7766126681668878, "per_entity_metric": {"location": {"f1": 0.7503949447077408, "f1_ci": {"90": [0.722621343484653, 0.7783360088749672], "95": [0.7181196923659109, 0.7831327609287725]}, "precision": 0.753968253968254, "recall": 0.7468553459119497}, "organization": {"f1": 0.7042372881355932, "f1_ci": {"90": [0.680714976595495, 0.727503450051444], "95": [0.6767128243490045, 0.7317512781467873]}, "precision": 0.6543307086614173, "recall": 0.7623853211009174}, "person": {"f1": 0.9217128843614413, "f1_ci": {"90": [0.9119808330613168, 0.9304886792800428], "95": [0.9104814441886399, 0.9319999849049878]}, "precision": 0.9215390418709921, "recall": 0.9218867924528302}}}
|
eval/metric_span.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"micro/f1": 0.9134087599417496, "micro/f1_ci": {"90": [0.9063238930638302, 0.9201311718583651], "95": [0.9051626400610194, 0.9211604895898028]}, "micro/recall": 0.931672760511883, "micro/precision": 0.8958470665787739, "macro/f1": 0.9134087599417496, "macro/f1_ci": {"90": [0.9063238930638302, 0.9201311718583651], "95": [0.9051626400610194, 0.9211604895898028]}, "macro/recall": 0.931672760511883, "macro/precision": 0.8958470665787739}
|
eval/prediction.validation.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
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/btc_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/btc_deberta_v3_large/model_lzavco/epoch_5",
|
8 |
"pad_token": "[PAD]",
|
9 |
"sep_token": "[SEP]",
|
10 |
"sp_model_kwargs": {},
|
trainer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"dataset": ["tner/btc"], "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": null, "lr_warmup_step_ratio": 0.1, "max_grad_norm": null}
|