Textual Entailment (مدل برای پاسخ به استلزام منطقی)
This is a model for textual entailment problems.
Here is an example of how you can run this model:
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import numpy as np
labels = ["entails", "contradicts", "neutral"]
model_name_or_path = "persiannlp/mbert-base-parsinlu-entailment"
model = AutoModelForSequenceClassification.from_pretrained(model_name_or_path)
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path,)
defmodel_predict(text_a, text_b):
features = tokenizer( [(text_a, text_b)], padding="max_length", truncation=True, return_tensors='pt')
output = model(**features)
logits = output[0]
probs = torch.nn.functional.softmax(logits, dim=1).tolist()
idx = np.argmax(np.array(probs))
print(labels[idx], probs)
model_predict(
"این مسابقات بین آوریل و دسامبر در هیپودروم ولیفندی در نزدیکی باکرکی ، ۱۵ کیلومتری (۹ مایل) غرب استانبول برگزار می شود.",
"در ولیفندی هیپودروم، مسابقاتی از آوریل تا دسامبر وجود دارد."
)
model_predict(
"آیا کودکانی وجود دارند که نیاز به سرگرمی دارند؟",
"هیچ کودکی هرگز نمی خواهد سرگرم شود.",
)
model_predict(
"ما به سفرهایی رفته ایم که در نهرهایی شنا کرده ایم",
"علاوه بر استحمام در نهرها ، ما به اسپا ها و سونا ها نیز رفته ایم."
)
mbert-base-parsinlu-entailment huggingface.co is an AI model on huggingface.co that provides mbert-base-parsinlu-entailment's model effect (), which can be used instantly with this persiannlp mbert-base-parsinlu-entailment model. huggingface.co supports a free trial of the mbert-base-parsinlu-entailment model, and also provides paid use of the mbert-base-parsinlu-entailment. Support call mbert-base-parsinlu-entailment model through api, including Node.js, Python, http.
mbert-base-parsinlu-entailment huggingface.co is an online trial and call api platform, which integrates mbert-base-parsinlu-entailment's modeling effects, including api services, and provides a free online trial of mbert-base-parsinlu-entailment, you can try mbert-base-parsinlu-entailment online for free by clicking the link below.
persiannlp mbert-base-parsinlu-entailment online free url in huggingface.co:
mbert-base-parsinlu-entailment is an open source model from GitHub that offers a free installation service, and any user can find mbert-base-parsinlu-entailment on GitHub to install. At the same time, huggingface.co provides the effect of mbert-base-parsinlu-entailment install, users can directly use mbert-base-parsinlu-entailment installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
mbert-base-parsinlu-entailment install url in huggingface.co: