This is a part of the MTEB test.
# !pip install tensorflow_text
import tensorflow_hub as hub
from tensorflow_text import SentencepieceTokenizer
import tensorflow as tf
embedder=hub.load("https://tfhub.dev/google/universal-sentence-encoder-multilingual-large/3")
class USE():
def encode(self, sentences, batch_size=32, **kwargs):
embeddings = []
for i in range(0, len(sentences), batch_size):
batch_sentences = sentences[i:i+batch_size]
batch_embeddings = embedder(batch_sentences)
embeddings.extend(batch_embeddings)
return embeddings
model = USE()
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API:
The model has no library tag.
Spaces using vprelovac/universal-sentence-encoder-4 2
Evaluation results
- accuracy on MTEB AmazonCounterfactualClassification (en)test set self-reported70.672
- ap on MTEB AmazonCounterfactualClassification (en)test set self-reported32.835
- f1 on MTEB AmazonCounterfactualClassification (en)test set self-reported64.427
- accuracy on MTEB AmazonPolarityClassificationtest set self-reported67.732
- ap on MTEB AmazonPolarityClassificationtest set self-reported62.475
- f1 on MTEB AmazonPolarityClassificationtest set self-reported67.486
- accuracy on MTEB AmazonReviewsClassification (en)test set self-reported32.620
- f1 on MTEB AmazonReviewsClassification (en)test set self-reported32.135
- v_measure on MTEB ArxivClusteringP2Ptest set self-reported35.126
- v_measure on MTEB ArxivClusteringS2Stest set self-reported23.457