Views
No views yet
1import mteb
2from sentence_transformers import SparseEncoder
3model = SparseEncoder(
4 "Y-Research-Group/CSRv2-classification",
5 trust_remote_code=True
6)
7model.prompts = {
8 "Banking77Classification": "Instruct: Given a online banking query, find the corresponding intents\nQuery:"
9}
10task = mteb.get_tasks(tasks=["Banking77Classification"])
11evaluation = mteb.MTEB(tasks=task)
12evaluation.run(
13 model,
14 eval_splits=["test"],
15 output_folder="./results/Banking77Classification",
16 show_progress_bar=True
17 encode_kwargs={"convert_to_sparse_tensor": False, "batch_size": 8}
18) # MTEB don't support sparse tensors yet, so we need to convert to dense tensorsk parameterin the file3_SparseAutoEncoder/config.json`.
We set sparsity level to 2 by default.3_SparseAutoEncoder/config.json should look like this:1{
2 "input_dim": 2560,
3 "hidden_dim": 10240,
4 "k": 8,
5 "k_aux": 1024,
6 "normalize": false,
7 "dead_threshold": 30
8}1@inproceedings{guo2026csrv2,
2 title={{CSR}v2: Unlocking Ultra-sparse Embeddings},
3 author={Guo, Lixuan and Wang, Yifei and Wen, Tiansheng and Wang, Yifan and Feng, Aosong and Chen, Bo and Jegelka, Stefanie and You, Chenyu},
4 booktitle={International Conference on Learning Representations (ICLR)},
5 year={2026}
6}