Text Classification
sentence-transformers
Safetensors
Transformers
English
mobilebert
natural-language-inference
nlp
model-card
Instructions to use agentlans/mobilebert-uncased-nli with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use agentlans/mobilebert-uncased-nli with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("agentlans/mobilebert-uncased-nli") 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] - Transformers
How to use agentlans/mobilebert-uncased-nli with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="agentlans/mobilebert-uncased-nli")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("agentlans/mobilebert-uncased-nli") model = AutoModelForSequenceClassification.from_pretrained("agentlans/mobilebert-uncased-nli", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -90,7 +90,6 @@ scores = model.predict(
|
|
| 90 |
label_mapping = ["entailment", "neutral", "contradiction"]
|
| 91 |
labels = [label_mapping[score_max] for score_max in scores.argmax(axis=1)]
|
| 92 |
print(labels)
|
| 93 |
-
# Output: ['entailment', 'contradiction']
|
| 94 |
```
|
| 95 |
|
| 96 |
## Using Transformers Library
|
|
@@ -119,7 +118,6 @@ with torch.no_grad():
|
|
| 119 |
label_mapping = ["entailment", "neutral", "contradiction"]
|
| 120 |
labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
|
| 121 |
print(labels)
|
| 122 |
-
# Output: ['entailment', 'contradiction']
|
| 123 |
```
|
| 124 |
|
| 125 |
## Limitations and Ethical Considerations
|
|
|
|
| 90 |
label_mapping = ["entailment", "neutral", "contradiction"]
|
| 91 |
labels = [label_mapping[score_max] for score_max in scores.argmax(axis=1)]
|
| 92 |
print(labels)
|
|
|
|
| 93 |
```
|
| 94 |
|
| 95 |
## Using Transformers Library
|
|
|
|
| 118 |
label_mapping = ["entailment", "neutral", "contradiction"]
|
| 119 |
labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
|
| 120 |
print(labels)
|
|
|
|
| 121 |
```
|
| 122 |
|
| 123 |
## Limitations and Ethical Considerations
|