Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: ["es"]
|
3 |
+
tags:
|
4 |
+
- spanish
|
5 |
+
- question generation
|
6 |
+
- qg
|
7 |
+
Datasets:
|
8 |
+
- SQUAD
|
9 |
+
license: mit
|
10 |
+
---
|
11 |
+
This is the finetuned model of hiiamsid/est5-base for Question Generation task.
|
12 |
+
* Here input is the context only and output is questions. No information regarding answers were given to model.
|
13 |
+
* Unfortunately, due to lack of sufficient resources it is fine tuned with batch_size=10 and num_seq_len=256. So, if too large context is given model may not get information about last portions.
|
14 |
+
|
15 |
+
```
|
16 |
+
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
17 |
+
MODEL_NAME = 'hiiamsid/est5-base-qg'
|
18 |
+
model = T5ForConditionalGeneration.from_pretrained(MODEL_NAME)
|
19 |
+
tokenizer = T5Tokenizer.from_pretrained(MODEL_NAME)
|
20 |
+
model.cuda();
|
21 |
+
model.eval();
|
22 |
+
def generate_question(text, beams=10, grams=2, num_return_seq=10,max_size=256):
|
23 |
+
x = tokenizer(text, return_tensors='pt', padding=True).to(model.device)
|
24 |
+
out = model.generate(**x, no_repeat_ngram_size=grams, num_beams=beams, num_return_sequences=num_return_seq, max_length=max_size)
|
25 |
+
return tokenizer.decode(out[0], skip_special_tokens=True)
|
26 |
+
print(generate_question('Any context in spanish from which question is to be generated'))
|
27 |
+
|
28 |
+
```
|
29 |
+
|
30 |
+
## Citing & Authors
|
31 |
+
- Datasets : [squad_es](https://huggingface.co/datasets/squad_es)
|
32 |
+
- Model : [hiiamsid/est5-base](hiiamsid/est5-base)
|