asahi417 commited on
Commit
02a5cf1
1 Parent(s): 31cc6ef

model update

Browse files
README.md ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - answer extraction
17
+ widget:
18
+ - text: "generate question: <hl> Dopo il 1971 <hl> , l' OPEC ha tardato ad adeguare i prezzi per riflettere tale deprezzamento."
19
+ example_title: "Question Generation Example 1"
20
+ - text: "generate question: 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."
21
+ example_title: "Question Generation Example 2"
22
+ - text: "generate question: il <hl> Giappone <hl> è stato il paese più dipendente dal petrolio arabo."
23
+ example_title: "Question Generation Example 3"
24
+ - text: "extract answers: <hl> Il 6 ottobre 1973 , la Siria e l' Egitto, con il sostegno di altre nazioni arabe, lanciarono un attacco a sorpresa su Israele, su Yom Kippur. <hl> Questo rinnovo delle ostilità nel conflitto arabo-israeliano ha liberato la pressione economica sottostante sui prezzi del petrolio. All' epoca, l' Iran era il secondo esportatore mondiale di petrolio e un vicino alleato degli Stati Uniti. Settimane più tardi, lo scià d' Iran ha detto in un' intervista: Naturalmente[il prezzo del petrolio] sta andando a salire Certamente! E come! Avete[Paesi occidentali] aumentato il prezzo del grano che ci vendete del 300 per cento, e lo stesso per zucchero e cemento."
25
+ example_title: "Answer Extraction Example 1"
26
+ - text: "extract answers: <hl> Furono introdotti autocarri compatti, come la Toyota Hilux e il Datsun Truck, seguiti dal camion Mazda (venduto come il Ford Courier), e l' Isuzu costruito Chevrolet LUV. <hl> Mitsubishi rebranded il suo Forte come Dodge D-50 pochi anni dopo la crisi petrolifera. Mazda, Mitsubishi e Isuzu avevano partnership congiunte rispettivamente con Ford, Chrysler e GM. In seguito i produttori americani introdussero le loro sostituzioni nazionali (Ford Ranger, Dodge Dakota e la Chevrolet S10/GMC S-15), ponendo fine alla loro politica di importazione vincolata."
27
+ example_title: "Answer Extraction Example 2"
28
+ model-index:
29
+ - name: lmqg/mbart-large-cc25-itquad-qg-ae
30
+ results:
31
+ - task:
32
+ name: Text2text Generation
33
+ type: text2text-generation
34
+ dataset:
35
+ name: lmqg/qg_itquad
36
+ type: default
37
+ args: default
38
+ metrics:
39
+ - name: BLEU4 (Question Generation)
40
+ type: bleu4_question_generation
41
+ value: 7.06
42
+ - name: ROUGE-L (Question Generation)
43
+ type: rouge_l_question_generation
44
+ value: 20.15
45
+ - name: METEOR (Question Generation)
46
+ type: meteor_question_generation
47
+ value: 16.86
48
+ - name: BERTScore (Question Generation)
49
+ type: bertscore_question_generation
50
+ value: 79.29
51
+ - name: MoverScore (Question Generation)
52
+ type: moverscore_question_generation
53
+ value: 55.92
54
+ - name: QAAlignedF1Score-BERTScore (Question & Answer Generation (with Gold Answer))
55
+ type: qa_aligned_f1_score_bertscore_question_answer_generation_with_gold_answer
56
+ value: 82.65
57
+ - name: QAAlignedRecall-BERTScore (Question & Answer Generation (with Gold Answer))
58
+ type: qa_aligned_recall_bertscore_question_answer_generation_with_gold_answer
59
+ value: 84.34
60
+ - name: QAAlignedPrecision-BERTScore (Question & Answer Generation (with Gold Answer))
61
+ type: qa_aligned_precision_bertscore_question_answer_generation_with_gold_answer
62
+ value: 81.06
63
+ - name: QAAlignedF1Score-MoverScore (Question & Answer Generation (with Gold Answer))
64
+ type: qa_aligned_f1_score_moverscore_question_answer_generation_with_gold_answer
65
+ value: 56.14
66
+ - name: QAAlignedRecall-MoverScore (Question & Answer Generation (with Gold Answer))
67
+ type: qa_aligned_recall_moverscore_question_answer_generation_with_gold_answer
68
+ value: 57.13
69
+ - name: QAAlignedPrecision-MoverScore (Question & Answer Generation (with Gold Answer))
70
+ type: qa_aligned_precision_moverscore_question_answer_generation_with_gold_answer
71
+ value: 55.22
72
+ - name: BLEU4 (Answer Extraction)
73
+ type: bleu4_answer_extraction
74
+ value: 20.21
75
+ - name: ROUGE-L (Answer Extraction)
76
+ type: rouge_l_answer_extraction
77
+ value: 46.51
78
+ - name: METEOR (Answer Extraction)
79
+ type: meteor_answer_extraction
80
+ value: 44.48
81
+ - name: BERTScore (Answer Extraction)
82
+ type: bertscore_answer_extraction
83
+ value: 90.63
84
+ - name: MoverScore (Answer Extraction)
85
+ type: moverscore_answer_extraction
86
+ value: 83.05
87
+ - name: AnswerF1Score (Answer Extraction)
88
+ type: answer_f1_score__answer_extraction
89
+ value: 76.59
90
+ - name: AnswerExactMatch (Answer Extraction)
91
+ type: answer_exact_match_answer_extraction
92
+ value: 63.88
93
+ ---
94
+
95
+ # Model Card of `lmqg/mbart-large-cc25-itquad-qg-ae`
96
+ This model is fine-tuned version of [facebook/mbart-large-cc25](https://huggingface.co/facebook/mbart-large-cc25) for question generation and answer extraction jointly on the [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) (dataset_name: default) via [`lmqg`](https://github.com/asahi417/lm-question-generation).
97
+
98
+
99
+ ### Overview
100
+ - **Language model:** [facebook/mbart-large-cc25](https://huggingface.co/facebook/mbart-large-cc25)
101
+ - **Language:** it
102
+ - **Training data:** [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) (default)
103
+ - **Online Demo:** [https://autoqg.net/](https://autoqg.net/)
104
+ - **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
105
+ - **Paper:** [https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)
106
+
107
+ ### Usage
108
+ - With [`lmqg`](https://github.com/asahi417/lm-question-generation#lmqg-language-model-for-question-generation-)
109
+ ```python
110
+ from lmqg import TransformersQG
111
+
112
+ # initialize model
113
+ model = TransformersQG(language="it", model="lmqg/mbart-large-cc25-itquad-qg-ae")
114
+
115
+ # model prediction
116
+ question_answer_pairs = model.generate_qa("Dopo il 1971 , l' OPEC ha tardato ad adeguare i prezzi per riflettere tale deprezzamento.")
117
+
118
+ ```
119
+
120
+ - With `transformers`
121
+ ```python
122
+ from transformers import pipeline
123
+
124
+ pipe = pipeline("text2text-generation", "lmqg/mbart-large-cc25-itquad-qg-ae")
125
+
126
+ # answer extraction
127
+ answer = pipe("generate question: <hl> Dopo il 1971 <hl> , l' OPEC ha tardato ad adeguare i prezzi per riflettere tale deprezzamento.")
128
+
129
+ # question generation
130
+ question = pipe("extract answers: <hl> Il 6 ottobre 1973 , la Siria e l' Egitto, con il sostegno di altre nazioni arabe, lanciarono un attacco a sorpresa su Israele, su Yom Kippur. <hl> Questo rinnovo delle ostilità nel conflitto arabo-israeliano ha liberato la pressione economica sottostante sui prezzi del petrolio. All' epoca, l' Iran era il secondo esportatore mondiale di petrolio e un vicino alleato degli Stati Uniti. Settimane più tardi, lo scià d' Iran ha detto in un' intervista: Naturalmente[il prezzo del petrolio] sta andando a salire Certamente! E come! Avete[Paesi occidentali] aumentato il prezzo del grano che ci vendete del 300 per cento, e lo stesso per zucchero e cemento.")
131
+
132
+ ```
133
+
134
+ ## Evaluation
135
+
136
+
137
+ - ***Metric (Question Generation)***: [raw metric file](https://huggingface.co/lmqg/mbart-large-cc25-itquad-qg-ae/raw/main/eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_itquad.default.json)
138
+
139
+ | | Score | Type | Dataset |
140
+ |:-----------|--------:|:--------|:-----------------------------------------------------------------|
141
+ | BERTScore | 79.29 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
142
+ | Bleu_1 | 22.03 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
143
+ | Bleu_2 | 14.31 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
144
+ | Bleu_3 | 9.9 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
145
+ | Bleu_4 | 7.06 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
146
+ | METEOR | 16.86 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
147
+ | MoverScore | 55.92 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
148
+ | ROUGE_L | 20.15 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
149
+
150
+
151
+ - ***Metric (Question & Answer Generation)***: [raw metric file](https://huggingface.co/lmqg/mbart-large-cc25-itquad-qg-ae/raw/main/eval/metric.first.answer.paragraph.questions_answers.lmqg_qg_itquad.default.json)
152
+
153
+ | | Score | Type | Dataset |
154
+ |:--------------------------------|--------:|:--------|:-----------------------------------------------------------------|
155
+ | QAAlignedF1Score (BERTScore) | 82.65 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
156
+ | QAAlignedF1Score (MoverScore) | 56.14 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
157
+ | QAAlignedPrecision (BERTScore) | 81.06 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
158
+ | QAAlignedPrecision (MoverScore) | 55.22 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
159
+ | QAAlignedRecall (BERTScore) | 84.34 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
160
+ | QAAlignedRecall (MoverScore) | 57.13 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
161
+
162
+
163
+ - ***Metric (Answer Extraction)***: [raw metric file](https://huggingface.co/lmqg/mbart-large-cc25-itquad-qg-ae/raw/main/eval/metric.first.answer.paragraph_sentence.answer.lmqg_qg_itquad.default.json)
164
+
165
+ | | Score | Type | Dataset |
166
+ |:-----------------|--------:|:--------|:-----------------------------------------------------------------|
167
+ | AnswerExactMatch | 63.88 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
168
+ | AnswerF1Score | 76.59 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
169
+ | BERTScore | 90.63 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
170
+ | Bleu_1 | 33.66 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
171
+ | Bleu_2 | 27.96 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
172
+ | Bleu_3 | 23.79 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
173
+ | Bleu_4 | 20.21 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
174
+ | METEOR | 44.48 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
175
+ | MoverScore | 83.05 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
176
+ | ROUGE_L | 46.51 | default | [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) |
177
+
178
+
179
+
180
+ ## Training hyperparameters
181
+
182
+ The following hyperparameters were used during fine-tuning:
183
+ - dataset_path: lmqg/qg_itquad
184
+ - dataset_name: default
185
+ - input_types: ['paragraph_answer', 'paragraph_sentence']
186
+ - output_types: ['question', 'answer']
187
+ - prefix_types: ['qg', 'ae']
188
+ - model: facebook/mbart-large-cc25
189
+ - max_length: 512
190
+ - max_length_output: 32
191
+ - epoch: 8
192
+ - batch: 2
193
+ - lr: 0.0001
194
+ - fp16: False
195
+ - random_seed: 1
196
+ - gradient_accumulation_steps: 32
197
+ - label_smoothing: 0.15
198
+
199
+ The full configuration can be found at [fine-tuning config file](https://huggingface.co/lmqg/mbart-large-cc25-itquad-qg-ae/raw/main/trainer_config.json).
200
+
201
+ ## Citation
202
+ ```
203
+ @inproceedings{ushio-etal-2022-generative,
204
+ title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
205
+ author = "Ushio, Asahi and
206
+ Alva-Manchego, Fernando and
207
+ Camacho-Collados, Jose",
208
+ booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
209
+ month = dec,
210
+ year = "2022",
211
+ address = "Abu Dhabi, U.A.E.",
212
+ publisher = "Association for Computational Linguistics",
213
+ }
214
+
215
+ ```
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "lmqg_output/mbart-large-cc25-itquad-qg-ae/best_model",
3
  "_num_labels": 3,
4
  "activation_dropout": 0.0,
5
  "activation_function": "gelu",
 
1
  {
2
+ "_name_or_path": "lmqg_output/mbart-large-cc25-itquad-qg-ae/model_gljitg/epoch_5",
3
  "_num_labels": 3,
4
  "activation_dropout": 0.0,
5
  "activation_function": "gelu",
eval/metric.first.answer.paragraph.questions_answers.lmqg_qg_itquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"test": {"QAAlignedF1Score (BERTScore)": 0.8264963413651882, "QAAlignedRecall (BERTScore)": 0.8433949072468981, "QAAlignedPrecision (BERTScore)": 0.8106074732880147, "QAAlignedF1Score (MoverScore)": 0.5614028998279956, "QAAlignedRecall (MoverScore)": 0.5712826398930563, "QAAlignedPrecision (MoverScore)": 0.5522132111469052, "Bleu_1": 0.16312877420973168, "Bleu_2": 0.0925206396933409, "Bleu_3": 0.047284456202529156, "Bleu_4": 0.025330248008968437, "METEOR": 0.2506318329951036, "ROUGE_L": 0.19514561704456454, "BERTScore": 0.7366486872046046, "MoverScore": 0.5423528342324836}, "validation": {"QAAlignedF1Score (BERTScore)": 0.8100336065007487, "QAAlignedRecall (BERTScore)": 0.8446934290149599, "QAAlignedPrecision (BERTScore)": 0.7786250297045639, "QAAlignedF1Score (MoverScore)": 0.5504725180352802, "QAAlignedRecall (MoverScore)": 0.5723926119753241, "QAAlignedPrecision (MoverScore)": 0.5310473119264032, "Bleu_1": 0.050322111089023534, "Bleu_2": 0.0227113790498272, "Bleu_3": 0.010309740934486946, "Bleu_4": 0.005088103355677113, "METEOR": 0.15475325662503672, "ROUGE_L": 0.08998195745851649, "BERTScore": 0.636510829148209, "MoverScore": 0.5083552519592559}}
eval/metric.first.answer.paragraph_answer.question.lmqg_qg_itquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"validation": {"Bleu_1": 0.22081841317027878, "Bleu_2": 0.14625968090059838, "Bleu_3": 0.10240753565680512, "Bleu_4": 0.0736664759780728}, "test": {"Bleu_1": 0.21098003120474793, "Bleu_2": 0.13586558819908817, "Bleu_3": 0.09352885589427087, "Bleu_4": 0.06654178223179057}}
eval/metric.first.answer.paragraph_sentence.answer.lmqg_qg_itquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"validation": {"Bleu_1": 0.3377340114706079, "Bleu_2": 0.2773134381736893, "Bleu_3": 0.2366137193106164, "Bleu_4": 0.2029996426179, "METEOR": 0.46055200766458787, "ROUGE_L": 0.4452300627333968, "BERTScore": 0.9179433223170008, "MoverScore": 0.8512434937468668, "AnswerF1Score": 79.20970002912067, "AnswerExactMatch": 68.40583519516362}, "test": {"Bleu_1": 0.33661354834612606, "Bleu_2": 0.27955002622610065, "Bleu_3": 0.23793905548976482, "Bleu_4": 0.20207248181734025, "METEOR": 0.44480746009534095, "ROUGE_L": 0.46510146549442927, "BERTScore": 0.9063161925795451, "MoverScore": 0.8304812947806502, "AnswerF1Score": 76.58778740440405, "AnswerExactMatch": 63.884873176501515}}
eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_itquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"validation": {"Bleu_1": 0.2216253207869949, "Bleu_2": 0.14685991225539868, "Bleu_3": 0.10290539705998131, "Bleu_4": 0.07410211123726952, "METEOR": 0.17841245430844613, "ROUGE_L": 0.20985277292570392, "BERTScore": 0.8020776579528849, "MoverScore": 0.5676037052038462}, "test": {"Bleu_1": 0.2203354193979244, "Bleu_2": 0.14309079880332845, "Bleu_3": 0.09898548007038611, "Bleu_4": 0.07061313823722157, "METEOR": 0.16857362153073602, "ROUGE_L": 0.2015478301697681, "BERTScore": 0.7929495583837073, "MoverScore": 0.559154099162796}}
eval/samples.test.hyp.paragraph.questions_answers.lmqg_qg_itquad.default.txt ADDED
The diff for this file is too large to render. See raw diff
 
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.test.hyp.paragraph_sentence.answer.lmqg_qg_itquad.default.txt ADDED
The diff for this file is too large to render. See raw diff
 
eval/samples.validation.hyp.paragraph.questions_answers.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
 
eval/samples.validation.hyp.paragraph_sentence.answer.lmqg_qg_itquad.default.txt 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:d269bf337a601ebeb568605551297433218d43dce4d9ecac1c33808d73caf3ff
3
- size 2444580125
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a05685ad9effd2eb3eb7258230edc0e8d7783c1040f8a2a4f4239936f4ba253
3
+ size 2444587421
tokenizer_config.json CHANGED
@@ -12,7 +12,7 @@
12
  "single_word": false
13
  },
14
  "model_max_length": 1024,
15
- "name_or_path": "lmqg_output/mbart-large-cc25-itquad-qg-ae/best_model",
16
  "pad_token": "<pad>",
17
  "sep_token": "</s>",
18
  "special_tokens_map_file": null,
 
12
  "single_word": false
13
  },
14
  "model_max_length": 1024,
15
+ "name_or_path": "lmqg_output/mbart-large-cc25-itquad-qg-ae/model_gljitg/epoch_5",
16
  "pad_token": "<pad>",
17
  "sep_token": "</s>",
18
  "special_tokens_map_file": null,
trainer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"dataset_path": "lmqg/qg_itquad", "dataset_name": "default", "input_types": ["paragraph_answer", "paragraph_sentence"], "output_types": ["question", "answer"], "prefix_types": ["qg", "ae"], "model": "facebook/mbart-large-cc25", "max_length": 512, "max_length_output": 32, "epoch": 8, "batch": 2, "lr": 0.0001, "fp16": false, "random_seed": 1, "gradient_accumulation_steps": 32, "label_smoothing": 0.15}