| --- |
| language: |
| - fa |
| - multilingual |
| thumbnail: "https://upload.wikimedia.org/wikipedia/commons/a/a2/Farsi.svg" |
| tags: |
| - multiple-choice |
| - mbert |
| - persian |
| - farsi |
| license: "CC BY-NC-SA 4.0" |
| datasets: |
| - parsinlu |
| metrics: |
| - accuracy |
| --- |
| |
| # Multiple-Choice Question Answering (مدل برای پاسخ به سوالات چهار جوابی) |
|
|
| This is a mbert-based model for multiple-choice question answering. |
| Here is an example of how you can run this model: |
|
|
| ```python |
| from transformers import BertTokenizer, BertModel |
| |
| model_name = f"persiannlp/mbert-base-parsinlu-multiple-choice" |
| tokenizer = BertTokenizer.from_pretrained(model_name) |
| model = BertModel.from_pretrained(model_name) |
| |
| |
| def run_model(input_string): |
| input_ids = tokenizer(input_string, return_tensors="pt") |
| output = model(input_ids) |
| 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/ |
|
|