asahi417 commited on
Commit
98f91cb
1 Parent(s): 8eec8f9

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: fr
11
+ datasets:
12
+ - lmqg/qg_frquad
13
+ pipeline_tag: text2text-generation
14
+ tags:
15
+ - question generation
16
+ - answer extraction
17
+ widget:
18
+ - text: "generate question: Créateur » (Maker), lui aussi au singulier, « <hl> le Suprême Berger <hl> » (The Great Shepherd) ; de l'autre, des réminiscences de la théologie de l'Antiquité : le tonnerre, voix de Jupiter, « Et souvent ta voix gronde en un tonnerre terrifiant », etc."
19
+ example_title: "Question Generation Example 1"
20
+ - text: "generate question: Ce black dog peut être lié à des évènements traumatisants issus du monde extérieur, tels que son renvoi de l'Amirauté après la catastrophe des Dardanelles, lors de la <hl> Grande Guerre <hl> de 14-18, ou son rejet par l'électorat en juillet 1945."
21
+ example_title: "Question Generation Example 2"
22
+ - text: "generate question: contre <hl> Normie Smith <hl> et 15 000 dollars le 28 novembre 1938."
23
+ example_title: "Question Generation Example 3"
24
+ - text: "extract answers: Pourtant, la strophe spensérienne, utilisée cinq fois avant que ne commence le chœur, constitue en soi un vecteur dont les répétitions structurelles, selon Ricks, relèvent du pur lyrisme tout en constituant une menace potentielle. Après les huit sages pentamètres iambiques, l'alexandrin final <hl> permet une pause <hl>, « véritable illusion d'optique » qu'accentuent les nombreuses expressions archaïsantes telles que did swoon, did seem, did go, did receive, did make, qui doublent le prétérit en un temps composé et paraissent à la fois « très précautionneuses et très peu pressées »."
25
+ example_title: "Answer Extraction Example 1"
26
+ - text: "extract answers: Néanmoins, une fois encore, l'arithmétique modulaire est insuffisante pour venir à bout du théorème. Dirichlet utilise de nombreuses techniques analytiques, comme les séries entières et l'analyse complexe. Le fruit de ces travaux donne naissance à une nouvelle branche des mathématiques : la théorie analytique des nombres. L'un des points cruciaux de cette théorie provient de l'unique article de <hl> Bernhard Riemann <hl> en théorie des nombres : Sur le nombre de nombres premiers inférieurs à une taille donnée. Il conjecture une localisation des racines de sa fonction ζ. La recherche de la position des racines, initiée par Dirichlet, devient une préoccupation centrale et reste l'une des conjectures pressenties comme les plus difficiles des mathématiques de notre époque."
27
+ example_title: "Answer Extraction Example 2"
28
+ model-index:
29
+ - name: lmqg/mbart-large-cc25-frquad-qg-ae
30
+ results:
31
+ - task:
32
+ name: Text2text Generation
33
+ type: text2text-generation
34
+ dataset:
35
+ name: lmqg/qg_frquad
36
+ type: default
37
+ args: default
38
+ metrics:
39
+ - name: BLEU4 (Question Generation)
40
+ type: bleu4_question_generation
41
+ value: 0.91
42
+ - name: ROUGE-L (Question Generation)
43
+ type: rouge_l_question_generation
44
+ value: 18.54
45
+ - name: METEOR (Question Generation)
46
+ type: meteor_question_generation
47
+ value: 8.56
48
+ - name: BERTScore (Question Generation)
49
+ type: bertscore_question_generation
50
+ value: 72.56
51
+ - name: MoverScore (Question Generation)
52
+ type: moverscore_question_generation
53
+ value: 50.46
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: 77.72
57
+ - name: QAAlignedRecall-BERTScore (Question & Answer Generation (with Gold Answer))
58
+ type: qa_aligned_recall_bertscore_question_answer_generation_with_gold_answer
59
+ value: 78.58
60
+ - name: QAAlignedPrecision-BERTScore (Question & Answer Generation (with Gold Answer))
61
+ type: qa_aligned_precision_bertscore_question_answer_generation_with_gold_answer
62
+ value: 76.9
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: 51.65
66
+ - name: QAAlignedRecall-MoverScore (Question & Answer Generation (with Gold Answer))
67
+ type: qa_aligned_recall_moverscore_question_answer_generation_with_gold_answer
68
+ value: 52.16
69
+ - name: QAAlignedPrecision-MoverScore (Question & Answer Generation (with Gold Answer))
70
+ type: qa_aligned_precision_moverscore_question_answer_generation_with_gold_answer
71
+ value: 51.15
72
+ - name: BLEU4 (Answer Extraction)
73
+ type: bleu4_answer_extraction
74
+ value: 0.0
75
+ - name: ROUGE-L (Answer Extraction)
76
+ type: rouge_l_answer_extraction
77
+ value: 3.48
78
+ - name: METEOR (Answer Extraction)
79
+ type: meteor_answer_extraction
80
+ value: 3.24
81
+ - name: BERTScore (Answer Extraction)
82
+ type: bertscore_answer_extraction
83
+ value: 58.41
84
+ - name: MoverScore (Answer Extraction)
85
+ type: moverscore_answer_extraction
86
+ value: 45.72
87
+ - name: AnswerF1Score (Answer Extraction)
88
+ type: answer_f1_score__answer_extraction
89
+ value: 3.66
90
+ - name: AnswerExactMatch (Answer Extraction)
91
+ type: answer_exact_match_answer_extraction
92
+ value: 0.0
93
+ ---
94
+
95
+ # Model Card of `lmqg/mbart-large-cc25-frquad-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_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) (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:** fr
102
+ - **Training data:** [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) (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="fr", model="lmqg/mbart-large-cc25-frquad-qg-ae")
114
+
115
+ # model prediction
116
+ question_answer_pairs = model.generate_qa("Créateur » (Maker), lui aussi au singulier, « le Suprême Berger » (The Great Shepherd) ; de l'autre, des réminiscences de la théologie de l'Antiquité : le tonnerre, voix de Jupiter, « Et souvent ta voix gronde en un tonnerre terrifiant », etc.")
117
+
118
+ ```
119
+
120
+ - With `transformers`
121
+ ```python
122
+ from transformers import pipeline
123
+
124
+ pipe = pipeline("text2text-generation", "lmqg/mbart-large-cc25-frquad-qg-ae")
125
+
126
+ # answer extraction
127
+ answer = pipe("generate question: Créateur » (Maker), lui aussi au singulier, « <hl> le Suprême Berger <hl> » (The Great Shepherd) ; de l'autre, des réminiscences de la théologie de l'Antiquité : le tonnerre, voix de Jupiter, « Et souvent ta voix gronde en un tonnerre terrifiant », etc.")
128
+
129
+ # question generation
130
+ question = pipe("extract answers: Pourtant, la strophe spensérienne, utilisée cinq fois avant que ne commence le chœur, constitue en soi un vecteur dont les répétitions structurelles, selon Ricks, relèvent du pur lyrisme tout en constituant une menace potentielle. Après les huit sages pentamètres iambiques, l'alexandrin final <hl> permet une pause <hl>, « véritable illusion d'optique » qu'accentuent les nombreuses expressions archaïsantes telles que did swoon, did seem, did go, did receive, did make, qui doublent le prétérit en un temps composé et paraissent à la fois « très précautionneuses et très peu pressées ».")
131
+
132
+ ```
133
+
134
+ ## Evaluation
135
+
136
+
137
+ - ***Metric (Question Generation)***: [raw metric file](https://huggingface.co/lmqg/mbart-large-cc25-frquad-qg-ae/raw/main/eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_frquad.default.json)
138
+
139
+ | | Score | Type | Dataset |
140
+ |:-----------|--------:|:--------|:-----------------------------------------------------------------|
141
+ | BERTScore | 72.56 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
142
+ | Bleu_1 | 16.16 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
143
+ | Bleu_2 | 4.88 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
144
+ | Bleu_3 | 1.85 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
145
+ | Bleu_4 | 0.91 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
146
+ | METEOR | 8.56 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
147
+ | MoverScore | 50.46 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
148
+ | ROUGE_L | 18.54 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
149
+
150
+
151
+ - ***Metric (Question & Answer Generation)***: [raw metric file](https://huggingface.co/lmqg/mbart-large-cc25-frquad-qg-ae/raw/main/eval/metric.first.answer.paragraph.questions_answers.lmqg_qg_frquad.default.json)
152
+
153
+ | | Score | Type | Dataset |
154
+ |:--------------------------------|--------:|:--------|:-----------------------------------------------------------------|
155
+ | QAAlignedF1Score (BERTScore) | 77.72 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
156
+ | QAAlignedF1Score (MoverScore) | 51.65 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
157
+ | QAAlignedPrecision (BERTScore) | 76.9 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
158
+ | QAAlignedPrecision (MoverScore) | 51.15 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
159
+ | QAAlignedRecall (BERTScore) | 78.58 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
160
+ | QAAlignedRecall (MoverScore) | 52.16 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
161
+
162
+
163
+ - ***Metric (Answer Extraction)***: [raw metric file](https://huggingface.co/lmqg/mbart-large-cc25-frquad-qg-ae/raw/main/eval/metric.first.answer.paragraph_sentence.answer.lmqg_qg_frquad.default.json)
164
+
165
+ | | Score | Type | Dataset |
166
+ |:-----------------|--------:|:--------|:-----------------------------------------------------------------|
167
+ | AnswerExactMatch | 0 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
168
+ | AnswerF1Score | 3.66 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
169
+ | BERTScore | 58.41 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
170
+ | Bleu_1 | 2.56 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
171
+ | Bleu_2 | 0.76 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
172
+ | Bleu_3 | 0 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
173
+ | Bleu_4 | 0 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
174
+ | METEOR | 3.24 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
175
+ | MoverScore | 45.72 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
176
+ | ROUGE_L | 3.48 | default | [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) |
177
+
178
+
179
+
180
+ ## Training hyperparameters
181
+
182
+ The following hyperparameters were used during fine-tuning:
183
+ - dataset_path: lmqg/qg_frquad
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: 5
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-frquad-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-frquad-qg-ae/best_model",
3
  "_num_labels": 3,
4
  "activation_dropout": 0.0,
5
  "activation_function": "gelu",
 
1
  {
2
+ "_name_or_path": "facebook/mbart-large-cc25",
3
  "_num_labels": 3,
4
  "activation_dropout": 0.0,
5
  "activation_function": "gelu",
eval/metric.first.answer.paragraph.questions_answers.lmqg_qg_frquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"test": {"QAAlignedF1Score (BERTScore)": 0.7772413075848769, "QAAlignedRecall (BERTScore)": 0.7858170717744499, "QAAlignedPrecision (BERTScore)": 0.7689549139583383, "QAAlignedF1Score (MoverScore)": 0.5164507832847365, "QAAlignedRecall (MoverScore)": 0.5215983072529093, "QAAlignedPrecision (MoverScore)": 0.5114646311900342, "Bleu_1": 0.037782235103238186, "Bleu_2": 0.015199909819190933, "Bleu_3": 0.004885828523775546, "Bleu_4": 0.0010360112893287412, "METEOR": 0.1054760059084704, "ROUGE_L": 0.07329315468535748, "BERTScore": 0.5734855355142509, "MoverScore": 0.49132126390282654}, "validation": {"QAAlignedF1Score (BERTScore)": 0.7856529529386986, "QAAlignedRecall (BERTScore)": 0.7828424381920649, "QAAlignedPrecision (BERTScore)": 0.7885869638043304, "QAAlignedF1Score (MoverScore)": 0.5210219089023471, "QAAlignedRecall (MoverScore)": 0.5205554081240038, "QAAlignedPrecision (MoverScore)": 0.5215353446160117, "Bleu_1": 0.11868833101890196, "Bleu_2": 0.05962247943466257, "Bleu_3": 0.018656299341997678, "Bleu_4": 0.006695070088080167, "METEOR": 0.1826567214417883, "ROUGE_L": 0.1712360131717798, "BERTScore": 0.6651338213899484, "MoverScore": 0.5104089792922674}}
eval/metric.first.answer.paragraph_answer.question.lmqg_qg_frquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"validation": {"Bleu_1": 0.16304445241082266, "Bleu_2": 0.04359089100104815, "Bleu_3": 0.01563846849594309, "Bleu_4": 0.006834006918163857}, "test": {"Bleu_1": 0.16118480014339126, "Bleu_2": 0.04850750055849233, "Bleu_3": 0.018321994368103143, "Bleu_4": 0.008914098623388059}}
eval/metric.first.answer.paragraph_sentence.answer.lmqg_qg_frquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"validation": {"Bleu_1": 0.031053952321203823, "Bleu_2": 0.008912110057459717, "Bleu_3": 0.001275715526012735, "Bleu_4": 8.771777990582571e-08, "METEOR": 0.035440713934410256, "ROUGE_L": 0.03976014741067617, "BERTScore": 0.5888344976242393, "MoverScore": 0.4594421933634128, "AnswerF1Score": 4.397795867894216, "AnswerExactMatch": 0.0}, "test": {"Bleu_1": 0.02556461731493042, "Bleu_2": 0.007614699024995999, "Bleu_3": 1.1486877120295986e-08, "Bleu_4": 1.4418621186928819e-11, "METEOR": 0.03242150774410041, "ROUGE_L": 0.03476518310190234, "BERTScore": 0.5841268705790734, "MoverScore": 0.4571808179187319, "AnswerF1Score": 3.662940194122861, "AnswerExactMatch": 0.0}}
eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_frquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"validation": {"Bleu_1": 0.16420308483290114, "Bleu_2": 0.04418468099154152, "Bleu_3": 0.01583842777449354, "Bleu_4": 0.0069411827995547876, "METEOR": 0.08164915030915688, "ROUGE_L": 0.19507497362063778, "BERTScore": 0.722660510506299, "MoverScore": 0.5040415700487906}, "test": {"Bleu_1": 0.16155802126675542, "Bleu_2": 0.04875364461552838, "Bleu_3": 0.018514125978873273, "Bleu_4": 0.009054516092973287, "METEOR": 0.08556904020375079, "ROUGE_L": 0.18541590755594925, "BERTScore": 0.7256057500260548, "MoverScore": 0.5046048262328876}}
eval/samples.test.hyp.paragraph.questions_answers.lmqg_qg_frquad.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_frquad.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_frquad.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_frquad.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_frquad.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_frquad.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:8ca7308192a6d07270e334ca92dba3302998e89c16583976c82ad4392b643ddf
3
- size 2444580125
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:468a76648b10b87d53978dca873afdb50bd49186d142a9636e471b48b49128af
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-frquad-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": "facebook/mbart-large-cc25",
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_frquad", "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": 5, "batch": 2, "lr": 0.0001, "fp16": false, "random_seed": 1, "gradient_accumulation_steps": 32, "label_smoothing": 0.15}