danyaljj commited on
Commit
95a20c7
1 Parent(s): 713be84

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +51 -0
README.md ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - fa
4
+ - multilingual
5
+ thumbnail: "https://upload.wikimedia.org/wikipedia/commons/a/a2/Farsi.svg"
6
+ tags:
7
+ - multiple-choice
8
+ - mt5
9
+ - persian
10
+ - farsi
11
+ license: "CC BY-NC-SA 4.0"
12
+ datasets:
13
+ - parsinlu
14
+ - commonsenseqa
15
+ - arc
16
+ - openbookqa
17
+ metrics:
18
+ - accuracy
19
+ ---
20
+
21
+ # Multiple-Choice Question Answering (مدل برای پاسخ به سوالات چهار جوابی)
22
+
23
+ This is a mT5-based model for multiple-choice question answering.
24
+ Here is an example of how you can run this model:
25
+
26
+ ```python
27
+ from transformers import MT5ForConditionalGeneration, MT5Tokenizer
28
+
29
+ model_size = "base"
30
+ model_name = f"persiannlp/mt5-{model_size}-parsinlu-arc-comqa-obqa-multiple-choice"
31
+ tokenizer = MT5Tokenizer.from_pretrained(model_name)
32
+ model = MT5ForConditionalGeneration.from_pretrained(model_name)
33
+
34
+
35
+ def run_model(input_string, **generator_args):
36
+ input_ids = tokenizer.encode(input_string, return_tensors="pt")
37
+ res = model.generate(input_ids, **generator_args)
38
+ output = tokenizer.batch_decode(res, skip_special_tokens=True)
39
+ print(output)
40
+ return output
41
+
42
+
43
+ run_model("وسیع ترین کشور جهان کدام است؟ <sep> آمریکا <sep> کانادا <sep> روسیه <sep> چین")
44
+ run_model("طامع یعنی ؟ <sep> آزمند <sep> خوش شانس <sep> محتاج <sep> مطمئن")
45
+ run_model(
46
+ "زمینی به ۳۱ قطعه متساوی مفروض شده است و هر روز مساحت آماده شده برای احداث، دو برابر مساحت روز قبل است.اگر پس از (۵ روز) تمام زمین آماده شده باشد، در چه روزی یک قطعه زمین آماده شده <sep> روز اول <sep> روز دوم <sep> روز سوم <sep> هیچکدام")
47
+
48
+ ```
49
+
50
+
51
+ For more details, visit this page: https://github.com/persiannlp/parsinlu/