symanto/xlm-roberta-base-snli-mnli-anli-xnli
A cross-attention NLI model trained for zero-shot and few-shot text classification. The base model is xlm-roberta-base(https://huggingface.co/xlm-roberta-base), trained with the code from here(https://github.com/facebookresearch/anli); on SNLI(https:...
Thành tựu nổi bật
Những danh hiệu mới nhất của dự án
#1 Repository Của Tuần
#1 Repository Của Tuần
#1 Repository Của Tuần
A cross-attention NLI model trained for zero-shot and few-shot text classification.
The base model is xlm-roberta-base, trained with the code from here; on SNLI, MNLI, ANLI and XNLI.
Usage:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
import numpy as np
model = AutoModelForSequenceClassification.from_pretrained("symanto/xlm-roberta-base-snli-mnli-anli-xnli")
tokenizer = AutoTokenizer.from_pretrained("symanto/xlm-roberta-base-snli-mnli-anli-xnli")
input_pairs = [
("I like this pizza.", "The sentence is positive."),
("I like this pizza.", "The sentence is negative."),
("I mag diese Pizza.", "Der Satz ist positiv."),
("I mag diese Pizza.", "Der Satz ist negativ."),
("Me gusta esta pizza.", "Esta frase es positivo."),
("Me gusta esta pizza.", "Esta frase es negativo."),
]
inputs = tokenizer(input_pairs, truncation="only_first", return_tensors="pt", padding=True)
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=1)
probs = probs[..., [0]].tolist()
print("probs", probs)
np.testing.assert_almost_equal(probs, [[0.83], [0.04], [1.00], [0.00], [1.00], [0.00]], decimal=2)
Similar Projects
Discover other similar projects and AI models.
sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic se...
Whisper Whisper is a state-of-the-art model for automatic speech recognition (ASR) and speech translation, proposed in the paper Robust Speech Recognition via Large-Scale Weak Supervision(https://huggingface.co/papers/2212.04356) by Alec Radford et...
Whisper Whisper is a state-of-the-art model for automatic speech recognition (ASR) and speech translation, proposed in the paper Robust Speech Recognition via Large-Scale Weak Supervision(https://huggingface.co/papers/2212.04356) by Alec Radford et...
XLM-RoBERTa (base-sized model) XLM-RoBERTa model pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper Unsupervised Cross-lingual Representation Learning at Scale(https://arxiv.org/abs/1911.02116)...
Multilingual-E5-large Multilingual E5 Text Embeddings: A Technical Report(https://arxiv.org/pdf/2402.05672). Liang Wang, Nan Yang, Xiaolong Huang, Linjun Yang, Rangan Majumder, Furu Wei, arXiv 2024 This model has 24 layers and the embedding size is...
Multilingual-E5-small Multilingual E5 Text Embeddings: A Technical Report(https://arxiv.org/pdf/2402.05672). Liang Wang, Nan Yang, Xiaolong Huang, Linjun Yang, Rangan Majumder, Furu Wei, arXiv 2024 This model has 12 layers and the embedding size is...
sentence-transformers/paraphrase-multilingual-mpnet-base-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic se...
Multilingual-E5-base Multilingual E5 Text Embeddings: A Technical Report(https://arxiv.org/pdf/2402.05672). Liang Wang, Nan Yang, Xiaolong Huang, Linjun Yang, Rangan Majumder, Furu Wei, arXiv 2024 This model has 12 layers and the embedding size is 7...
OmniVoice 🌍 OmniVoice is a massively multilingual zero-shot text-to-speech (TTS) model supporting over 600 languages. Built on a novel diffusion language model-style architecture, it delivers high-quality speech w...