Downloads · 30 days
19
1% of all-time downloads
persiannlp/mt5-base-parsinlu-snli-entailment
mt5-base-parsinlu-snli-entailment is a machine learning model from persiannlp. Use it for the machine learning 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 model for textual entailment problems. Here is an example of how you can run this model:
Downloads · 30 days
19
1% of all-time downloads
All-time downloads
3.6K
Public
Repo size
4.7 GB
Likes
0
Public
Click a slice to open those files.
.bin2.3 GB · 100%
From the Hugging Face model README
This is a model for textual entailment problems. 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-snli-entailment"
tokenizer = MT5Tokenizer.from_pretrained(model_name)
model = MT5ForConditionalGeneration.from_pretrained(model_name)
def run_model(premise, hypothesis, **generator_args):
input_ids = tokenizer.encode(f"{premise}<sep>{hypothesis}", 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(
"این مسابقات بین آوریل و دسامبر در هیپودروم ولیفندی در نزدیکی باکرکی ، ۱۵ کیلومتری (۹ مایل) غرب استانبول برگزار می شود.",
"در ولیفندی هیپودروم، مسابقاتی از آوریل تا دسامبر وجود دارد."
)
run_model(
"آیا کودکانی وجود دارند که نیاز به سرگرمی دارند؟",
"هیچ کودکی هرگز نمی خواهد سرگرم شود.",
)
run_model(
"ما به سفرهایی رفته ایم که در نهرهایی شنا کرده ایم",
"علاوه بر استحمام در نهرها ، ما به اسپا ها و سونا ها نیز رفته ایم."
)
For more details, visit this page: https://github.com/persiannlp/parsinlu/