Text Classification
sentence-transformers
Safetensors
Transformers
English
bert
natural-language-inference
nlp
model-card
text-embeddings-inference
Instructions to use agentlans/e5-small-v2-nli with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use agentlans/e5-small-v2-nli with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("agentlans/e5-small-v2-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/e5-small-v2-nli with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="agentlans/e5-small-v2-nli")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("agentlans/e5-small-v2-nli") model = AutoModelForSequenceClassification.from_pretrained("agentlans/e5-small-v2-nli", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -75,7 +75,7 @@ To ensure reproducibility:
|
|
| 75 |
```python
|
| 76 |
from sentence_transformers import CrossEncoder
|
| 77 |
|
| 78 |
-
model_name = "e5-small-v2-nli"
|
| 79 |
model = CrossEncoder(model_name)
|
| 80 |
scores = model.predict(
|
| 81 |
[
|
|
@@ -98,7 +98,7 @@ print(labels)
|
|
| 98 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 99 |
import torch
|
| 100 |
|
| 101 |
-
model_name = "e5-small-v2-nli"
|
| 102 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 103 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 104 |
|
|
|
|
| 75 |
```python
|
| 76 |
from sentence_transformers import CrossEncoder
|
| 77 |
|
| 78 |
+
model_name = "agentlans/e5-small-v2-nli"
|
| 79 |
model = CrossEncoder(model_name)
|
| 80 |
scores = model.predict(
|
| 81 |
[
|
|
|
|
| 98 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 99 |
import torch
|
| 100 |
|
| 101 |
+
model_name = "agentlans/e5-small-v2-nli"
|
| 102 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 103 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 104 |
|