Downloads · 30 days
15
1% of all-time downloads
persiannlp/mt5-base-parsinlu-multiple-choice
mt5-base-parsinlu-multiple-choice is a multiple choice model from persiannlp. Use it for the multiple choice task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as cc-by-nc-sa-4.0.
This is a mT5-based model for multiple-choice question answering. Here is an example of how you can run this model:
Downloads · 30 days
15
1% of all-time downloads
All-time downloads
1.2K
Public
Repo size
7 GB
Likes
0
Public
Click a slice to open those files.
.bin2.3 GB · 50%
From the Hugging Face model README
This is a mT5-based model for multiple-choice question answering. Here is an example of how you can run this model:
from transformers import MT5ForConditionalGeneration, MT5Tokenizer
model_size = "base"
model_name = f"persiannlp/mt5-{model_size}-parsinlu-multiple-choice"
tokenizer = MT5Tokenizer.from_pretrained(model_name)
model = MT5ForConditionalGeneration.from_pretrained(model_name)
def run_model(input_string, **generator_args):
input_ids = tokenizer.encode(input_string, return_tensors="pt")
res = model.generate(input_ids, **generator_args)
output = tokenizer.batch_decode(res, skip_special_tokens=True)
print(output)
return output
run_model("وسیع ترین کشور جهان کدام است؟ <sep> آمریکا <sep> کانادا <sep> روسیه <sep> چین")
run_model("طامع یعنی ؟ <sep> آزمند <sep> خوش شانس <sep> محتاج <sep> مطمئن")
run_model(
"زمینی به ۳۱ قطعه متساوی مفروض شده است و هر روز مساحت آماده شده برای احداث، دو برابر مساحت روز قبل است.اگر پس از (۵ روز) تمام زمین آماده شده باشد، در چه روزی یک قطعه زمین آماده شده <sep> روز اول <sep> روز دوم <sep> روز سوم <sep> هیچکدام")
For more details, visit this page: https://github.com/persiannlp/parsinlu/