asahi417 commited on
Commit
1b5473a
1 Parent(s): b4cf121

commit files to HF hub

Browse files
README.md ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ license: cc-by-4.0
4
+ metrics:
5
+ - bleu4
6
+ - meteor
7
+ - rouge-l
8
+ - bertscore
9
+ - moverscore
10
+ language: zh
11
+ datasets:
12
+ - lmqg/qg_zhquad
13
+ pipeline_tag: text2text-generation
14
+ tags:
15
+ - question generation
16
+ widget:
17
+ - text: "南安普敦的警察服务由汉普郡警察提供。南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。该建筑位于南路,2011年启用,靠近<hl> 南安普敦中央 <hl>火车站。此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。在Portswood、Banister Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。"
18
+ example_title: "Question Generation Example 1"
19
+ - text: "芝加哥大学的<hl> 1960—61 <hl>集团理论年汇集了Daniel Gorenstein、John G. Thompson和Walter Feit等团体理论家,奠定了一个合作的基础,借助于其他众多数学家的输入,1982中对所有有限的简单群进行了分类。这个项目的规模超过了以往的数学研究,无论是证明的长度还是研究人员的数量。目前正在进行研究,以简化这一分类的证明。如今,群论仍然是一个非常活跃的数学分支,影响着许多其他领域"
20
+ example_title: "Question Generation Example 2"
21
+ model-index:
22
+ - name: lmqg/mt5-base-zhquad-qg
23
+ results:
24
+ - task:
25
+ name: Text2text Generation
26
+ type: text2text-generation
27
+ dataset:
28
+ name: lmqg/qg_zhquad
29
+ type: default
30
+ args: default
31
+ metrics:
32
+ - name: BLEU4 (Question Generation)
33
+ type: bleu4_question_generation
34
+ value: 14.73
35
+ - name: ROUGE-L (Question Generation)
36
+ type: rouge_l_question_generation
37
+ value: 34.72
38
+ - name: METEOR (Question Generation)
39
+ type: meteor_question_generation
40
+ value: 23.92
41
+ - name: BERTScore (Question Generation)
42
+ type: bertscore_question_generation
43
+ value: 77.38
44
+ - name: MoverScore (Question Generation)
45
+ type: moverscore_question_generation
46
+ value: 57.5
47
+ ---
48
+
49
+ # Model Card of `lmqg/mt5-base-zhquad-qg`
50
+ This model is fine-tuned version of [google/mt5-base](https://huggingface.co/google/mt5-base) for question generation task on the [lmqg/qg_zhquad](https://huggingface.co/datasets/lmqg/qg_zhquad) (dataset_name: default) via [`lmqg`](https://github.com/asahi417/lm-question-generation).
51
+
52
+
53
+ ### Overview
54
+ - **Language model:** [google/mt5-base](https://huggingface.co/google/mt5-base)
55
+ - **Language:** zh
56
+ - **Training data:** [lmqg/qg_zhquad](https://huggingface.co/datasets/lmqg/qg_zhquad) (default)
57
+ - **Online Demo:** [https://autoqg.net/](https://autoqg.net/)
58
+ - **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
59
+ - **Paper:** [https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)
60
+
61
+ ### Usage
62
+ - With [`lmqg`](https://github.com/asahi417/lm-question-generation#lmqg-language-model-for-question-generation-)
63
+ ```python
64
+ from lmqg import TransformersQG
65
+
66
+ # initialize model
67
+ model = TransformersQG(language="zh", model="lmqg/mt5-base-zhquad-qg")
68
+
69
+ # model prediction
70
+ questions = model.generate_q(list_context="南安普敦的警察服务由汉普郡警察提供。南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。该建筑位于南路,2011年启用,靠近南安普敦中央火车站。此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。在Portswood、Banister Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。", list_answer="南安普敦中央")
71
+
72
+ ```
73
+
74
+ - With `transformers`
75
+ ```python
76
+ from transformers import pipeline
77
+
78
+ pipe = pipeline("text2text-generation", "lmqg/mt5-base-zhquad-qg")
79
+ output = pipe("南安普敦的警察服务由汉普郡警察提供。南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。该建筑位于南路,2011年启用,靠近<hl> 南安普敦中央 <hl>火车站。此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。在Portswood、Banister Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。")
80
+
81
+ ```
82
+
83
+ ## Evaluation
84
+
85
+
86
+ - ***Metric (Question Generation)***: [raw metric file](https://huggingface.co/lmqg/mt5-base-zhquad-qg/raw/main/eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_zhquad.default.json)
87
+
88
+ | | Score | Type | Dataset |
89
+ |:-----------|--------:|:--------|:-----------------------------------------------------------------|
90
+ | BERTScore | 77.38 | default | [lmqg/qg_zhquad](https://huggingface.co/datasets/lmqg/qg_zhquad) |
91
+ | Bleu_1 | 37 | default | [lmqg/qg_zhquad](https://huggingface.co/datasets/lmqg/qg_zhquad) |
92
+ | Bleu_2 | 25.9 | default | [lmqg/qg_zhquad](https://huggingface.co/datasets/lmqg/qg_zhquad) |
93
+ | Bleu_3 | 19.25 | default | [lmqg/qg_zhquad](https://huggingface.co/datasets/lmqg/qg_zhquad) |
94
+ | Bleu_4 | 14.73 | default | [lmqg/qg_zhquad](https://huggingface.co/datasets/lmqg/qg_zhquad) |
95
+ | METEOR | 23.92 | default | [lmqg/qg_zhquad](https://huggingface.co/datasets/lmqg/qg_zhquad) |
96
+ | MoverScore | 57.5 | default | [lmqg/qg_zhquad](https://huggingface.co/datasets/lmqg/qg_zhquad) |
97
+ | ROUGE_L | 34.72 | default | [lmqg/qg_zhquad](https://huggingface.co/datasets/lmqg/qg_zhquad) |
98
+
99
+
100
+
101
+ ## Training hyperparameters
102
+
103
+ The following hyperparameters were used during fine-tuning:
104
+ - dataset_path: lmqg/qg_zhquad
105
+ - dataset_name: default
106
+ - input_types: paragraph_answer
107
+ - output_types: question
108
+ - prefix_types: None
109
+ - model: google/mt5-base
110
+ - max_length: 512
111
+ - max_length_output: 32
112
+ - epoch: 16
113
+ - batch: 16
114
+ - lr: 0.0001
115
+ - fp16: False
116
+ - random_seed: 1
117
+ - gradient_accumulation_steps: 4
118
+ - label_smoothing: 0.15
119
+
120
+ The full configuration can be found at [fine-tuning config file](https://huggingface.co/lmqg/mt5-base-zhquad-qg/raw/main/trainer_config.json).
121
+
122
+ ## Citation
123
+ ```
124
+ @inproceedings{ushio-etal-2022-generative,
125
+ title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
126
+ author = "Ushio, Asahi and
127
+ Alva-Manchego, Fernando and
128
+ Camacho-Collados, Jose",
129
+ booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
130
+ month = dec,
131
+ year = "2022",
132
+ address = "Abu Dhabi, U.A.E.",
133
+ publisher = "Association for Computational Linguistics",
134
+ }
135
+
136
+ ```
eval/metric.first.answer.paragraph_answer.question.lmqg_qg_zhquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"validation": {"Bleu_1": 0.3385168312250303, "Bleu_2": 0.2238112683506814, "Bleu_3": 0.1588321847167366, "Bleu_4": 0.11709569052083327}, "test": {"Bleu_1": 0.36719393835508957, "Bleu_2": 0.2572239905127818, "Bleu_3": 0.1912911241757621, "Bleu_4": 0.14644319098806993}}
eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_zhquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"validation": {"Bleu_1": 0.35851275727805954, "Bleu_2": 0.23893718120348878, "Bleu_3": 0.17066599689049272, "Bleu_4": 0.12650213237345015, "METEOR": 0.22585721479843068, "ROUGE_L": 0.3217720186623046, "BERTScore": 0.7550948901709557, "MoverScore": 0.5647446105087129}, "test": {"Bleu_1": 0.3700068673383822, "Bleu_2": 0.2589815349971843, "Bleu_3": 0.19249527438146838, "Bleu_4": 0.14734334732205598, "METEOR": 0.2392320688529274, "ROUGE_L": 0.34722697451954365, "BERTScore": 0.773827308392915, "MoverScore": 0.5750200359829101}}
eval/samples.test.hyp.paragraph_answer.question.lmqg_qg_zhquad.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_zhquad.default.txt ADDED
The diff for this file is too large to render. See raw diff