asahi417 commited on
Commit
ea1cf38
1 Parent(s): f4eaebf

model update

Browse files
Files changed (26) hide show
  1. README.md +86 -49
  2. eval/{metric.first.answer.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.first.answer.paragraph_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  3. eval/{metric.first.answer.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.first.answer.paragraph_sentence.question.lmqg_qg_jaquad.default.json} +0 -0
  4. eval/{metric.first.answer.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.first.answer.sentence_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  5. eval/{metric.first.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.first.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  6. eval/{metric.first.sentence.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.first.sentence.paragraph_sentence.question.lmqg_qg_jaquad.default.json} +0 -0
  7. eval/{metric.first.sentence.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.first.sentence.sentence_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  8. eval/{metric.last.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.last.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  9. eval/{metric.last.sentence.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.last.sentence.paragraph_sentence.question.lmqg_qg_jaquad.default.json} +0 -0
  10. eval/{metric.last.sentence.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.last.sentence.sentence_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  11. eval/{metric.long.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.long.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  12. eval/{metric.long.sentence.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.long.sentence.paragraph_sentence.question.lmqg_qg_jaquad.default.json} +0 -0
  13. eval/{metric.long.sentence.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.long.sentence.sentence_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  14. eval/{metric.middle.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.middle.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  15. eval/{metric.middle.sentence.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.middle.sentence.paragraph_sentence.question.lmqg_qg_jaquad.default.json} +0 -0
  16. eval/{metric.middle.sentence.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.middle.sentence.sentence_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  17. eval/{metric.short.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.short.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  18. eval/{metric.short.sentence.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.short.sentence.paragraph_sentence.question.lmqg_qg_jaquad.default.json} +0 -0
  19. eval/{metric.short.sentence.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.short.sentence.sentence_answer.question.lmqg_qg_jaquad.default.json} +0 -0
  20. eval/{samples.test.hyp.paragraph_answer.question.asahi417_qg_jaquad.default.txt → samples.test.hyp.paragraph_answer.question.lmqg_qg_jaquad.default.txt} +0 -0
  21. eval/{samples.test.hyp.paragraph_sentence.question.asahi417_qg_jaquad.default.txt → samples.test.hyp.paragraph_sentence.question.lmqg_qg_jaquad.default.txt} +0 -0
  22. eval/{samples.test.hyp.sentence_answer.question.asahi417_qg_jaquad.default.txt → samples.test.hyp.sentence_answer.question.lmqg_qg_jaquad.default.txt} +0 -0
  23. eval/{samples.validation.hyp.paragraph_answer.question.asahi417_qg_jaquad.default.txt → samples.validation.hyp.paragraph_answer.question.lmqg_qg_jaquad.default.txt} +0 -0
  24. eval/{samples.validation.hyp.paragraph_sentence.question.asahi417_qg_jaquad.default.txt → samples.validation.hyp.paragraph_sentence.question.lmqg_qg_jaquad.default.txt} +0 -0
  25. eval/{samples.validation.hyp.sentence_answer.question.asahi417_qg_jaquad.default.txt → samples.validation.hyp.sentence_answer.question.lmqg_qg_jaquad.default.txt} +0 -0
  26. trainer_config.json +1 -1
README.md CHANGED
@@ -1,73 +1,110 @@
 
1
  ---
2
- language: ja
3
- tags:
4
- - question generation
5
  license: cc-by-4.0
6
- datasets:
7
- - asahi417/qg_jaquad
8
  metrics:
9
- - bleu
10
  - meteor
11
- - rouge
12
  - bertscore
13
- widget:
14
- - text: "ゾフィーは貴族出身ではあったが王族出身ではなく、ハプスブルク家の皇位継承者であるフランツ・フェルディナントとの結婚は貴賤結婚となった。皇帝フランツ・ヨーゼフは、2人の間に生まれた子孫が皇位を継がないことを条件として結婚を承認していた。視察が予定されている<hl>6月28日<hl>は2人の14回目の結婚記念日であった。"
15
- example_title: "Question Generation Example 1"
16
- - text: "『クマのプーさん』の物語はまず1925年12月24日、『イヴニング・ニュース』紙のクリスマス特集号に短編作品として掲載された。これは『クマのプーさん』の第一章にあたる作品で、このときだけは挿絵をJ.H.ダウドがつけている。その後作品10話と挿絵が整い、刊行に先駆けて「イーヨーの誕生日」のエピソードが1926年8月に『ロイヤルマガジン』に、同年10月9日に『ニューヨーク・イヴニング・ポスト』紙に掲載されたあと、同年10月14日にロンドンで(メシュエン社)、21日にニューヨークで(ダットン社)『クマのプーさん』が刊行された。前著『ぼくたちがとてもちいさかったころ』がすでに大きな成功を収めていたこともあり、イギリスでは初版は前著の7倍に当たる<hl>3万5000部<hl>が刷られた。他方のアメリカでもその年の終わりまでに15万部を売り上げている。ただし依然として人気のあった前著を売り上げで追い越すには数年の時間を要した。"
17
- example_title: "Question Generation Example 2"
18
- - text: "フェルメールの作品では、17世紀のオランダの画家、ヨハネス・フェルメールの作品について記述する。フェルメールの作品は、疑問作も含め<hl>30数点<hl>しか現存しない。現存作品はすべて油彩画で、版画、下絵、素描などは残っていない。以下には若干の疑問作も含め、37点の基本情報を記載し、各作品について略説する。収録順序、推定制作年代は『「フェルメールとその時代展」図録』による。日本語の作品タイトルについては、上掲図録のほか、『「フェルメール展」図録』、『フェルメール生涯と作品』による。便宜上「1650年代の作品」「1660年代の作品」「1670年代の作品」の3つの節を設けたが、フェルメールの作品には制作年代不明のものが多く、推定制作年代については研究者や文献によって若干の差がある。"
19
- example_title: "Question Generation Example 3"
20
- - text: "東大寺は、六宗兼学の場として世に広く知られるようになった。六宗とはすなわち、法相宗(法性宗)、三論宗、倶舎宗(薩婆多宗)、成実宗、華厳宗(花厳宗)、律宗のことであり、すべて<hl>中国<hl>から起こり、伝来したものであった。当時の宗とは、教団というよりは仏教教理の学派に近い。それゆえ、兼学の場ができたとも言える。この様な兼学の形態は、南都の寺院では広く見られたものである。この六宗兼学の場(後、真言、天台加わって八宗兼学の場)の性格は、現在の東大寺でも見られるが、中でも重んじられたのが、本尊の大仏の性格が華厳経の教えに則ったものであることからも分かるように、華厳宗である。"
21
- example_title: "Question Generation Example 4"
22
  pipeline_tag: text2text-generation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  ---
24
 
25
- # MBART LARGE CC25 fine-tuned for Japanese Question Generation
26
- MBART LARGE CC25 Model fine-tuned on Japanese question generation dataset (JaQuAD) with an extensive hyper-parameter search.
27
- - [Online Demo](https://autoqg.net/)
28
- - [Project Repository](https://github.com/asahi417/lm-question-generation)
29
 
30
- ## Overview
31
 
32
- **Language model:** mbart-large-cc25
33
- **Language:** Japanese (ja)
34
- **Downstream-task:** Question Generation
35
- **Training data:** JaQuAD
36
- **Eval data:** JaQuAD
37
- **Code:** See [our repository](https://github.com/asahi417/lm-question-generation)
 
38
 
39
- ## Usage
40
- ### In Transformers
41
  ```python
 
42
  from transformers import pipeline
43
 
44
- model_path = 'asahi417/lmqg-mbart-large-cc25-jaquad'
45
  pipe = pipeline("text2text-generation", model_path)
46
 
47
- # Question Genration
48
- paragraph = '東大寺は、六宗兼学の場として世に広く知られるようになった。六宗とはすなわち、法相宗(法性宗)、三論宗、倶舎宗(薩婆多宗)、成実宗、華厳宗(花厳宗)、律宗のことであり、すべて中国から起こり、伝来したものであった。'
49
- # highlight an answer in the paragraph to generate question
50
- answer = '中国'
51
- highlight_token = '<hl>'
52
- input_text = paragraph.replace(answer, '{0} {1} {0}'.format(highlight_token, answer))
53
- generation = pipe(input_text)
54
- print(generation)
55
- >>> [{'generated_text': '六宗はどの国から起こったものでありますか。'}]
56
  ```
57
 
58
- ## Evaluations
59
- Evaluation on the test set of [JaQuAD QG dataset](https://huggingface.co/datasets/asahi417/qg_jaquad).
60
- All evaluations were done using our [evaluation script](https://github.com/asahi417/lm-question-generation).
 
 
 
 
 
 
 
 
61
 
62
- | BLEU 4 | ROUGE L | METEOR | BERTScore |
63
- | ------ | -------- | ------ | --------- |
64
- | 32.15 | 52.94 | 29.97 | 82.25 |
65
 
66
- - [metric file](https://huggingface.co/asahi417/lmqg-mbart-large-cc25-jaquad/raw/main/eval/metric.first.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
- ## Fine-tuning Parameters
69
- We ran grid search to find the best hyper-parameters and continued fine-tuning until the validation metric decrease.
70
- The best hyper-parameters can be found [here](https://huggingface.co/asahi417/lmqg-mbart-large-cc25-jaquad/raw/main/trainer_config.json), and fine-tuning script is released in [our repository](https://github.com/asahi417/lm-question-generation).
71
 
72
  ## Citation
73
  TBA
1
+
2
  ---
 
 
 
3
  license: cc-by-4.0
 
 
4
  metrics:
5
+ - bleu4
6
  - meteor
7
+ - rouge-l
8
  - bertscore
9
+ - moverscore
10
+ language: ja
11
+ datasets:
12
+ - lmqg/qg_jaquad
 
 
 
 
 
13
  pipeline_tag: text2text-generation
14
+ tags:
15
+ - question generation
16
+ widget:
17
+ - text: "generate question: ゾフィーは貴族出身ではあったが王族出身ではなく、ハプスブルク家の皇位継承者であるフランツ・フェルディナントとの結婚は貴賤結婚となった。皇帝フランツ・ヨーゼフは、2人の間に生まれた子孫が皇位を継がないことを条件として結婚を承認していた。視察が予定されている<hl>6月28日<hl>は2人の14回目の結婚記念日であった。"
18
+ example_title: "Question Generation Example 1"
19
+ - text: "generate question: 『クマのプーさん』の物語はまず1925年12月24日、『イヴニング・ニュース』紙のクリスマス特集号に短編作品として掲載された。これは『クマのプーさん』の第一章にあたる作品で、このときだけは挿絵をJ.H.ダウドがつけている。その後作品10話と挿絵が整い、刊行に先駆けて「イーヨーの誕生日」のエピソードが1926年8月に『ロイヤルマガジン』に、同年10月9日に『ニューヨーク・イヴニング・ポスト』紙に掲載されたあと、同年10月14日にロンドンで(メシュエン社)、21日にニューヨークで(ダットン社)『クマのプーさん』が刊行された。前著『ぼくたちがとてもちいさかったころ』がすでに大きな成功を収めていたこともあり、イギリスでは初版は前著の7倍に当たる<hl>3万5000部<hl>が刷られた。他方のアメリカでもその年の終わりまでに15万部を売り上げている。ただし依然として人気のあった前著を売り上げで追い越すには数年の時間を要した。"
20
+ example_title: "Question Generation Example 2"
21
+ - text: "generate question: フェルメールの作品では、17世紀のオランダの画家、ヨハネス・フェルメールの作品について記述する。フェルメールの作品は、疑問作も含め<hl>30数点<hl>しか現存しない。現存作品はすべて油彩画で、版画、下絵、素描などは残っていない。以下には若干の疑問作も含め、37点の基本情報を記載し、各作品について略説する。収録順序、推定制作年代は『「フェルメールとその時代展」図録』による。日本語の作品タイトルについては、上掲図録のほか、『「フェルメール展」図録』、『フェルメール生涯と作品』による。便宜上「1650年代の作品」「1660年代の作品」「1670年代の作品」の3つの節を設けたが、フェルメールの作品には制作年代不明のものが多く、推定制作年代については研究者や文献によって若干の差がある。"
22
+ example_title: "Question Generation Example 3"
23
+ model-index:
24
+ - name: lmqg/mbart-large-cc25-jaquad
25
+ results:
26
+ - task:
27
+ name: Text2text Generation
28
+ type: text2text-generation
29
+ dataset:
30
+ name: lmqg/qg_jaquad
31
+ type: default
32
+ args: default
33
+ metrics:
34
+ - name: BLEU4
35
+ type: bleu4
36
+ value: 0.32156776073917387
37
+ - name: ROUGE-L
38
+ type: rouge-l
39
+ value: 0.5294969429504184
40
+ - name: METEOR
41
+ type: meteor
42
+ value: 0.2997311570800795
43
+ - name: BERTScore
44
+ type: bertscore
45
+ value: 0.8225831409256842
46
+ - name: MoverScore
47
+ type: moverscore
48
+ value: 0.5987761972106114
49
  ---
50
 
51
+ # Language Models Fine-tuning on Question Generation: `lmqg/mbart-large-cc25-jaquad`
52
+ This model is fine-tuned version of [facebook/mbart-large-cc25](https://huggingface.co/facebook/mbart-large-cc25) for question generation task on the
53
+ [lmqg/qg_jaquad](https://huggingface.co/datasets/lmqg/qg_jaquad) (dataset_name: default).
 
54
 
 
55
 
56
+ ### Overview
57
+ - **Language model:** [facebook/mbart-large-cc25](https://huggingface.co/facebook/mbart-large-cc25)
58
+ - **Language:** ja
59
+ - **Training data:** [lmqg/qg_jaquad](https://huggingface.co/datasets/lmqg/qg_jaquad) (default)
60
+ - **Online Demo:** [https://autoqg.net/](https://autoqg.net/)
61
+ - **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
62
+ - **Paper:** [TBA](TBA)
63
 
64
+ ### Usage
 
65
  ```python
66
+
67
  from transformers import pipeline
68
 
69
+ model_path = 'lmqg/mbart-large-cc25-jaquad'
70
  pipe = pipeline("text2text-generation", model_path)
71
 
72
+ # Question Generation
73
+ question = pipe('generate question: ゾフィーは貴族出身ではあったが王族出身ではなく、ハプスブルク家の皇位継承者であるフランツ・フェルディナントとの結婚は貴賤結婚となった。皇帝フランツ・ヨーゼフは、2人の間に生まれた子孫が皇位を継がないことを条件として結婚を承認していた。視察が予定されている<hl>6月28日<hl>は2人の14回目の結婚記念日であった。')
 
 
 
 
 
 
 
74
  ```
75
 
76
+ ## Evaluation Metrics
77
+
78
+
79
+ ### Metrics
80
+
81
+ | Dataset | Type | BLEU4 | ROUGE-L | METEOR | BERTScore | MoverScore | Link |
82
+ |:--------|:-----|------:|--------:|-------:|----------:|-----------:|-----:|
83
+ | [lmqg/qg_jaquad](https://huggingface.co/datasets/lmqg/qg_jaquad) | default | 0.32156776073917387 | 0.5294969429504184 | 0.2997311570800795 | 0.8225831409256842 | 0.5987761972106114 | [link](https://huggingface.co/lmqg/mbart-large-cc25-jaquad/raw/main/eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json) |
84
+
85
+
86
+
87
 
88
+ ## Training hyperparameters
 
 
89
 
90
+ The following hyperparameters were used during fine-tuning:
91
+ - dataset_path: lmqg/qg_jaquad
92
+ - dataset_name: default
93
+ - input_types: ['paragraph_answer']
94
+ - output_types: ['question']
95
+ - prefix_types: None
96
+ - model: facebook/mbart-large-cc25
97
+ - max_length: 512
98
+ - max_length_output: 32
99
+ - epoch: 12
100
+ - batch: 64
101
+ - lr: 0.0001
102
+ - fp16: False
103
+ - random_seed: 1
104
+ - gradient_accumulation_steps: 1
105
+ - label_smoothing: 0.15
106
 
107
+ The full configuration can be found at [fine-tuning config file](https://huggingface.co/lmqg/mbart-large-cc25-jaquad/raw/main/trainer_config.json).
 
 
108
 
109
  ## Citation
110
  TBA
eval/{metric.first.answer.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.first.answer.paragraph_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.first.answer.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.first.answer.paragraph_sentence.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.first.answer.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.first.answer.sentence_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.first.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.first.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.first.sentence.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.first.sentence.paragraph_sentence.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.first.sentence.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.first.sentence.sentence_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.last.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.last.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.last.sentence.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.last.sentence.paragraph_sentence.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.last.sentence.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.last.sentence.sentence_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.long.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.long.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.long.sentence.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.long.sentence.paragraph_sentence.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.long.sentence.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.long.sentence.sentence_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.middle.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.middle.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.middle.sentence.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.middle.sentence.paragraph_sentence.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.middle.sentence.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.middle.sentence.sentence_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.short.sentence.paragraph_answer.question.asahi417_qg_jaquad.default.json → metric.short.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.short.sentence.paragraph_sentence.question.asahi417_qg_jaquad.default.json → metric.short.sentence.paragraph_sentence.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{metric.short.sentence.sentence_answer.question.asahi417_qg_jaquad.default.json → metric.short.sentence.sentence_answer.question.lmqg_qg_jaquad.default.json} RENAMED
File without changes
eval/{samples.test.hyp.paragraph_answer.question.asahi417_qg_jaquad.default.txt → samples.test.hyp.paragraph_answer.question.lmqg_qg_jaquad.default.txt} RENAMED
File without changes
eval/{samples.test.hyp.paragraph_sentence.question.asahi417_qg_jaquad.default.txt → samples.test.hyp.paragraph_sentence.question.lmqg_qg_jaquad.default.txt} RENAMED
File without changes
eval/{samples.test.hyp.sentence_answer.question.asahi417_qg_jaquad.default.txt → samples.test.hyp.sentence_answer.question.lmqg_qg_jaquad.default.txt} RENAMED
File without changes
eval/{samples.validation.hyp.paragraph_answer.question.asahi417_qg_jaquad.default.txt → samples.validation.hyp.paragraph_answer.question.lmqg_qg_jaquad.default.txt} RENAMED
File without changes
eval/{samples.validation.hyp.paragraph_sentence.question.asahi417_qg_jaquad.default.txt → samples.validation.hyp.paragraph_sentence.question.lmqg_qg_jaquad.default.txt} RENAMED
File without changes
eval/{samples.validation.hyp.sentence_answer.question.asahi417_qg_jaquad.default.txt → samples.validation.hyp.sentence_answer.question.lmqg_qg_jaquad.default.txt} RENAMED
File without changes
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"dataset_path": "asahi417/qg_jaquad", "dataset_name": "default", "input_types": ["paragraph_answer"], "output_types": ["question"], "prefix_types": null, "model": "facebook/mbart-large-cc25", "max_length": 512, "max_length_output": 32, "epoch": 12, "batch": 64, "lr": 0.0001, "fp16": false, "random_seed": 1, "gradient_accumulation_steps": 1, "label_smoothing": 0.15}
1
+ {"dataset_path": "lmqg/qg_jaquad", "dataset_name": "default", "input_types": ["paragraph_answer"], "output_types": ["question"], "prefix_types": null, "model": "facebook/mbart-large-cc25", "max_length": 512, "max_length_output": 32, "epoch": 12, "batch": 64, "lr": 0.0001, "fp16": false, "random_seed": 1, "gradient_accumulation_steps": 1, "label_smoothing": 0.15}