MoritzLaurer / MiniLM-L6-mnli

huggingface.co
Total runs: 151
24-hour runs: 0
7-day runs: 53
30-day runs: 19
Model's Last Updated: December 13 2021
text-classification

Introduction of MiniLM-L6-mnli

Model Details of MiniLM-L6-mnli

MiniLM-L6-mnli

Model description

This model was trained on the MultiNLI dataset. The base model is MiniLM-L6 from Microsoft, which is very fast, but a bit less accurate than other models.

Intended uses & limitations
How to use the model
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model_name = "MoritzLaurer/MiniLM-L6-mnli"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

premise = "I liked the movie"
hypothesis = "The movie was good."

input = tokenizer(premise, hypothesis, truncation=True, return_tensors="pt")
output = model(input["input_ids"].to(device))  # device = "cuda:0" or "cpu"
prediction = torch.softmax(output["logits"][0], -1).tolist()
label_names = ["entailment", "neutral", "contradiction"]
prediction = {name: round(float(pred) * 100, 1) for pred, name in zip(prediction, label_names)}
print(prediction)
Training data

MultiNLI .

Training procedure

MiniLM-L6-mnli-binary was trained using the Hugging Face trainer with the following hyperparameters.

training_args = TrainingArguments(
    num_train_epochs=5,              # total number of training epochs
    learning_rate=2e-05,
    per_device_train_batch_size=32,   # batch size per device during training
    per_device_eval_batch_size=32,    # batch size for evaluation
    warmup_ratio=0.1,                # number of warmup steps for learning rate scheduler
    weight_decay=0.06,               # strength of weight decay
    fp16=True                        # mixed precision training
)
Eval results

The model was evaluated using the (matched) test set from MultiNLI. Accuracy: 0.814

Limitations and bias

Please consult the original MiniLM paper and literature on different NLI datasets for potential biases.

BibTeX entry and citation info

If you want to cite this model, please cite the original MiniLM paper, the respective NLI datasets and include a link to this model on the Hugging Face hub.

Runs of MoritzLaurer MiniLM-L6-mnli on huggingface.co

151
Total runs
0
24-hour runs
8
3-day runs
53
7-day runs
19
30-day runs

More Information About MiniLM-L6-mnli huggingface.co Model

MiniLM-L6-mnli huggingface.co

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

MoritzLaurer MiniLM-L6-mnli online free

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

MoritzLaurer MiniLM-L6-mnli online free url in huggingface.co:

https://huggingface.co/MoritzLaurer/MiniLM-L6-mnli

MiniLM-L6-mnli install

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

MiniLM-L6-mnli install url in huggingface.co:

https://huggingface.co/MoritzLaurer/MiniLM-L6-mnli

Url of MiniLM-L6-mnli

Provider of MiniLM-L6-mnli huggingface.co

MoritzLaurer
ORGANIZATIONS

Other API from MoritzLaurer