persiannlp / wikibert-base-parsinlu-multiple-choice

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

Introduction of wikibert-base-parsinlu-multiple-choice

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

Multiple-Choice Question Answering (مدل برای پاسخ به سوالات چهار جوابی)

This is a wikibert-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/wikibert-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 wikibert-base-parsinlu-multiple-choice on huggingface.co

75
Total runs
0
24-hour runs
4
3-day runs
7
7-day runs
23
30-day runs

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

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

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

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

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

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

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

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

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

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

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

wikibert-base-parsinlu-multiple-choice install

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

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

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

Url of wikibert-base-parsinlu-multiple-choice

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

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

persiannlp
ORGANIZATIONS

Other API from persiannlp