--- license: mit language: - en tags: - sparse sparsity quantized onnx embeddings int8 model-index: - name: bge-base-en-v1.5-sparse results: - task: type: Classification dataset: type: mteb/amazon_counterfactual name: MTEB AmazonCounterfactualClassification (en) config: en split: test revision: e8379541af4e31359cca9fbcf4b00f2671dba205 metrics: - type: accuracy value: 75.38805970149254 - type: ap value: 38.80643435437097 - type: f1 value: 69.52906891019036 - task: type: Classification dataset: type: mteb/amazon_polarity name: MTEB AmazonPolarityClassification config: default split: test revision: e2d317d38cd51312af73b3d32a06d1a08b442046 metrics: - type: accuracy value: 90.72759999999998 - type: ap value: 87.07910150764239 - type: f1 value: 90.71025910882096 - task: type: Classification dataset: type: mteb/amazon_reviews_multi name: MTEB AmazonReviewsClassification (en) config: en split: test revision: 1399c76144fd37290681b995c656ef9b2e06e26d metrics: - type: accuracy value: 45.494 - type: f1 value: 44.917953161904805 - task: type: Clustering dataset: type: mteb/arxiv-clustering-p2p name: MTEB ArxivClusteringP2P config: default split: test revision: a122ad7f3f0291bf49cc6f4d32aa80929df69d5d metrics: - type: v_measure value: 46.50495921726095 - task: type: Clustering dataset: type: mteb/arxiv-clustering-s2s name: MTEB ArxivClusteringS2S config: default split: test revision: f910caf1a6075f7329cdf8c1a6135696f37dbd53 metrics: - type: v_measure value: 40.080055890804836 - task: type: Reranking dataset: type: mteb/askubuntudupquestions-reranking name: MTEB AskUbuntuDupQuestions config: default split: test revision: 2000358ca161889fa9c082cb41daa8dcfb161a54 metrics: - type: map value: 60.22880715757138 - type: mrr value: 73.11227630479708 - task: type: STS dataset: type: mteb/biosses-sts name: MTEB BIOSSES config: default split: test revision: d3fb88f8f02e40887cd149695127462bbcf29b4a metrics: - type: cos_sim_pearson value: 86.9542549153515 - type: cos_sim_spearman value: 83.93865958725257 - type: euclidean_pearson value: 86.00372707912037 - type: euclidean_spearman value: 84.97302050526537 - type: manhattan_pearson value: 85.63207676453459 - type: manhattan_spearman value: 84.82542678079645 - task: type: Classification dataset: type: mteb/banking77 name: MTEB Banking77Classification config: default split: test revision: 0fd18e25b25c072e09e0d92ab615fda904d66300 metrics: - type: accuracy value: 84.29545454545455 - type: f1 value: 84.26780483160312 - task: type: Clustering dataset: type: mteb/biorxiv-clustering-p2p name: MTEB BiorxivClusteringP2P config: default split: test revision: 65b79d1d13f80053f67aca9498d9402c2d9f1f40 metrics: - type: v_measure value: 36.78678386185847 - task: type: Clustering dataset: type: mteb/biorxiv-clustering-s2s name: MTEB BiorxivClusteringS2S config: default split: test revision: 258694dd0231531bc1fd9de6ceb52a0853c6d908 metrics: - type: v_measure value: 34.42462869304013 - task: type: Classification dataset: type: mteb/emotion name: MTEB EmotionClassification config: default split: test revision: 4f58c6b202a23cf9a4da393831edf4f9183cad37 metrics: - type: accuracy value: 46.705 - type: f1 value: 41.82618717355017 - task: type: Classification dataset: type: mteb/imdb name: MTEB ImdbClassification config: default split: test revision: 3d86128a09e091d6018b6d26cad27f2739fc2db7 metrics: - type: accuracy value: 83.14760000000001 - type: ap value: 77.40813245635195 - type: f1 value: 83.08648833100911 - task: type: Classification dataset: type: mteb/mtop_domain name: MTEB MTOPDomainClassification (en) config: en split: test revision: d80d48c1eb48d3562165c59d59d0034df9fff0bf metrics: - type: accuracy value: 92.0519835841313 - type: f1 value: 91.73392170858916 - task: type: Classification dataset: type: mteb/mtop_intent name: MTEB MTOPIntentClassification (en) config: en split: test revision: ae001d0e6b1228650b7bd1c2c65fb50ad11a8aba metrics: - type: accuracy value: 72.48974008207935 - type: f1 value: 54.812872972777505 - task: type: Classification dataset: type: mteb/amazon_massive_intent name: MTEB MassiveIntentClassification (en) config: en split: test revision: 31efe3c427b0bae9c22cbb560b8f15491cc6bed7 metrics: - type: accuracy value: 73.17753866846 - type: f1 value: 71.51091282373878 - task: type: Classification dataset: type: mteb/amazon_massive_scenario name: MTEB MassiveScenarioClassification (en) config: en split: test revision: 7d571f92784cd94a019292a1f45445077d0ef634 metrics: - type: accuracy value: 77.5353059852051 - type: f1 value: 77.42427561340143 - task: type: Clustering dataset: type: mteb/medrxiv-clustering-p2p name: MTEB MedrxivClusteringP2P config: default split: test revision: e7a26af6f3ae46b30dde8737f02c07b1505bcc73 metrics: - type: v_measure value: 32.00163251745748 - task: type: Clustering dataset: type: mteb/medrxiv-clustering-s2s name: MTEB MedrxivClusteringS2S config: default split: test revision: 35191c8c0dca72d8ff3efcd72aa802307d469663 metrics: - type: v_measure value: 30.37879992380756 - task: type: Clustering dataset: type: mteb/reddit-clustering name: MTEB RedditClustering config: default split: test revision: 24640382cdbf8abc73003fb0fa6d111a705499eb metrics: - type: v_measure value: 50.99679402527969 - task: type: Clustering dataset: type: mteb/reddit-clustering-p2p name: MTEB RedditClusteringP2P config: default split: test revision: 282350215ef01743dc01b456c7f5241fa8937f16 metrics: - type: v_measure value: 59.28024721612242 - task: type: STS dataset: type: mteb/sickr-sts name: MTEB SICK-R config: default split: test revision: a6ea5a8cab320b040a23452cc28066d9beae2cee metrics: - type: cos_sim_pearson value: 84.54645068673153 - type: cos_sim_spearman value: 78.64401947043316 - type: euclidean_pearson value: 82.36873285307261 - type: euclidean_spearman value: 78.57406974337181 - type: manhattan_pearson value: 82.33000263843067 - type: manhattan_spearman value: 78.51127629983256 - task: type: STS dataset: type: mteb/sts12-sts name: MTEB STS12 config: default split: test revision: a0d554a64d88156834ff5ae9920b964011b16384 metrics: - type: cos_sim_pearson value: 83.3001843293691 - type: cos_sim_spearman value: 74.87989254109124 - type: euclidean_pearson value: 80.88523322810525 - type: euclidean_spearman value: 75.6469299496058 - type: manhattan_pearson value: 80.8921104008781 - type: manhattan_spearman value: 75.65942956132456 - task: type: STS dataset: type: mteb/sts13-sts name: MTEB STS13 config: default split: test revision: 7e90230a92c190f1bf69ae9002b8cea547a64cca metrics: - type: cos_sim_pearson value: 82.40319855455617 - type: cos_sim_spearman value: 83.63807375781141 - type: euclidean_pearson value: 83.28557187260904 - type: euclidean_spearman value: 83.65223617817439 - type: manhattan_pearson value: 83.30411918680012 - type: manhattan_spearman value: 83.69204806663276 - task: type: STS dataset: type: mteb/sts14-sts name: MTEB STS14 config: default split: test revision: 6031580fec1f6af667f0bd2da0a551cf4f0b2375 metrics: - type: cos_sim_pearson value: 83.08942420708404 - type: cos_sim_spearman value: 80.39991846857053 - type: euclidean_pearson value: 82.68275416568997 - type: euclidean_spearman value: 80.49626214786178 - type: manhattan_pearson value: 82.62993414444689 - type: manhattan_spearman value: 80.44148684748403 - task: type: STS dataset: type: mteb/sts15-sts name: MTEB STS15 config: default split: test revision: ae752c7c21bf194d8b67fd573edf7ae58183cbe3 metrics: - type: cos_sim_pearson value: 86.70365000096972 - type: cos_sim_spearman value: 88.00515486253518 - type: euclidean_pearson value: 87.65142168651604 - type: euclidean_spearman value: 88.05834854642737 - type: manhattan_pearson value: 87.59548659661925 - type: manhattan_spearman value: 88.00573237576926 - task: type: STS dataset: type: mteb/sts16-sts name: MTEB STS16 config: default split: test revision: 4d8694f8f0e0100860b497b999b3dbed754a0513 metrics: - type: cos_sim_pearson value: 82.47886818876728 - type: cos_sim_spearman value: 84.30874770680975 - type: euclidean_pearson value: 83.74580951498133 - type: euclidean_spearman value: 84.60595431454789 - type: manhattan_pearson value: 83.74122023121615 - type: manhattan_spearman value: 84.60549899361064 - task: type: STS dataset: type: mteb/sts17-crosslingual-sts name: MTEB STS17 (en-en) config: en-en split: test revision: af5e6fb845001ecf41f4c1e033ce921939a2a68d metrics: - type: cos_sim_pearson value: 87.60257252565631 - type: cos_sim_spearman value: 88.29577246271319 - type: euclidean_pearson value: 88.25434138634807 - type: euclidean_spearman value: 88.06678743723845 - type: manhattan_pearson value: 88.3651048848073 - type: manhattan_spearman value: 88.23688291108866 - task: type: STS dataset: type: mteb/sts22-crosslingual-sts name: MTEB STS22 (en) config: en split: test revision: 6d1ba47164174a496b7fa5d3569dae26a6813b80 metrics: - type: cos_sim_pearson value: 61.666254720687206 - type: cos_sim_spearman value: 63.83700525419119 - type: euclidean_pearson value: 64.36325040161177 - type: euclidean_spearman value: 63.99833771224718 - type: manhattan_pearson value: 64.01356576965371 - type: manhattan_spearman value: 63.7201674202641 - task: type: STS dataset: type: mteb/stsbenchmark-sts name: MTEB STSBenchmark config: default split: test revision: b0fddb56ed78048fa8b90373c8a3cfc37b684831 metrics: - type: cos_sim_pearson value: 85.14584232139909 - type: cos_sim_spearman value: 85.92570762612142 - type: euclidean_pearson value: 86.34291503630607 - type: euclidean_spearman value: 86.12670269109282 - type: manhattan_pearson value: 86.26109450032494 - type: manhattan_spearman value: 86.07665628498633 - task: type: Reranking dataset: type: mteb/scidocs-reranking name: MTEB SciDocsRR config: default split: test revision: d3c5e1fc0b855ab6097bf1cda04dd73947d7caab metrics: - type: map value: 84.46430478723548 - type: mrr value: 95.63907044299201 - task: type: PairClassification dataset: type: mteb/sprintduplicatequestions-pairclassification name: MTEB SprintDuplicateQuestions config: default split: test revision: d66bd1f72af766a5cc4b0ca5e00c162f89e8cc46 metrics: - type: cos_sim_accuracy value: 99.82178217821782 - type: cos_sim_ap value: 95.49612561375889 - type: cos_sim_f1 value: 91.02691924227318 - type: cos_sim_precision value: 90.75546719681908 - type: cos_sim_recall value: 91.3 - type: dot_accuracy value: 99.67821782178218 - type: dot_ap value: 90.55740832326241 - type: dot_f1 value: 83.30765279917823 - type: dot_precision value: 85.6388595564942 - type: dot_recall value: 81.10000000000001 - type: euclidean_accuracy value: 99.82475247524752 - type: euclidean_ap value: 95.4739426775874 - type: euclidean_f1 value: 91.07413010590017 - type: euclidean_precision value: 91.8616480162767 - type: euclidean_recall value: 90.3 - type: manhattan_accuracy value: 99.82376237623762 - type: manhattan_ap value: 95.48506891694475 - type: manhattan_f1 value: 91.02822580645163 - type: manhattan_precision value: 91.76829268292683 - type: manhattan_recall value: 90.3 - type: max_accuracy value: 99.82475247524752 - type: max_ap value: 95.49612561375889 - type: max_f1 value: 91.07413010590017 - task: type: Clustering dataset: type: mteb/stackexchange-clustering name: MTEB StackExchangeClustering config: default split: test revision: 6cbc1f7b2bc0622f2e39d2c77fa502909748c259 metrics: - type: v_measure value: 60.92486258951404 - task: type: Clustering dataset: type: mteb/stackexchange-clustering-p2p name: MTEB StackExchangeClusteringP2P config: default split: test revision: 815ca46b2622cec33ccafc3735d572c266efdb44 metrics: - type: v_measure value: 32.97511013092965 - task: type: Reranking dataset: type: mteb/stackoverflowdupquestions-reranking name: MTEB StackOverflowDupQuestions config: default split: test revision: e185fbe320c72810689fc5848eb6114e1ef5ec69 metrics: - type: map value: 52.31647363355174 - type: mrr value: 53.26469792462439 - task: type: Classification dataset: type: mteb/toxic_conversations_50k name: MTEB ToxicConversationsClassification config: default split: test revision: d7c0de2777da35d6aae2200a62c6e0e5af397c4c metrics: - type: accuracy value: 70.917 - type: ap value: 13.760770628090576 - type: f1 value: 54.23887489664618 - task: type: Classification dataset: type: mteb/tweet_sentiment_extraction name: MTEB TweetSentimentExtractionClassification config: default split: test revision: d604517c81ca91fe16a244d1248fc021f9ecee7a metrics: - type: accuracy value: 59.49349179400113 - type: f1 value: 59.815392064510775 - task: type: Clustering dataset: type: mteb/twentynewsgroups-clustering name: MTEB TwentyNewsgroupsClustering config: default split: test revision: 6125ec4e24fa026cec8a478383ee943acfbd5449 metrics: - type: v_measure value: 47.29662657485732 - task: type: PairClassification dataset: type: mteb/twittersemeval2015-pairclassification name: MTEB TwitterSemEval2015 config: default split: test revision: 70970daeab8776df92f5ea462b6173c0b46fd2d1 metrics: - type: cos_sim_accuracy value: 85.74834594981225 - type: cos_sim_ap value: 72.92449226447182 - type: cos_sim_f1 value: 68.14611644433363 - type: cos_sim_precision value: 64.59465847317419 - type: cos_sim_recall value: 72.1108179419525 - type: dot_accuracy value: 82.73827263515527 - type: dot_ap value: 63.27505594570806 - type: dot_f1 value: 61.717543651265 - type: dot_precision value: 56.12443292287751 - type: dot_recall value: 68.54881266490766 - type: euclidean_accuracy value: 85.90332002145796 - type: euclidean_ap value: 73.08299660990401 - type: euclidean_f1 value: 67.9050313691721 - type: euclidean_precision value: 63.6091265268495 - type: euclidean_recall value: 72.82321899736148 - type: manhattan_accuracy value: 85.87351731537224 - type: manhattan_ap value: 73.02205874497865 - type: manhattan_f1 value: 67.87532596547871 - type: manhattan_precision value: 64.109781843772 - type: manhattan_recall value: 72.1108179419525 - type: max_accuracy value: 85.90332002145796 - type: max_ap value: 73.08299660990401 - type: max_f1 value: 68.14611644433363 - task: type: PairClassification dataset: type: mteb/twitterurlcorpus-pairclassification name: MTEB TwitterURLCorpus config: default split: test revision: 8b6510b0b1fa4e4c4f879467980e9be563ec1cdf metrics: - type: cos_sim_accuracy value: 88.84231769317343 - type: cos_sim_ap value: 85.65683184516553 - type: cos_sim_f1 value: 77.60567077973222 - type: cos_sim_precision value: 75.6563071297989 - type: cos_sim_recall value: 79.65814598090545 - type: dot_accuracy value: 86.85333954282609 - type: dot_ap value: 80.79899186896125 - type: dot_f1 value: 74.15220098146928 - type: dot_precision value: 70.70819946919961 - type: dot_recall value: 77.94887588543271 - type: euclidean_accuracy value: 88.77634183257655 - type: euclidean_ap value: 85.67411484805298 - type: euclidean_f1 value: 77.61566374357423 - type: euclidean_precision value: 76.23255123255123 - type: euclidean_recall value: 79.04989220819218 - type: manhattan_accuracy value: 88.79962743043428 - type: manhattan_ap value: 85.6494795781639 - type: manhattan_f1 value: 77.54222877224805 - type: manhattan_precision value: 76.14100185528757 - type: manhattan_recall value: 78.99599630428088 - type: max_accuracy value: 88.84231769317343 - type: max_ap value: 85.67411484805298 - type: max_f1 value: 77.61566374357423 --- # bge-base-en-v1.5-sparse This is the sparsified ONNX variant of the [bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) embeddings model created with [DeepSparse Optimum](https://github.com/neuralmagic/optimum-deepsparse) for ONNX export/inference pipeline and Neural Magic's [Sparsify](https://github.com/neuralmagic/sparsify) for one-shot quantization (INT8) and unstructured pruning (50%). Current list of sparse and quantized bge ONNX models: | Links | Sparsification Method | | --------------------------------------------------------------------------------------------------- | ---------------------- | | [zeroshot/bge-large-en-v1.5-sparse](https://huggingface.co/zeroshot/bge-large-en-v1.5-sparse) | Quantization (INT8) & 50% Pruning | | [zeroshot/bge-large-en-v1.5-quant](https://huggingface.co/zeroshot/bge-large-en-v1.5-quant) | Quantization (INT8) | | [zeroshot/bge-base-en-v1.5-sparse](https://huggingface.co/zeroshot/bge-base-en-v1.5-sparse) | Quantization (INT8) & 50% Pruning | | [zeroshot/bge-base-en-v1.5-quant](https://huggingface.co/zeroshot/bge-base-en-v1.5-quant) | Quantization (INT8) | | [zeroshot/bge-small-en-v1.5-sparse](https://huggingface.co/zeroshot/bge-small-en-v1.5-sparse) | Quantization (INT8) & 50% Pruning | | [zeroshot/bge-small-en-v1.5-quant](https://huggingface.co/zeroshot/bge-small-en-v1.5-quant) | Quantization (INT8) | ```bash pip install -U deepsparse-nightly[sentence_transformers] ``` ```python from deepsparse.sentence_transformers import SentenceTransformer model = SentenceTransformer('zeroshot/bge-base-en-v1.5-sparse', export=False) # Our sentences we like to encode sentences = ['This framework generates embeddings for each input sentence', 'Sentences are passed as a list of string.', 'The quick brown fox jumps over the lazy dog.'] # Sentences are encoded by calling model.encode() embeddings = model.encode(sentences) # Print the embeddings for sentence, embedding in zip(sentences, embeddings): print("Sentence:", sentence) print("Embedding:", embedding.shape) print("") ``` For further details regarding DeepSparse & Sentence Transformers integration, refer to the [DeepSparse README](https://github.com/neuralmagic/deepsparse/tree/main/src/deepsparse/sentence_transformers). For general questions on these models and sparsification methods, reach out to the engineering team on our [community Slack](https://join.slack.com/t/discuss-neuralmagic/shared_invite/zt-q1a1cnvo-YBoICSIw3L1dmQpjBeDurQ). ![;)](https://media.giphy.com/media/bYg33GbNbNIVzSrr84/giphy-downsized-large.gif)