julien-c HF staff commited on
Commit
28550a3
1 Parent(s): ad7ab1f

Migrate model card from transformers-repo

Browse files

Read announcement at https://discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755
Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/valhalla/t5-base-qg-hl/README.md

Files changed (1) hide show
  1. README.md +33 -0
README.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - squad
4
+ tags:
5
+ - question-generation
6
+ widget:
7
+ - text: "<hl> 42 <hl> is the answer to life, the universe and everything. </s>"
8
+ - text: "Python is a programming language. It is developed by <hl> Guido Van Rossum <hl>. </s>"
9
+ - text: "Although <hl> practicality <hl> beats purity </s>"
10
+ license: mit
11
+ ---
12
+
13
+ ## T5 for question-generation
14
+ This is [t5-base](https://arxiv.org/abs/1910.10683) model trained for answer aware question generation task. The answer spans are highlighted within the text with special highlight tokens.
15
+
16
+ You can play with the model using the inference API, just highlight the answer spans with `<hl>` tokens and end the text with `</s>`. For example
17
+
18
+ `<hl> 42 <hl> is the answer to life, the universe and everything. </s>`
19
+
20
+ For more deatils see [this](https://github.com/patil-suraj/question_generation) repo.
21
+
22
+ ### Model in action 🚀
23
+
24
+ You'll need to clone the [repo](https://github.com/patil-suraj/question_generation).
25
+
26
+ [![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)
27
+
28
+ ```python3
29
+ from pipelines import pipeline
30
+ nlp = pipeline("question-generation", model="valhalla/t5-base-qg-hl")
31
+ nlp("42 is the answer to life, universe and everything.")
32
+ => [{'answer': '42', 'question': 'What is the answer to life, universe and everything?'}]
33
+ ```