asahi417 commited on
Commit
1abb673
1 Parent(s): 2e8c17a

model update

Browse files
README.md ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - mit_movie_trivia
4
+ metrics:
5
+ - f1
6
+ - precision
7
+ - recall
8
+ model-index:
9
+ - name: tner/deberta-v3-large-mit-movie-trivia
10
+ results:
11
+ - task:
12
+ name: Token Classification
13
+ type: token-classification
14
+ dataset:
15
+ name: mit_movie_trivia
16
+ type: mit_movie_trivia
17
+ args: mit_movie_trivia
18
+ metrics:
19
+ - name: F1
20
+ type: f1
21
+ value: 0.7324478178368122
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.7186865267433988
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.746746394653535
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6597589403836301
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.6493939604029393
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6747458149186768
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.749525289142068
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7359322033898306
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7636299683432993
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-mit-movie-trivia
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/mit_movie_trivia](https://huggingface.co/datasets/tner/mit_movie_trivia) 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.7324478178368122
59
+ - Precision (micro): 0.7186865267433988
60
+ - Recall (micro): 0.746746394653535
61
+ - F1 (macro): 0.6597589403836301
62
+ - Precision (macro): 0.6493939604029393
63
+ - Recall (macro): 0.6747458149186768
64
+
65
+ The per-entity breakdown of the F1 score on the test set are below:
66
+ - actor: 0.9590417310664605
67
+ - award: 0.4755244755244755
68
+ - character_name: 0.7391304347826086
69
+ - date: 0.9640179910044978
70
+ - director: 0.909706546275395
71
+ - genre: 0.755114693118413
72
+ - opinion: 0.4910714285714286
73
+ - origin: 0.3922518159806296
74
+ - plot: 0.4929757343550447
75
+ - quote: 0.7391304347826088
76
+ - relationship: 0.5705705705705706
77
+ - soundtrack: 0.42857142857142855
78
+
79
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
80
+ - F1 (micro):
81
+ - 90%: [0.7213456287685677, 0.742502895519075]
82
+ - 95%: [0.7198169787204788, 0.7460320515170399]
83
+ - F1 (macro):
84
+ - 90%: [0.7213456287685677, 0.742502895519075]
85
+ - 95%: [0.7198169787204788, 0.7460320515170399]
86
+
87
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/deberta-v3-large-mit-movie-trivia/raw/main/eval/metric.json)
88
+ and [metric file of entity span](https://huggingface.co/tner/deberta-v3-large-mit-movie-trivia/raw/main/eval/metric_span.json).
89
+
90
+ ### Usage
91
+ This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
92
+ ```shell
93
+ pip install tner
94
+ ```
95
+ and activate model as below.
96
+ ```python
97
+ from tner import TransformersNER
98
+ model = TransformersNER("tner/deberta-v3-large-mit-movie-trivia")
99
+ model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
100
+ ```
101
+ It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
102
+
103
+ ### Training hyperparameters
104
+
105
+ The following hyperparameters were used during training:
106
+ - dataset: ['tner/mit_movie_trivia']
107
+ - dataset_split: train
108
+ - dataset_name: None
109
+ - local_dataset: None
110
+ - model: microsoft/deberta-v3-large
111
+ - crf: True
112
+ - max_length: 128
113
+ - epoch: 15
114
+ - batch_size: 16
115
+ - lr: 1e-05
116
+ - random_seed: 42
117
+ - gradient_accumulation_steps: 4
118
+ - weight_decay: 1e-07
119
+ - lr_warmup_step_ratio: 0.1
120
+ - max_grad_norm: None
121
+
122
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/deberta-v3-large-mit-movie-trivia/raw/main/trainer_config.json).
123
+
124
+ ### Reference
125
+ If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
126
+
127
+ ```
128
+
129
+ @inproceedings{ushio-camacho-collados-2021-ner,
130
+ title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
131
+ author = "Ushio, Asahi and
132
+ Camacho-Collados, Jose",
133
+ booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
134
+ month = apr,
135
+ year = "2021",
136
+ address = "Online",
137
+ publisher = "Association for Computational Linguistics",
138
+ url = "https://aclanthology.org/2021.eacl-demos.7",
139
+ doi = "10.18653/v1/2021.eacl-demos.7",
140
+ pages = "53--62",
141
+ 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.",
142
+ }
143
+
144
+ ```
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "tner_ckpt/mit_movie_trivia_deberta_v3_large/best_model",
3
  "architectures": [
4
  "DebertaV2ForTokenClassification"
5
  ],
 
1
  {
2
+ "_name_or_path": "tner_ckpt/mit_movie_trivia_deberta_v3_large/model_rgwuwr/epoch_5",
3
  "architectures": [
4
  "DebertaV2ForTokenClassification"
5
  ],
eval/metric.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7324478178368122, "micro/f1_ci": {"90": [0.7213456287685677, 0.742502895519075], "95": [0.7198169787204788, 0.7460320515170399]}, "micro/recall": 0.746746394653535, "micro/precision": 0.7186865267433988, "macro/f1": 0.6597589403836301, "macro/f1_ci": {"90": [0.626187284258936, 0.6886112877936686], "95": [0.6207351107382689, 0.6929921662444682]}, "macro/recall": 0.6747458149186768, "macro/precision": 0.6493939604029393, "per_entity_metric": {"actor": {"f1": 0.9590417310664605, "f1_ci": {"90": [0.9506119297682675, 0.9674256910027863], "95": [0.9486777930500124, 0.9687562102543722]}, "precision": 0.9444444444444444, "recall": 0.9740973312401884}, "award": {"f1": 0.4755244755244755, "f1_ci": {"90": [0.3902439024390244, 0.5663864306784661], "95": [0.37141705069124425, 0.5828690476190477]}, "precision": 0.44155844155844154, "recall": 0.5151515151515151}, "character_name": {"f1": 0.7391304347826086, "f1_ci": {"90": [0.6994571044586552, 0.7751456876456877], "95": [0.687940448046831, 0.7833757784108667]}, "precision": 0.7015873015873015, "recall": 0.7809187279151943}, "date": {"f1": 0.9640179910044978, "f1_ci": {"90": [0.9531357020547946, 0.9742035620393553], "95": [0.9506469700990182, 0.9770297199170713]}, "precision": 0.9554234769687965, "recall": 0.972768532526475}, "director": {"f1": 0.909706546275395, "f1_ci": {"90": [0.8929881320434827, 0.9263193657984146], "95": [0.88940053548902, 0.9288156974032032]}, "precision": 0.8741865509761388, "recall": 0.9482352941176471}, "genre": {"f1": 0.755114693118413, "f1_ci": {"90": [0.7313228085387712, 0.7795221322448262], "95": [0.7266076737272389, 0.7837107883905914]}, "precision": 0.7390776699029126, "recall": 0.7718631178707225}, "opinion": {"f1": 0.4910714285714286, "f1_ci": {"90": [0.4395577262243929, 0.539553444699203], "95": [0.42980954097572693, 0.5492122875620395]}, "precision": 0.43478260869565216, "recall": 0.5641025641025641}, "origin": {"f1": 0.3922518159806296, "f1_ci": {"90": [0.3405250077663871, 0.44771792935648963], "95": [0.3317985893416927, 0.45755013816329176]}, "precision": 0.3632286995515695, "recall": 0.4263157894736842}, "plot": {"f1": 0.4929757343550447, "f1_ci": {"90": [0.47077832785029755, 0.5149341008990155], "95": [0.4652040411165297, 0.5178380252221502]}, "precision": 0.4964630225080386, "recall": 0.4895370957514268}, "quote": {"f1": 0.7391304347826088, "f1_ci": {"90": [0.6315315315315315, 0.8395308641975308], "95": [0.6105070603337611, 0.8536712398373985]}, "precision": 0.7555555555555555, "recall": 0.723404255319149}, "relationship": {"f1": 0.5705705705705706, "f1_ci": {"90": [0.5073746312684367, 0.6306780464675202], "95": [0.4984200575683226, 0.6439731995821846]}, "precision": 0.5864197530864198, "recall": 0.5555555555555556}, "soundtrack": {"f1": 0.42857142857142855, "f1_ci": {"90": [0.1111111111111111, 0.7142857142857143], "95": [0.0, 0.7777777777777777]}, "precision": 0.5, "recall": 0.375}}}
eval/metric_span.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.749525289142068, "micro/f1_ci": {"90": [0.7397126154825829, 0.7597425112279943], "95": [0.7379706607775025, 0.7623178184832154]}, "micro/recall": 0.7636299683432993, "micro/precision": 0.7359322033898306, "macro/f1": 0.749525289142068, "macro/f1_ci": {"90": [0.7397126154825829, 0.7597425112279943], "95": [0.7379706607775025, 0.7623178184832154]}, "macro/recall": 0.7636299683432993, "macro/precision": 0.7359322033898306}
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:8fff54b58199a785de8bcbf0fe86a1f54365a86f91c5acbd6f329d2ca9d4d96d
3
- size 1736283119
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15087b08ab22212d301c05abd689ed9d798c2cab47d7e3c595f5bd0d409609e7
3
+ size 1736288623
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/mit_movie_trivia_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/mit_movie_trivia_deberta_v3_large/model_rgwuwr/epoch_5",
8
  "pad_token": "[PAD]",
9
  "sep_token": "[SEP]",
10
  "sp_model_kwargs": {},
trainer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"dataset": ["tner/mit_movie_trivia"], "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": null}