philippelaban commited on
Commit
0a78822
·
1 Parent(s): 4cc3568

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -0
README.md CHANGED
@@ -1,3 +1,20 @@
1
  ---
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
  ---
4
+
5
+ Model card for the Question Generation component of the Discord Questions paper (EMNLP 2022 - Findings).
6
+ The model is a finetuned BART-large, and can be used with the following command:
7
+ ```py
8
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
9
+
10
+ dqg_tokenizer = AutoTokenizer.from_pretrained("/export/share/plaban/models/qgen/discord_qg")
11
+ discord_qg = AutoModelForSeq2SeqLM.from_pretrained("/export/share/plaban/models/qgen/discord_qg")
12
+
13
+ paragraph = "The International Monetary Fund warned on Tuesday that colliding pressures from inflation, war-driven energy and food crises and sharply higher interest rates were pushing the world to the brink of recession and threatening financial market stability."
14
+
15
+ encoder_ids = dqg_tokenizer.batch_encode_plus([paragraph], add_special_tokens=True, return_tensors="pt")
16
+ model_output = discord_qg.generate(**encoder_ids)
17
+
18
+ generated_texts = dqg_tokenizer.batch_decode(model_output, skip_special_tokens=True)
19
+ print(generated_texts) # ['When was the last time the IMF warned of a global recession?']
20
+ ```