danyaljj commited on
Commit
f531570
2 Parent(s): 5b7406b 048faa8

Merge branch 'main' of https://huggingface.co/persiannlp/mt5-small-parsinlu-multiple-choice into main

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