Instructions to use cyberagent/xlm-roberta-large-jnli-jsick with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use cyberagent/xlm-roberta-large-jnli-jsick with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("cyberagent/xlm-roberta-large-jnli-jsick") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Japanese Natural Language Inference Model
This model was trained using SentenceTransformers Cross-Encoder class, gradient accumulation PR, and the code from CyberAgentAILab/japanese-nli-model.
Training Data
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.
Usage
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)
- Downloads last month
- 147
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support