Text Classification
sentence-transformers
Safetensors
Transformers
English
nvembed
feature-extraction
mteb
text
text-embeddings-inference
sparse-encoder
sparse
csr
custom_code
Eval Results (legacy)
Instructions to use Y-Research-Group/CSR-NV_Embed_v2-Classification-Banking77 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Y-Research-Group/CSR-NV_Embed_v2-Classification-Banking77 with sentence-transformers:
from sentence_transformers import SparseEncoder model = SparseEncoder("Y-Research-Group/CSR-NV_Embed_v2-Classification-Banking77", trust_remote_code=True) queries = ["Which planet is known as the Red Planet?"] documents = [ "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.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Transformers
How to use Y-Research-Group/CSR-NV_Embed_v2-Classification-Banking77 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Y-Research-Group/CSR-NV_Embed_v2-Classification-Banking77", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Y-Research-Group/CSR-NV_Embed_v2-Classification-Banking77", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
datasets:
|
| 4 |
-
- mteb/
|
| 5 |
language:
|
| 6 |
- en
|
| 7 |
-
pipeline_tag: text-
|
| 8 |
library_name: sentence-transformers
|
| 9 |
tags:
|
| 10 |
- mteb
|
|
@@ -14,57 +14,33 @@ tags:
|
|
| 14 |
- sparse-encoder
|
| 15 |
- sparse
|
| 16 |
- csr
|
|
|
|
| 17 |
model-index:
|
| 18 |
-
- name:
|
| 19 |
results:
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
- type: ndcg@100
|
| 40 |
-
value: 0.81514
|
| 41 |
-
- type: ndcg@1000
|
| 42 |
-
value: 0.81692
|
| 43 |
-
- type: map@10
|
| 44 |
-
value: 0.75662
|
| 45 |
-
- type: map@100
|
| 46 |
-
value: 0.7593
|
| 47 |
-
- type: map@1000
|
| 48 |
-
value: 0.75937
|
| 49 |
-
- type: recall@10
|
| 50 |
-
value: 0.93889
|
| 51 |
-
- type: recall@100
|
| 52 |
-
value: 0.98667
|
| 53 |
-
- type: recall@1000
|
| 54 |
-
value: 1.0
|
| 55 |
-
- type: precision@1
|
| 56 |
-
value: 0.67
|
| 57 |
-
- type: precision@10
|
| 58 |
-
value: 0.106
|
| 59 |
-
- type: mrr@10
|
| 60 |
-
value: 0.76503
|
| 61 |
-
- type: main_score
|
| 62 |
-
value: 0.80426
|
| 63 |
-
task:
|
| 64 |
-
type: Retrieval
|
| 65 |
---
|
| 66 |
|
| 67 |
|
|
|
|
| 68 |
For more details, including benchmark evaluation, hardware requirements, and inference performance, please refer to our [Github](https://github.com/neilwen987/CSR_Adaptive_Rep).
|
| 69 |
|
| 70 |
|
|
@@ -77,18 +53,23 @@ We recommend using ``Transformers 4.47.0.``
|
|
| 77 |
You can evaluate this model loaded by Sentence Transformers with the following code snippet:
|
| 78 |
```python
|
| 79 |
import mteb
|
| 80 |
-
from sentence_transformers import
|
| 81 |
-
model =
|
| 82 |
-
"Y-Research-Group/CSR-NV_Embed_v2-
|
| 83 |
trust_remote_code=True
|
| 84 |
)
|
| 85 |
model.prompts = {
|
| 86 |
-
"
|
| 87 |
}
|
| 88 |
-
task = mteb.get_tasks(tasks=["
|
| 89 |
evaluation = mteb.MTEB(tasks=task)
|
| 90 |
-
evaluation.run(
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
```
|
| 93 |
|
| 94 |
## Citation
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
datasets:
|
| 4 |
+
- mteb/banking77
|
| 5 |
language:
|
| 6 |
- en
|
| 7 |
+
pipeline_tag: text-classification
|
| 8 |
library_name: sentence-transformers
|
| 9 |
tags:
|
| 10 |
- mteb
|
|
|
|
| 14 |
- sparse-encoder
|
| 15 |
- sparse
|
| 16 |
- csr
|
| 17 |
+
|
| 18 |
model-index:
|
| 19 |
+
- name: CSR
|
| 20 |
results:
|
| 21 |
+
- dataset:
|
| 22 |
+
name: MTEB Banking77Classification
|
| 23 |
+
type: mteb/banking77
|
| 24 |
+
config: default
|
| 25 |
+
revision: 0fd18e25b25c072e09e0d92ab615fda904d66300
|
| 26 |
+
split: test
|
| 27 |
+
metrics:
|
| 28 |
+
- type: accuracy
|
| 29 |
+
value: 0.899545
|
| 30 |
+
- type: f1
|
| 31 |
+
value: 0.899018
|
| 32 |
+
- type: f1_weighted
|
| 33 |
+
value: 0.899018
|
| 34 |
+
- type: main_score
|
| 35 |
+
value: 0.899545
|
| 36 |
+
task:
|
| 37 |
+
type: Classification
|
| 38 |
+
base_model:
|
| 39 |
+
- nvidia/NV-Embed-v2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
---
|
| 41 |
|
| 42 |
|
| 43 |
+
|
| 44 |
For more details, including benchmark evaluation, hardware requirements, and inference performance, please refer to our [Github](https://github.com/neilwen987/CSR_Adaptive_Rep).
|
| 45 |
|
| 46 |
|
|
|
|
| 53 |
You can evaluate this model loaded by Sentence Transformers with the following code snippet:
|
| 54 |
```python
|
| 55 |
import mteb
|
| 56 |
+
from sentence_transformers import SparseEncoder
|
| 57 |
+
model = SparseEncoder(
|
| 58 |
+
"Y-Research-Group/CSR-NV_Embed_v2-Classification-Banking77",
|
| 59 |
trust_remote_code=True
|
| 60 |
)
|
| 61 |
model.prompts = {
|
| 62 |
+
"Banking77Classification": "Instruct: Given a online banking query, find the corresponding intents\nQuery:"
|
| 63 |
}
|
| 64 |
+
task = mteb.get_tasks(tasks=["Banking77Classification"])
|
| 65 |
evaluation = mteb.MTEB(tasks=task)
|
| 66 |
+
evaluation.run(
|
| 67 |
+
model,
|
| 68 |
+
eval_splits=["test"],
|
| 69 |
+
output_folder="./results/Banking77Classification",
|
| 70 |
+
show_progress_bar=True
|
| 71 |
+
encode_kwargs={"convert_to_sparse_tensor": False, "batch_size": 8}
|
| 72 |
+
) # MTEB don't support sparse tensors yet, so we need to convert to dense tensors
|
| 73 |
```
|
| 74 |
|
| 75 |
## Citation
|