Anshoo Mehra
commited on
Commit
·
2f18a64
1
Parent(s):
5b49009
Update README.md
Browse files
README.md
CHANGED
@@ -4,36 +4,58 @@ tags:
|
|
4 |
metrics:
|
5 |
- rouge
|
6 |
model-index:
|
7 |
-
- name: t5-v1-base-s-q
|
8 |
results: []
|
9 |
---
|
10 |
|
11 |
-
|
12 |
-
|
|
|
|
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
It achieves the following results on the evaluation set:
|
18 |
-
- Loss: 2.0511
|
19 |
-
- Rouge1: 0.2149
|
20 |
-
- Rouge2: 0.1011
|
21 |
-
- Rougel: 0.1936
|
22 |
-
- Rougelsum: 0.2014
|
23 |
|
24 |
-
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
|
37 |
|
38 |
### Training hyperparameters
|
39 |
|
|
|
4 |
metrics:
|
5 |
- rouge
|
6 |
model-index:
|
7 |
+
- name: anshoomehra/question-generation-auto-t5-v1-base-s-q
|
8 |
results: []
|
9 |
---
|
10 |
|
11 |
+
# Auto Question Generation
|
12 |
+
The model is intended to be used for Auto Question Generation task i.e. no hint are required as input. The model is expected to produce one or possibly more than one question from the provided context.
|
13 |
+
|
14 |
+
[Live Demo: Question Generation](https://huggingface.co/spaces/anshoomehra/question_generation)
|
15 |
|
16 |
+
Including this there are four models trained with different training sets, demo provide comparison to all in one go. However, you can reach individual projects at below links:
|
17 |
|
18 |
+
[Auto Question Generation v1](https://huggingface.co/anshoomehra/question-generation-auto-t5-v1-base-s)
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
[Auto/Hints based Question Generation v1](https://huggingface.co/anshoomehra/question-generation-auto-hints-t5-v1-base-s-q)
|
21 |
|
22 |
+
[Auto/Hints based Question Generation v2](https://huggingface.co/anshoomehra/question-generation-auto-hints-t5-v1-base-s-q-c)
|
23 |
|
24 |
+
This model can be used as below:
|
25 |
|
26 |
+
```
|
27 |
+
from transformers import (
|
28 |
+
AutoModelForSeq2SeqLM,
|
29 |
+
AutoTokenizer
|
30 |
+
)
|
31 |
|
32 |
+
model_checkpoint = "anshoomehra/question-generation-auto-t5-v1-base-s-q"
|
33 |
+
|
34 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)
|
35 |
+
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
36 |
+
|
37 |
+
## Input with prompt
|
38 |
+
context="question_context: <context>"
|
39 |
+
encodings = tokenizer.encode(context, return_tensors='pt', truncation=True, padding='max_length').to(device)
|
40 |
|
41 |
+
## You can play with many hyperparams to condition the output, look at demo
|
42 |
+
output = model.generate(encodings,
|
43 |
+
#max_length=300,
|
44 |
+
#min_length=20,
|
45 |
+
#length_penalty=2.0,
|
46 |
+
num_beams=4,
|
47 |
+
#early_stopping=True,
|
48 |
+
#do_sample=True,
|
49 |
+
#temperature=1.1
|
50 |
+
)
|
51 |
+
|
52 |
+
## Multiple questions are expected to be delimited by '?' You can write a small wrapper to elegantly format. Look at the demo.
|
53 |
+
questions = [tokenizer.decode(id, clean_up_tokenization_spaces=False, skip_special_tokens=False) for id in output]
|
54 |
+
```
|
55 |
+
|
56 |
+
## Training and evaluation data
|
57 |
|
58 |
+
Custom data.
|
59 |
|
60 |
### Training hyperparameters
|
61 |
|