persiannlp / mbert-base-parsinlu-multiple-choice

huggingface.co
Total runs: 72
24-hour runs: 0
7-day runs: 1
30-day runs: 32
Model's Last Updated: September 24 2021
text-classification

Introduction of mbert-base-parsinlu-multiple-choice

Model Details of mbert-base-parsinlu-multiple-choice

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:

from typing import List
import torch
from transformers import AutoConfig, AutoModelForMultipleChoice, AutoTokenizer

model_name = "persiannlp/mbert-base-parsinlu-multiple-choice"
tokenizer = AutoTokenizer.from_pretrained(model_name)
config = AutoConfig.from_pretrained(model_name)
model = AutoModelForMultipleChoice.from_pretrained(model_name, config=config)


def run_model(question: str, candicates: List[str]):
    assert len(candicates) == 4, "you need four candidates"
    choices_inputs = []
    for c in candicates:
        text_a = ""  # empty context
        text_b = question + " " + c
        inputs = tokenizer(
            text_a,
            text_b,
            add_special_tokens=True,
            max_length=128,
            padding="max_length",
            truncation=True,
            return_overflowing_tokens=True,
        )
        choices_inputs.append(inputs)

    input_ids = torch.LongTensor([x["input_ids"] for x in choices_inputs])
    output = model(input_ids=input_ids)
    print(output)
    return output


run_model(question="وسیع ترین کشور جهان کدام است؟", candicates=["آمریکا", "کانادا", "روسیه", "چین"])
run_model(question="طامع یعنی ؟", candicates=["آزمند", "خوش شانس", "محتاج", "مطمئن"])
run_model(
    question="زمینی به ۳۱ قطعه متساوی مفروض شده است و هر روز مساحت آماده شده برای احداث، دو برابر مساحت روز قبل است.اگر پس از (۵ روز) تمام زمین آماده شده باشد، در چه روزی یک قطعه زمین آماده شده ",
    candicates=["روز اول", "روز دوم", "روز سوم", "هیچکدام"])

For more details, visit this page: https://github.com/persiannlp/parsinlu/

Runs of persiannlp mbert-base-parsinlu-multiple-choice on huggingface.co

72
Total runs
0
24-hour runs
0
3-day runs
1
7-day runs
32
30-day runs

More Information About mbert-base-parsinlu-multiple-choice huggingface.co Model

More mbert-base-parsinlu-multiple-choice license Visit here:

https://choosealicense.com/licenses/cc-by-nc-sa-4.0

mbert-base-parsinlu-multiple-choice huggingface.co

mbert-base-parsinlu-multiple-choice huggingface.co is an AI model on huggingface.co that provides mbert-base-parsinlu-multiple-choice's model effect (), which can be used instantly with this persiannlp mbert-base-parsinlu-multiple-choice model. huggingface.co supports a free trial of the mbert-base-parsinlu-multiple-choice model, and also provides paid use of the mbert-base-parsinlu-multiple-choice. Support call mbert-base-parsinlu-multiple-choice model through api, including Node.js, Python, http.

mbert-base-parsinlu-multiple-choice huggingface.co Url

https://huggingface.co/persiannlp/mbert-base-parsinlu-multiple-choice

persiannlp mbert-base-parsinlu-multiple-choice online free

mbert-base-parsinlu-multiple-choice huggingface.co is an online trial and call api platform, which integrates mbert-base-parsinlu-multiple-choice's modeling effects, including api services, and provides a free online trial of mbert-base-parsinlu-multiple-choice, you can try mbert-base-parsinlu-multiple-choice online for free by clicking the link below.

persiannlp mbert-base-parsinlu-multiple-choice online free url in huggingface.co:

https://huggingface.co/persiannlp/mbert-base-parsinlu-multiple-choice

mbert-base-parsinlu-multiple-choice install

mbert-base-parsinlu-multiple-choice is an open source model from GitHub that offers a free installation service, and any user can find mbert-base-parsinlu-multiple-choice on GitHub to install. At the same time, huggingface.co provides the effect of mbert-base-parsinlu-multiple-choice install, users can directly use mbert-base-parsinlu-multiple-choice installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

mbert-base-parsinlu-multiple-choice install url in huggingface.co:

https://huggingface.co/persiannlp/mbert-base-parsinlu-multiple-choice

Url of mbert-base-parsinlu-multiple-choice

mbert-base-parsinlu-multiple-choice huggingface.co Url

Provider of mbert-base-parsinlu-multiple-choice huggingface.co

persiannlp
ORGANIZATIONS

Other API from persiannlp