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 CrossEncoder model = CrossEncoder("agentlans/e5-small-v2-nli") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - 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")# pip install -U transformers accelerate # 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
Download config.json from agentlans/e5-small-v2-nli: direct link, hf CLI and curl.
- Browser
- Download file 849 Bytes
-
https://huggingface.co/agentlans/e5-small-v2-nli/resolve/main/config.json
- Command line
-
hf download hf://agentlans/e5-small-v2-nli/config.json
-
curl -L -o config.json https://huggingface.co/agentlans/e5-small-v2-nli/resolve/main/config.json
849 Bytes
| { | |
| "_name_or_path": "intfloat/e5-small-v2", | |
| "architectures": [ | |
| "BertForSequenceClassification" | |
| ], | |
| "attention_probs_dropout_prob": 0.1, | |
| "classifier_dropout": null, | |
| "hidden_act": "gelu", | |
| "hidden_dropout_prob": 0.1, | |
| "hidden_size": 384, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1", | |
| "2": "LABEL_2" | |
| }, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 1536, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1, | |
| "LABEL_2": 2 | |
| }, | |
| "layer_norm_eps": 1e-12, | |
| "max_position_embeddings": 512, | |
| "model_type": "bert", | |
| "num_attention_heads": 12, | |
| "num_hidden_layers": 12, | |
| "pad_token_id": 0, | |
| "position_embedding_type": "absolute", | |
| "problem_type": "single_label_classification", | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.44.2", | |
| "type_vocab_size": 2, | |
| "use_cache": true, | |
| "vocab_size": 30522 | |
| } | |