Downloads · 30 days
272
3% of all-time downloads
cyberagent/xlm-roberta-large-jnli-jsick
xlm-roberta-large-jnli-jsick is a machine learning model from cyberagent. 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 sentence-transformers. The card lists the license as cc-by-4.0.
This model was trained using SentenceTransformers Cross-Encoder class, gradient accumulation PR, and the code from CyberAgentAILab/japanese-nli-model.
Downloads · 30 days
272
3% of all-time downloads
All-time downloads
9.3K
Public
Repo size
4.5 GB
Likes
7
Public
Click a slice to open those files.
.bin2.2 GB · 99%
From the Hugging Face model README
This model was trained using SentenceTransformers Cross-Encoder class, gradient accumulation PR, and the code from CyberAgentAILab/japanese-nli-model.
The model was trained on the JGLUE-JNLI and JSICK datasets. For a given sentence pair, it will output three scores corresponding to the labels: contradiction, entailment, neutral.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained('cyberagent/xlm-roberta-large-jnli-jsick')
model = AutoModelForSequenceClassification.from_pretrained('cyberagent/xlm-roberta-large-jnli-jsick')
features = tokenizer(["子供が走っている猫を見ている", "猫が走っている"], ["猫が走っている", "子供が走っている"], padding=True, truncation=True, return_tensors="pt")
model.eval()
with torch.no_grad():
scores = model(**features).logits
label_mapping = ['contradiction', 'entailment', 'neutral']
labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
print(labels)