model update
Browse files- .gitattributes +1 -0
- README.md +138 -0
- added_tokens.json +3 -0
- config.json +53 -0
- eval/metric.first.answer.paragraph_answer.question.lmqg_qg_itquad.default.json +1 -0
- eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_itquad.default.json +1 -0
- eval/samples.test.hyp.paragraph_answer.question.lmqg_qg_itquad.default.txt +0 -0
- eval/samples.validation.hyp.paragraph_answer.question.lmqg_qg_itquad.default.txt +0 -0
- generation_config.json +7 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +8 -0
- spiece.model +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +12 -0
- trainer_config.json +1 -0
.gitattributes
CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
license: cc-by-4.0
|
4 |
+
metrics:
|
5 |
+
- bleu4
|
6 |
+
- meteor
|
7 |
+
- rouge-l
|
8 |
+
- bertscore
|
9 |
+
- moverscore
|
10 |
+
language: it
|
11 |
+
datasets:
|
12 |
+
- lmqg/qg_itquad
|
13 |
+
pipeline_tag: text2text-generation
|
14 |
+
tags:
|
15 |
+
- question generation
|
16 |
+
widget:
|
17 |
+
- text: "<hl> Dopo il 1971 <hl> , l' OPEC ha tardato ad adeguare i prezzi per riflettere tale deprezzamento."
|
18 |
+
example_title: "Question Generation Example 1"
|
19 |
+
- text: "L' individuazione del petrolio e lo sviluppo di nuovi giacimenti richiedeva in genere <hl> da cinque a dieci anni <hl> prima di una produzione significativa."
|
20 |
+
example_title: "Question Generation Example 2"
|
21 |
+
- text: "il <hl> Giappone <hl> è stato il paese più dipendente dal petrolio arabo."
|
22 |
+
example_title: "Question Generation Example 3"
|
23 |
+
model-index:
|
24 |
+
- name: vocabtrimmer/mt5-small-trimmed-it-itquad-qg
|
25 |
+
results:
|
26 |
+
- task:
|
27 |
+
name: Text2text Generation
|
28 |
+
type: text2text-generation
|
29 |
+
dataset:
|
30 |
+
name: lmqg/qg_itquad
|
31 |
+
type: default
|
32 |
+
args: default
|
33 |
+
metrics:
|
34 |
+
- name: BLEU4 (Question Generation)
|
35 |
+
type: bleu4_question_generation
|
36 |
+
value: 7.17
|
37 |
+
- name: ROUGE-L (Question Generation)
|
38 |
+
type: rouge_l_question_generation
|
39 |
+
value: 21.78
|
40 |
+
- name: METEOR (Question Generation)
|
41 |
+
type: meteor_question_generation
|
42 |
+
value: 17.45
|
43 |
+
- name: BERTScore (Question Generation)
|
44 |
+
type: bertscore_question_generation
|
45 |
+
value: 80.56
|
46 |
+
- name: MoverScore (Question Generation)
|
47 |
+
type: moverscore_question_generation
|
48 |
+
value: 56.59
|
49 |
+
---
|
50 |
+
|
51 |
+
# Model Card of `vocabtrimmer/mt5-small-trimmed-it-itquad-qg`
|
52 |
+
This model is fine-tuned version of [vocabtrimmer/mt5-small-trimmed-it](https://huggingface.co/vocabtrimmer/mt5-small-trimmed-it) for question generation task on the [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) (dataset_name: default) via [`lmqg`](https://github.com/asahi417/lm-question-generation).
|
53 |
+
|
54 |
+
|
55 |
+
### Overview
|
56 |
+
- **Language model:** [vocabtrimmer/mt5-small-trimmed-it](https://huggingface.co/vocabtrimmer/mt5-small-trimmed-it)
|
57 |
+
- **Language:** it
|
58 |
+
- **Training data:** [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) (default)
|
59 |
+
- **Online Demo:** [https://autoqg.net/](https://autoqg.net/)
|
60 |
+
- **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
|
61 |
+
- **Paper:** [https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)
|
62 |
+
|
63 |
+
### Usage
|
64 |
+
- With [`lmqg`](https://github.com/asahi417/lm-question-generation#lmqg-language-model-for-question-generation-)
|
65 |
+
```python
|
66 |
+
from lmqg import TransformersQG
|
67 |
+
|
68 |
+
# initialize model
|
69 |
+
model = TransformersQG(language="it", model="vocabtrimmer/mt5-small-trimmed-it-itquad-qg")
|
70 |
+
|
71 |
+
# model prediction
|
72 |
+
questions = model.generate_q(list_context="Dopo il 1971 , l' OPEC ha tardato ad adeguare i prezzi per riflettere tale deprezzamento.", list_answer="Dopo il 1971")
|
73 |
+
|
74 |
+
```
|
75 |
+
|
76 |
+
- With `transformers`
|
77 |
+
```python
|
78 |
+
from transformers import pipeline
|
79 |
+
|
80 |
+
pipe = pipeline("text2text-generation", "vocabtrimmer/mt5-small-trimmed-it-itquad-qg")
|
81 |
+
output = pipe("<hl> Dopo il 1971 <hl> , l' OPEC ha tardato ad adeguare i prezzi per riflettere tale deprezzamento.")
|
82 |
+
|
83 |
+
```
|
84 |
+
|
85 |
+
## Evaluation
|
86 |
+
|
87 |
+
|
88 |
+
- ***Metric (Question Generation)***: [raw metric file](https://huggingface.co/vocabtrimmer/mt5-small-trimmed-it-itquad-qg/raw/main/eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_itquad.default.json)
|
89 |
+
|
90 |
+
| | Score | Type | Dataset |
|
91 |
+
|:-----------|--------:|:--------|:-----------------------------------------------------------------|
|
92 |
+
| BERTScore | 80.56 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
|
93 |
+
| Bleu_1 | 22.44 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
|
94 |
+
| Bleu_2 | 14.65 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
|
95 |
+
| Bleu_3 | 10.11 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
|
96 |
+
| Bleu_4 | 7.17 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
|
97 |
+
| METEOR | 17.45 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
|
98 |
+
| MoverScore | 56.59 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
|
99 |
+
| ROUGE_L | 21.78 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
|
100 |
+
|
101 |
+
|
102 |
+
|
103 |
+
## Training hyperparameters
|
104 |
+
|
105 |
+
The following hyperparameters were used during fine-tuning:
|
106 |
+
- dataset_path: lmqg/qg_itquad
|
107 |
+
- dataset_name: default
|
108 |
+
- input_types: paragraph_answer
|
109 |
+
- output_types: question
|
110 |
+
- prefix_types: None
|
111 |
+
- model: vocabtrimmer/mt5-small-trimmed-it
|
112 |
+
- max_length: 512
|
113 |
+
- max_length_output: 32
|
114 |
+
- epoch: 14
|
115 |
+
- batch: 32
|
116 |
+
- lr: 0.001
|
117 |
+
- fp16: False
|
118 |
+
- random_seed: 1
|
119 |
+
- gradient_accumulation_steps: 2
|
120 |
+
- label_smoothing: 0.15
|
121 |
+
|
122 |
+
The full configuration can be found at [fine-tuning config file](https://huggingface.co/vocabtrimmer/mt5-small-trimmed-it-itquad-qg/raw/main/trainer_config.json).
|
123 |
+
|
124 |
+
## Citation
|
125 |
+
```
|
126 |
+
@inproceedings{ushio-etal-2022-generative,
|
127 |
+
title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
|
128 |
+
author = "Ushio, Asahi and
|
129 |
+
Alva-Manchego, Fernando and
|
130 |
+
Camacho-Collados, Jose",
|
131 |
+
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
|
132 |
+
month = dec,
|
133 |
+
year = "2022",
|
134 |
+
address = "Abu Dhabi, U.A.E.",
|
135 |
+
publisher = "Association for Computational Linguistics",
|
136 |
+
}
|
137 |
+
|
138 |
+
```
|
added_tokens.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<hl>": 111056
|
3 |
+
}
|
config.json
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "lmqg_output/trimmed_qg/mt5-small-trimmed-it-itquad-qg/model_rsngya/epoch_5",
|
3 |
+
"add_prefix": false,
|
4 |
+
"architectures": [
|
5 |
+
"MT5ForConditionalGeneration"
|
6 |
+
],
|
7 |
+
"d_ff": 1024,
|
8 |
+
"d_kv": 64,
|
9 |
+
"d_model": 512,
|
10 |
+
"decoder_start_token_id": 0,
|
11 |
+
"dense_act_fn": "gelu_new",
|
12 |
+
"dropout_rate": 0.1,
|
13 |
+
"eos_token_id": 1,
|
14 |
+
"feed_forward_proj": "gated-gelu",
|
15 |
+
"initializer_factor": 1.0,
|
16 |
+
"is_encoder_decoder": true,
|
17 |
+
"is_gated_act": true,
|
18 |
+
"layer_norm_epsilon": 1e-06,
|
19 |
+
"model_type": "mt5",
|
20 |
+
"num_decoder_layers": 8,
|
21 |
+
"num_heads": 6,
|
22 |
+
"num_layers": 8,
|
23 |
+
"pad_token_id": 0,
|
24 |
+
"relative_attention_max_distance": 128,
|
25 |
+
"relative_attention_num_buckets": 32,
|
26 |
+
"tie_word_embeddings": false,
|
27 |
+
"tokenizer_class": "T5Tokenizer",
|
28 |
+
"torch_dtype": "float32",
|
29 |
+
"transformers_version": "4.26.1",
|
30 |
+
"use_cache": true,
|
31 |
+
"vocab_size": 111057,
|
32 |
+
"vocabtrimmer": {
|
33 |
+
"mining_config": {
|
34 |
+
"dataset": "vocabtrimmer/mc4_validation",
|
35 |
+
"dataset_column": "text",
|
36 |
+
"dataset_name": "it",
|
37 |
+
"dataset_split": "validation",
|
38 |
+
"language": "it",
|
39 |
+
"min_frequency": 2,
|
40 |
+
"target_vocab_size": null
|
41 |
+
},
|
42 |
+
"stats": {
|
43 |
+
"compression_rate_embedding": 44.4025076765609,
|
44 |
+
"compression_rate_full": 52.56350284909457,
|
45 |
+
"parameter_size_embedding/raw": 256114688,
|
46 |
+
"parameter_size_embedding/trimmed": 113721344,
|
47 |
+
"parameter_size_full/raw": 300176768,
|
48 |
+
"parameter_size_full/trimmed": 157783424,
|
49 |
+
"vocab_size/raw": 250112,
|
50 |
+
"vocab_size/trimmed": 111056
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
eval/metric.first.answer.paragraph_answer.question.lmqg_qg_itquad.default.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"validation": {"Bleu_1": 0.22404335102535608, "Bleu_2": 0.14782054323014757, "Bleu_3": 0.10311694360213429, "Bleu_4": 0.07380178489037288}, "test": {"Bleu_1": 0.2141970042225967, "Bleu_2": 0.1388722181265039, "Bleu_3": 0.0955214899552276, "Bleu_4": 0.0675425393590799}}
|
eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_itquad.default.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"validation": {"Bleu_1": 0.22503690515094235, "Bleu_2": 0.14866079895681625, "Bleu_3": 0.10381580865324394, "Bleu_4": 0.07437113421081724, "METEOR": 0.18099312624532768, "ROUGE_L": 0.21931164618756716, "BERTScore": 0.81287582175415, "MoverScore": 0.5719077715971134}, "test": {"Bleu_1": 0.2243588217083773, "Bleu_2": 0.14654182517721315, "Bleu_3": 0.10113892499537597, "Bleu_4": 0.0717280446540739, "METEOR": 0.174501480222499, "ROUGE_L": 0.21781544860489988, "BERTScore": 0.8055844824935463, "MoverScore": 0.5659232468786767}}
|
eval/samples.test.hyp.paragraph_answer.question.lmqg_qg_itquad.default.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
eval/samples.validation.hyp.paragraph_answer.question.lmqg_qg_itquad.default.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
generation_config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"decoder_start_token_id": 0,
|
4 |
+
"eos_token_id": 1,
|
5 |
+
"pad_token_id": 0,
|
6 |
+
"transformers_version": "4.26.1"
|
7 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2ccdbd0bae823924071b0ca05a8a1cb197730bd303b07fde8b51f63324f7dbba
|
3 |
+
size 631203205
|
special_tokens_map.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<hl>"
|
4 |
+
],
|
5 |
+
"eos_token": "</s>",
|
6 |
+
"pad_token": "<pad>",
|
7 |
+
"unk_token": "<unk>"
|
8 |
+
}
|
spiece.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ef78f86560d809067d12bac6c09f19a462cb3af3f54d2b8acbba26e1433125d6
|
3 |
+
size 4309802
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:195d79d5fc415de6f0c19d2fb35422e35542351984570d801a6c636090d46fdd
|
3 |
+
size 7265650
|
tokenizer_config.json
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": null,
|
3 |
+
"eos_token": "</s>",
|
4 |
+
"extra_ids": 0,
|
5 |
+
"model_max_length": 1000000000000000019884624838656,
|
6 |
+
"name_or_path": "lmqg_output/trimmed_qg/mt5-small-trimmed-it-itquad-qg/model_rsngya/epoch_5",
|
7 |
+
"pad_token": "<pad>",
|
8 |
+
"sp_model_kwargs": {},
|
9 |
+
"special_tokens_map_file": "/home/asahiushio/.cache/huggingface/hub/models--google--mt5-small/snapshots/38f23af8ec210eb6c376d40e9c56bd25a80f195d/special_tokens_map.json",
|
10 |
+
"tokenizer_class": "T5Tokenizer",
|
11 |
+
"unk_token": "<unk>"
|
12 |
+
}
|
trainer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"dataset_path": "lmqg/qg_itquad", "dataset_name": "default", "input_types": "paragraph_answer", "output_types": "question", "prefix_types": null, "model": "vocabtrimmer/mt5-small-trimmed-it", "max_length": 512, "max_length_output": 32, "epoch": 14, "batch": 32, "lr": 0.001, "fp16": false, "random_seed": 1, "gradient_accumulation_steps": 2, "label_smoothing": 0.15}
|