system HF staff commited on
Commit
79a61f7
1 Parent(s): 19ebf9f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +46 -0
README.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - squad
4
+ tags:
5
+ - question-generation
6
+ - distilt5
7
+ - distilt5-qg
8
+ widget:
9
+ - text: "<hl> 42 <hl> is the answer to life, the universe and everything. </s>"
10
+ - text: "Python is a programming language. It is developed by <hl> Guido Van Rossum <hl>. </s>"
11
+ - text: "Although <hl> practicality <hl> beats purity </s>"
12
+ license: "MIT"
13
+ ---
14
+
15
+ ## DistilT5 for question-generation
16
+ This is distilled version of [t5-small-qa-qg-hl](https://huggingface.co/valhalla/t5-small-qa-qg-hl) model trained for answer aware question generation task. The answer spans are highlighted within the text with special highlight tokens.
17
+
18
+ The model is distilled using the **No Teacher Distillation** method proposed by Huggingface, [here](https://github.com/huggingface/transformers/tree/master/examples/seq2seq#distilbart).
19
+
20
+ We just copy alternating layers from `t5-small-qa-qg-hl` and finetune more on the same data. Following table lists other distilled models and their metrics.
21
+
22
+ | Name | BLEU-4 | METEOR | ROUGE-L | QA-EM | QA-F1 |
23
+ |---------------------------------------------------------------------------------|---------|---------|---------|--------|--------|
24
+ | [distilt5-qg-hl-6-4](https://huggingface.co/valhalla/distilt5-qg-hl-6-4) | 18.4141 | 24.8417 | 40.3435 | - | - |
25
+ | [distilt5-qa-qg-hl-6-4](https://huggingface.co/valhalla/distilt5-qa-qg-hl-6-4) | 18.6493 | 24.9685 | 40.5605 | 76.13 | 84.659 |
26
+ | [distilt5-qg-hl-12-6](https://huggingface.co/valhalla/distilt5-qg-hl-12-6) | 20.5275 | 26.5010 | 43.2676 | - | - |
27
+ | [distilt5-qa-qg-hl-12-6](https://huggingface.co/valhalla/distilt5-qa-qg-hl-12-6)| 20.6109 | 26.4533 | 43.0895 | 81.61 | 89.831 |
28
+
29
+ You can play with the model using the inference API, just highlight the answer spans with `<hl>` tokens. For example
30
+
31
+ `<hl> 42 <hl> is the answer to life, the universe and everything.`
32
+
33
+ For more deatils see [this](https://github.com/patil-suraj/question_generation) repo.
34
+
35
+ ### Model in action 🚀
36
+
37
+ You'll need to clone the [repo](https://github.com/patil-suraj/question_generation).
38
+
39
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb)
40
+
41
+ ```python3
42
+ from pipelines import pipeline
43
+ nlp = pipeline("question-generation", model="valhalla/distilt5-qg-hl-6-4")
44
+ nlp("42 is the answer to life, universe and everything.")
45
+ => [{'answer': '42', 'question': 'What is the answer to life?'}]
46
+ ```