usc-isi / sbert-roberta-large-anli-mnli-snli

huggingface.co
Total runs: 94
24-hour runs: 0
7-day runs: 1
30-day runs: -6
Model's Last Updated: December 06 2021
sentence-similarity

Introduction of sbert-roberta-large-anli-mnli-snli

Model Details of sbert-roberta-large-anli-mnli-snli

sbert-roberta-large-anli-mnli-snli

This is a sentence-transformers model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.

The model is weight initialized by RoBERTa-large and trained on ANLI (Nie et al., 2020), MNLI (Williams et al., 2018), and SNLI (Bowman et al., 2015) using the training_nli.py example script.

Training Details:

Usage (Sentence-Transformers)

Using this model becomes easy when you have sentence-transformers installed:

pip install -U sentence-transformers

Then you can use the model like this:

from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]

model = SentenceTransformer("usc-isi/sbert-roberta-large-anli-mnli-snli")
embeddings = model.encode(sentences)
print(embeddings)
Usage (Hugging Face Transformers)

Without sentence-transformers , you can use the model like this: first, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.

import torch
from transformers import AutoModel, AutoTokenizer


# Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0]  # First element of model_output contains all token embeddings
    input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)


# Sentences we want sentence embeddings for
sentences = ["This is an example sentence", "Each sentence is converted"]

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained("usc-isi/sbert-roberta-large-anli-mnli-snli")
model = AutoModel.from_pretrained("usc-isi/sbert-roberta-large-anli-mnli-snli")

# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors="pt")

# Compute token embeddings
with torch.no_grad():
    model_output = model(**encoded_input)

# Perform pooling. In this case, max pooling.
sentence_embeddings = mean_pooling(model_output, encoded_input["attention_mask"])

print("Sentence embeddings:")
print(sentence_embeddings)
Evaluation Results

See section 4.1 of our paper for evaluation results.

Full Model Architecture
SentenceTransformer(
  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: RobertaModel
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
)
Citing & Authors

For more information about the project, see our paper:

Ciosici, Manuel, et al. "Machine-Assisted Script Curation." Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Demonstrations , Association for Computational Linguistics, 2021, pp. 8–17. ACLWeb , https://www.aclweb.org/anthology/2021.naacl-demos.2 .

References

Runs of usc-isi sbert-roberta-large-anli-mnli-snli on huggingface.co

94
Total runs
0
24-hour runs
1
3-day runs
1
7-day runs
-6
30-day runs

More Information About sbert-roberta-large-anli-mnli-snli huggingface.co Model

sbert-roberta-large-anli-mnli-snli huggingface.co

sbert-roberta-large-anli-mnli-snli huggingface.co is an AI model on huggingface.co that provides sbert-roberta-large-anli-mnli-snli's model effect (), which can be used instantly with this usc-isi sbert-roberta-large-anli-mnli-snli model. huggingface.co supports a free trial of the sbert-roberta-large-anli-mnli-snli model, and also provides paid use of the sbert-roberta-large-anli-mnli-snli. Support call sbert-roberta-large-anli-mnli-snli model through api, including Node.js, Python, http.

sbert-roberta-large-anli-mnli-snli huggingface.co Url

https://huggingface.co/usc-isi/sbert-roberta-large-anli-mnli-snli

usc-isi sbert-roberta-large-anli-mnli-snli online free

sbert-roberta-large-anli-mnli-snli huggingface.co is an online trial and call api platform, which integrates sbert-roberta-large-anli-mnli-snli's modeling effects, including api services, and provides a free online trial of sbert-roberta-large-anli-mnli-snli, you can try sbert-roberta-large-anli-mnli-snli online for free by clicking the link below.

usc-isi sbert-roberta-large-anli-mnli-snli online free url in huggingface.co:

https://huggingface.co/usc-isi/sbert-roberta-large-anli-mnli-snli

sbert-roberta-large-anli-mnli-snli install

sbert-roberta-large-anli-mnli-snli is an open source model from GitHub that offers a free installation service, and any user can find sbert-roberta-large-anli-mnli-snli on GitHub to install. At the same time, huggingface.co provides the effect of sbert-roberta-large-anli-mnli-snli install, users can directly use sbert-roberta-large-anli-mnli-snli installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

sbert-roberta-large-anli-mnli-snli install url in huggingface.co:

https://huggingface.co/usc-isi/sbert-roberta-large-anli-mnli-snli

Url of sbert-roberta-large-anli-mnli-snli

sbert-roberta-large-anli-mnli-snli huggingface.co Url

Provider of sbert-roberta-large-anli-mnli-snli huggingface.co

usc-isi
ORGANIZATIONS

Other API from usc-isi