Skip to content

Repository files navigation

Massive Text Embedding Benchmark

GitHub releaseGitHub releaseBuildLicenseDownloads

Installation

pip install mteb

Usage

frommtebimportMTEBfromsentence_transformersimportSentenceTransformer# Define the sentence-transformers model namemodel_name="average_word_embeddings_komninos"model=SentenceTransformer(model_name)
evaluation=MTEB(tasks=["Banking77Classification"])
results=evaluation.run(model, output_folder=f"results/{model_name}")
  • Using CLI
mteb --available_tasks
mteb -m average_word_embeddings_komninos \
-t Banking77Classification \
--output_folder results/average_word_embeddings_komninos \
--verbosity 3
  • Using multiple GPUs in parallel can be done by just having a custom encode function that distributes the inputs to multiple GPUs like e.g. here. For retrieval tasks you can also use the below (see scripts/retrieval.slurm for multi-node slurm script example):
pipinstallgit+https://github.com/NouamaneTazi/beir@nouamane/better-multi-gpu# Run on 2 gpustorchrun--nproc_per_node=2scripts/retrieval_multigpu.py

Advanced usage

Dataset selection

Datasets can be selected by providing the list of datasets, but also

  • by their task (e.g. "Clustering" or "Classification")
evaluation=MTEB(task_types=['Clustering', 'Retrieval']) # Only select clustering and retrieval tasks
  • by their categories e.g. "S2S" (sentence to sentence) or "P2P" (paragraph to paragraph)
evaluation=MTEB(task_categories=['S2S']) # Only select sentence2sentence datasets
  • by their languages
evaluation=MTEB(task_langs=["en", "de"]) # Only select datasets which are "en", "de" or "en-de"

You can also specify which languages to load for multilingual/crosslingual tasks like below:

frommteb.tasksimportAmazonReviewsClassification, BUCCBitextMiningevaluation=MTEB(tasks=[
AmazonReviewsClassification(langs=["en", "fr"]) # Only load "en" and "fr" subsets of Amazon ReviewsBUCCBitextMining(langs=["de-en"]), # Only load "de-en" subset of BUCC
])

Evaluation split

You can evaluate only on test splits of all tasks by doing the following:

evaluation.run(model, eval_splits=["test"])

Note that the public leaderboard uses the test splits for all datasets except MSMARCO, where the "dev" split is used.

Using a custom model

Models should implement the following interface, implementing an encode function taking as inputs a list of sentences, and returning a list of embeddings (embeddings can be np.array, torch.tensor, etc.). For inspiration, you can look at the mteb/mtebscripts repo used for running diverse models via SLURM scripts for the paper.

classMyModel():
defencode(self, sentences, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: sentences (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passmodel=MyModel()
evaluation=MTEB(tasks=["Banking77Classification"])
evaluation.run(model)

If you'd like to use different encoding functions for query and corpus when evaluating on Retrieval or Reranking tasks, you can add separate methods for encode_queries and encode_corpus. If these methods exist, they will be automatically used for those tasks. You can refer to the DRESModel at mteb/mteb/abstasks/AbsTaskRetrieval.py for an example of these functions.

classMyModel():
defencode_queries(self, queries, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: queries (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passdefencode_corpus(self, corpus, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: corpus (`List[str]` or `List[Dict[str, str]]`): List of sentences to encode or list of dictionaries with keys "title" and "text" batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """pass

Evaluating on a custom task

To add a new task, you need to implement a new class that inherits from the AbsTask associated with the task type (e.g. AbsTaskReranking for reranking tasks). You can find the supported task types in here.

frommtebimportMTEBfrommteb.abstasks.AbsTaskRerankingimportAbsTaskRerankingfromsentence_transformersimportSentenceTransformerclassMindSmallReranking(AbsTaskReranking):
@propertydefdescription(self):
return {
"name": "MindSmallReranking",
"hf_hub_name": "mteb/mind_small",
"description": "Microsoft News Dataset: A Large-Scale English Dataset for News Recommendation Research",
"reference": "https://www.microsoft.com/en-us/research/uploads/prod/2019/03/nl4se18LinkSO.pdf",
"type": "Reranking",
"category": "s2s",
"eval_splits": ["validation"],
"eval_langs": ["en"],
"main_score": "map",
}
model=SentenceTransformer("average_word_embeddings_komninos")
evaluation=MTEB(tasks=[MindSmallReranking()])
evaluation.run(model)

Note: for multilingual tasks, make sure your class also inherits from the MultilingualTask class like in this example.

Leaderboard

The MTEB Leaderboard is available here. To submit:

  1. Run on MTEB: You can reference scripts/run_mteb_english.py for all MTEB English datasets used in the main ranking, or scripts/run_mteb_chinese.py for the Chinese ones. Advanced scripts with different models are available in the mteb/mtebscripts repo.
  2. Format the json files into metadata using the script at scripts/mteb_meta.py. For example python scripts/mteb_meta.py path_to_results_folder, which will create a mteb_metadata.md file. If you ran CQADupstack retrieval, make sure to merge the results first with python scripts/merge_cqadupstack.py path_to_results_folder.
  3. Copy the content of the mteb_metadata.md file to the top of a README.md file of your model on the Hub. See here for an example.
  4. Hit the Refresh button at the bottom of the leaderboard and you should see your scores 🥇
  5. To have the scores appear without refreshing, you can open an issue on the Community Tab of the LB and someone will restart the space to cache your average scores. The cache is updated anyways ~1x/week.

Available tasks

NameHub URLDescriptionTypeCategory#LanguagesTrain #SamplesDev #SamplesTest #SamplesAvg. chars / trainAvg. chars / devAvg. chars / test
BUCCmteb/bucc-bitext-miningBUCC bitext mining datasetBitextMinings2s40064168400101.3
Tatoebamteb/tatoeba-bitext-mining1,000 English-aligned sentence pairs for each language based on the Tatoeba corpusBitextMinings2s1120020000039.4
Bornholm parallelstrombergnlp/bornholmsk_parallelDanish Bornholmsk Parallel Corpus.BitextMinings2s210010010064.686.289.7
AmazonCounterfactualClassificationmteb/amazon_counterfactualA collection of Amazon customer reviews annotated for counterfactual detection pair classification.Classifications2s44018335670107.3109.2106.1
AmazonPolarityClassificationmteb/amazon_polarityAmazon Polarity Classification Dataset.Classifications2s136000000400000431.60431.4
AmazonReviewsClassificationmteb/amazon_reviews_multiA collection of Amazon reviews specifically designed to aid research in multilingual text classification.Classifications2s612000003000030000160.5159.2160.4
Banking77Classificationmteb/banking77Dataset composed of online banking queries annotated with their corresponding intents.Classifications2s1100030308059.5054.2
EmotionClassificationmteb/emotionEmotion is a dataset of English Twitter messages with six basic emotions: anger, fear, joy, love, sadness, and surprise. For more detailed information please refer to the paper.Classifications2s1160002000200096.895.396.6
ImdbClassificationmteb/imdbLarge Movie Review DatasetClassificationp2p1250000250001325.101293.8
MassiveIntentClassificationmteb/amazon_massive_intentMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MassiveScenarioClassificationmteb/amazon_massive_scenarioMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MTOPDomainClassificationmteb/mtop_domainMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
MTOPIntentClassificationmteb/mtop_intentMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
ToxicConversationsClassificationmteb/toxic_conversations_50kCollection of comments from the Civil Comments platform together with annotations if the comment is toxic or not.Classifications2s150000050000298.80296.6
TweetSentimentExtractionClassificationmteb/tweet_sentiment_extractionClassifications2s1274810353468.3067.8
AngryTweetsClassificationmteb/DDSC/angry-tweetsA sentiment dataset with 3 classes (positiv, negativ, neutral) for Danish tweetsClassifications2s1241001050153.00156.1
DKHateClassificationDDSC/dkhateDanish Tweets annotated for Hate SpeechClassifications2s12960032988.20104.0
DalajClassificationAI-Sweden/SuperLimA Swedish dataset for linguistic accebtablity. Available as a part of SuperlimClassifications2s13840445444243.7242.5243.8
DanishPoliticalCommentsClassificationdanish_political_commentsA dataset of Danish political comments rated for sentimentClassifications2s190100069.900
LccClassificationDDSC/lccThe leipzig corpora collection, annotated for sentimentClassifications2s13490150113.50118.7
NoRecClassificationScandEval/norec-miniA Norwegian dataset for sentiment classification on reviewClassifications2s11020256205086.989.682.0
NordicLangClassificationstrombergnlp/nordic_langidA dataset for Nordic language identification.Classifications2s6570000300078.4078.2
NorwegianParliamentClassificationNbAiLab/norwegian_parliamentNorwegian parliament speeches annotated for sentimentClassifications2s13600120012001773.61911.01884.0
ScalaDaClassificationScandEval/scala-daA modified version of DDT modified for linguistic acceptability classificationClassifications2s110242562048107.6100.8109.4
ScalaNbClassificationScandEval/scala-nbA Norwegian dataset for linguistic acceptability classification for BokmålClassifications2s11024256204895.594.898.4
ScalaNnClassificationScandEval/scala-nnA Norwegian dataset for linguistic acceptability classification for NynorskClassifications2s110242562048105.3103.5104.8
ScalaSvClassificationScandEval/scala-svA Swedish dataset for linguistic acceptability classificationClassifications2s110242562048102.6113.098.3
SweRecClassificitionScandEval/swerec-miniA Swedish dataset for sentiment classification on reviewsClassifications2s110242562048317.7293.4318.8
CBDPL-MTEB/cbdPolish Tweets annotated for cyberbullying detection.Classifications2s1100410100093.6093.2
PolEmo2.0-INPL-MTEB/polemo2_inA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-IN task is to predict the sentiment of in-domain (medicine and hotels) reviews.Classifications2s15783723722780.6769.4756.2
PolEmo2.0-OUTPL-MTEB/polemo2_outA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-OUT task is to predict the sentiment of out-of-domain (products and school) reviews using models train on reviews from medicine and hotels domains.Classifications2s15783494494780.6589.3587.0
AllegroReviewsPL-MTEB/allegro-reviewsA Polish dataset for sentiment classification on reviews from e-commerce marketplace Allegro.Classifications2s1957710021006477.9480.9477.2
PAClaugustyniak/abusive-clauses-plPolish Abusive Clauses DatasetClassifications2s1428415193453185.3256.8185.3
ArxivClusteringP2Pmteb/arxiv-clustering-p2pClustering of titles+abstract from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusteringp2p100732723001009.9
ArxivClusteringS2Smteb/arxiv-clustering-s2sClustering of titles from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusterings2s1007327230074.0
BiorxivClusteringP2Pmteb/biorxiv-clustering-p2pClustering of titles+abstract from biorxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10075000001666.2
BiorxivClusteringS2Smteb/biorxiv-clustering-s2sClustering of titles from biorxiv. Clustering of 10 sets, based on the main category.Clusterings2s1007500000101.6
BlurbsClusteringP2Pslvnwhrl/blurbs-clustering-p2pClustering of book titles+blurbs. Clustering of 28 sets, either on the main or secondary genreClusteringp2p10017463700664.09
BlurbsClusteringS2Sslvnwhrl/blurbs-clustering-s2sClustering of book titles. Clustering of 28 sets, either on the main or secondary genre.Clusterings2s1001746370023.02
MedrxivClusteringP2Pmteb/medrxiv-clustering-p2pClustering of titles+abstract from medrxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10037500001981.2
MedrxivClusteringS2Smteb/medrxiv-clustering-s2sClustering of titles from medrxiv. Clustering of 10 sets, based on the main category.Clusterings2s1003750000114.7
RedditClusteringmteb/reddit-clusteringClustering of titles from 199 subreddits. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s1004204640064.7
RedditClusteringP2Pmteb/reddit-clustering-p2pClustering of title+posts from reddit. Clustering of 10 sets of 50k paragraphs and 40 sets of 10k paragraphs.Clusteringp2p10045939900727.7
StackExchangeClusteringmteb/stackexchange-clusteringClustering of titles from 121 stackexchanges. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s10417060373850056.857.0
StackExchangeClusteringP2Pmteb/stackexchange-clustering-p2pClustering of title+body from stackexchange. Clustering of 5 sets of 10k paragraphs and 5 sets of 5k paragraphs.Clusteringp2p10075000001090.7
TenKGnadClusteringP2Pslvnwhrl/tenkgnad-clustering-p2pClustering of news article titles+subheadings+texts. Clustering of 10 splits on the news article category.Clusteringp2p10045914002641.03
TenKGnadClusteringS2Sslvnwhrl/tenkgnad-clustering-s2sClustering of news article titles. Clustering of 10 splits on the news article category.Clusterings2s100459140050.96
TwentyNewsgroupsClusteringmteb/twentynewsgroups-clusteringClustering of the 20 Newsgroups dataset (subject only).Clusterings2s100595450032.0
8TagsClusteringPL-MTEB/8tags-clusteringClustering of headlines from social media posts in Polish belonging to 8 categories: film, history, food, medicine, motorization, work, sport and technology.Clusterings2s1400015000437278.277.679.2
SprintDuplicateQuestionsmteb/sprintduplicatequestions-pairclassificationDuplicate questions from the Sprint community.PairClassifications2s10101000101000065.267.9
TwitterSemEval2015mteb/twittersemeval2015-pairclassificationParaphrase-Pairs of Tweets from the SemEval 2015 workshop.PairClassifications2s100167770038.3
TwitterURLCorpusmteb/twitterurlcorpus-pairclassificationParaphrase-Pairs of Tweets.PairClassifications2s100515340079.5
PPCPL-MTEB/ppc-pairclassificationPolish Paraphrase CorpusPairClassifications2s150001000100041.041.040.2
PSCPL-MTEB/psc-pairclassificationPolish Summaries CorpusPairClassifications2s1430201078537.10549.3
SICK-E-PLPL-MTEB/sicke-pl-pairclassificationPolish version of SICK dataset for textual entailment.PairClassifications2s14439495490643.444.743.2
CDSC-EPL-MTEB/cdsce-pairclassificationCompositional Distributional Semantics Corpus for textual entailment.PairClassifications2s180001000100071.973.575.2
AskUbuntuDupQuestionsmteb/askubuntudupquestions-rerankingAskUbuntu Question Dataset - Questions from AskUbuntu with manual annotations marking pairs of questions as similar or non-similarRerankings2s10022550052.5
MindSmallRerankingmteb/mind_smallMicrosoft News Dataset: A Large-Scale English Dataset for News Recommendation ResearchRerankings2s1231530010796869.0070.9
SciDocsRRmteb/scidocs-rerankingRanking of related scientific papers based on their title.Rerankings2s101959419599069.469.0
StackOverflowDupQuestionsmteb/stackoverflowdupquestions-rerankingStack Overflow Duplicate Questions Task for questions with the tags Java, JavaScript and PythonRerankings2s1230180346749.6049.8
ArguAnaBeIR/arguanaNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
ClimateFEVERBeIR/climate-feverCLIMATE-FEVER is a dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change.Retrievals2p100541812800539.1
CQADupstackAndroidRetrievalBeIR/cqadupstack/androidCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1002369700578.7
CQADupstackEnglishRetrievalBeIR/cqadupstack/englishCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004179100467.1
CQADupstackGamingRetrievalBeIR/cqadupstack/gamingCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004689600474.7
CQADupstackGisRetrievalBeIR/cqadupstack/gisCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003852200991.1
CQADupstackMathematicaRetrievalBeIR/cqadupstack/mathematicaCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10017509001103.7
CQADupstackPhysicsRetrievalBeIR/cqadupstack/physicsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003935500799.4
CQADupstackProgrammersRetrievalBeIR/cqadupstack/programmersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10033052001030.2
CQADupstackStatsRetrievalBeIR/cqadupstack/statsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10042921001041.0
CQADupstackTexRetrievalBeIR/cqadupstack/texCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10071090001246.9
CQADupstackUnixRetrievalBeIR/cqadupstack/unixCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004845400984.7
CQADupstackWebmastersRetrievalBeIR/cqadupstack/webmastersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1001791100689.8
CQADupstackWordpressRetrievalBeIR/cqadupstack/wordpressCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10049146001111.9
DBPediaBeIR/dbpedia-entityDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FEVERBeIR/feverFEVER (Fact Extraction and VERification) consists of 185,445 claims generated by altering sentences extracted from Wikipedia and subsequently verified without knowledge of the sentence they were derived from.Retrievals2p100542323400538.6
FiQA2018BeIR/fiqaFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQABeIR/hotpotqaHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCOBeIR/msmarcoMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
MSMARCOv2BeIR/msmarco-v2MS MARCO is a collection of datasets focused on deep learning in searchRetrievals2p11386413421383681010341.4342.00
NFCorpusBeIR/nfcorpusNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQBeIR/nqNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p100268492000492.7
QuoraRetrievalBeIR/quoraQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCSBeIR/scidocsSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFactBeIR/scifactSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
Touche2020BeIR/webis-touche2020Touché Task 1: Argument Retrieval for Controversial QuestionsRetrievals2p100382594001720.1
TRECCOVIDBeIR/trec-covidTRECCOVID is an ad-hoc search challenge based on the CORD-19 dataset containing scientific articles related to the COVID-19 pandemicRetrievals2p100171382001117.4
ArguAna-PLBeIR-PL/arguana-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
DBPedia-PLBeIR-PL/dbpedia-plDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FiQA-PLBeIR-PL/fiqa-plFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQA-PLBeIR-PL/hotpotqa-plHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCO-PLBeIR-PL/msmarco-plMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
NFCorpus-PLBeIR-PL/nfcorpus-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQ-PLBeIR-PL/nq-plNatural Questions: A Benchmark for Question Answering ResearchRetrievals2p100268492000492.7
Quora-PLBeIR-PL/quora-plQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCS-PLBeIR-PL/scidocs-plSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFact-PLBeIR-PL/scifact-plSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
SweFAQAI-Sweden/SuperLimFrequently asked questions from Swedish authorities' websitesRetrievals2p10051300390.57
BIOSSESmteb/biosses-stsBiomedical Semantic Similarity Estimation.STSs2s10020000156.6
SICK-Rmteb/sickr-stsSemantic Textual Similarity SICK-R dataset as described here:STSs2s100198540046.1
STS12mteb/sts12-stsSemEval STS 2012 dataset.STSs2s1446806216100.7064.7
STS13mteb/sts13-stsSemEval STS 2013 dataset.STSs2s10030000054.0
STS14mteb/sts14-stsSemEval STS 2014 dataset. Currently only the English datasetSTSs2s10075000054.3
STS15mteb/sts15-stsSemEval STS 2015 datasetSTSs2s10060000057.7
STS16mteb/sts16-stsSemEval STS 2016 datasetSTSs2s10023720065.3
STS17mteb/sts17-crosslingual-stsSTS 2017 datasetSTSs2s11005000043.3
STS22mteb/sts22-crosslingual-stsSemEval 2022 Task 8: Multilingual News Article SimilaritySTSs2s18008060001992.8
STSBenchmarkmteb/stsbenchmark-stsSemantic Textual Similarity Benchmark (STSbenchmark) dataset.STSs2s1114983000275857.664.053.6
SICK-R-PLPL-MTEB/sickr-pl-stsPolish version of SICK dataset for textual relatedness.STSs2s18878990981242.944.042.8
CDSC-RPL-MTEB/cdscr-stsCompositional Distributional Semantics Corpus for textual relatedness.STSs2s1160002000200072.173.275.0
SummEvalmteb/summevalNews Article Summary Semantic Similarity Estimation.Summarizations2s100280000359.8

For Chinese tasks, you can refer to C_MTEB.

Citation

If you find MTEB useful, feel free to cite our publication MTEB: Massive Text Embedding Benchmark:

@article{muennighoff2022mteb,
doi = {10.48550/ARXIV.2210.07316},
url = {https://arxiv.org/abs/2210.07316},
author = {Muennighoff, Niklas and Tazi, Nouamane and Magne, Lo{\"\i}c and Reimers, Nils},
title = {MTEB: Massive Text Embedding Benchmark},
publisher = {arXiv},
journal={arXiv preprint arXiv:2210.07316}, year = {2022}
}

About

MTEB: Massive Text Embedding Benchmark

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - Clibrain/MSTEB: MTEB: Massive Text Embedding Benchmark · GitHub
Skip to content

Repository files navigation

Massive Text Embedding Benchmark

GitHub releaseGitHub releaseBuildLicenseDownloads

Installation

pip install mteb

Usage

frommtebimportMTEBfromsentence_transformersimportSentenceTransformer# Define the sentence-transformers model namemodel_name="average_word_embeddings_komninos"model=SentenceTransformer(model_name)
evaluation=MTEB(tasks=["Banking77Classification"])
results=evaluation.run(model, output_folder=f"results/{model_name}")
  • Using CLI
mteb --available_tasks
mteb -m average_word_embeddings_komninos \
-t Banking77Classification \
--output_folder results/average_word_embeddings_komninos \
--verbosity 3
  • Using multiple GPUs in parallel can be done by just having a custom encode function that distributes the inputs to multiple GPUs like e.g. here. For retrieval tasks you can also use the below (see scripts/retrieval.slurm for multi-node slurm script example):
pipinstallgit+https://github.com/NouamaneTazi/beir@nouamane/better-multi-gpu# Run on 2 gpustorchrun--nproc_per_node=2scripts/retrieval_multigpu.py

Advanced usage

Dataset selection

Datasets can be selected by providing the list of datasets, but also

  • by their task (e.g. "Clustering" or "Classification")
evaluation=MTEB(task_types=['Clustering', 'Retrieval']) # Only select clustering and retrieval tasks
  • by their categories e.g. "S2S" (sentence to sentence) or "P2P" (paragraph to paragraph)
evaluation=MTEB(task_categories=['S2S']) # Only select sentence2sentence datasets
  • by their languages
evaluation=MTEB(task_langs=["en", "de"]) # Only select datasets which are "en", "de" or "en-de"

You can also specify which languages to load for multilingual/crosslingual tasks like below:

frommteb.tasksimportAmazonReviewsClassification, BUCCBitextMiningevaluation=MTEB(tasks=[
AmazonReviewsClassification(langs=["en", "fr"]) # Only load "en" and "fr" subsets of Amazon ReviewsBUCCBitextMining(langs=["de-en"]), # Only load "de-en" subset of BUCC
])

Evaluation split

You can evaluate only on test splits of all tasks by doing the following:

evaluation.run(model, eval_splits=["test"])

Note that the public leaderboard uses the test splits for all datasets except MSMARCO, where the "dev" split is used.

Using a custom model

Models should implement the following interface, implementing an encode function taking as inputs a list of sentences, and returning a list of embeddings (embeddings can be np.array, torch.tensor, etc.). For inspiration, you can look at the mteb/mtebscripts repo used for running diverse models via SLURM scripts for the paper.

classMyModel():
defencode(self, sentences, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: sentences (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passmodel=MyModel()
evaluation=MTEB(tasks=["Banking77Classification"])
evaluation.run(model)

If you'd like to use different encoding functions for query and corpus when evaluating on Retrieval or Reranking tasks, you can add separate methods for encode_queries and encode_corpus. If these methods exist, they will be automatically used for those tasks. You can refer to the DRESModel at mteb/mteb/abstasks/AbsTaskRetrieval.py for an example of these functions.

classMyModel():
defencode_queries(self, queries, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: queries (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passdefencode_corpus(self, corpus, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: corpus (`List[str]` or `List[Dict[str, str]]`): List of sentences to encode or list of dictionaries with keys "title" and "text" batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """pass

Evaluating on a custom task

To add a new task, you need to implement a new class that inherits from the AbsTask associated with the task type (e.g. AbsTaskReranking for reranking tasks). You can find the supported task types in here.

frommtebimportMTEBfrommteb.abstasks.AbsTaskRerankingimportAbsTaskRerankingfromsentence_transformersimportSentenceTransformerclassMindSmallReranking(AbsTaskReranking):
@propertydefdescription(self):
return {
"name": "MindSmallReranking",
"hf_hub_name": "mteb/mind_small",
"description": "Microsoft News Dataset: A Large-Scale English Dataset for News Recommendation Research",
"reference": "https://www.microsoft.com/en-us/research/uploads/prod/2019/03/nl4se18LinkSO.pdf",
"type": "Reranking",
"category": "s2s",
"eval_splits": ["validation"],
"eval_langs": ["en"],
"main_score": "map",
}
model=SentenceTransformer("average_word_embeddings_komninos")
evaluation=MTEB(tasks=[MindSmallReranking()])
evaluation.run(model)

Note: for multilingual tasks, make sure your class also inherits from the MultilingualTask class like in this example.

Leaderboard

The MTEB Leaderboard is available here. To submit:

  1. Run on MTEB: You can reference scripts/run_mteb_english.py for all MTEB English datasets used in the main ranking, or scripts/run_mteb_chinese.py for the Chinese ones. Advanced scripts with different models are available in the mteb/mtebscripts repo.
  2. Format the json files into metadata using the script at scripts/mteb_meta.py. For example python scripts/mteb_meta.py path_to_results_folder, which will create a mteb_metadata.md file. If you ran CQADupstack retrieval, make sure to merge the results first with python scripts/merge_cqadupstack.py path_to_results_folder.
  3. Copy the content of the mteb_metadata.md file to the top of a README.md file of your model on the Hub. See here for an example.
  4. Hit the Refresh button at the bottom of the leaderboard and you should see your scores 🥇
  5. To have the scores appear without refreshing, you can open an issue on the Community Tab of the LB and someone will restart the space to cache your average scores. The cache is updated anyways ~1x/week.

Available tasks

NameHub URLDescriptionTypeCategory#LanguagesTrain #SamplesDev #SamplesTest #SamplesAvg. chars / trainAvg. chars / devAvg. chars / test
BUCCmteb/bucc-bitext-miningBUCC bitext mining datasetBitextMinings2s40064168400101.3
Tatoebamteb/tatoeba-bitext-mining1,000 English-aligned sentence pairs for each language based on the Tatoeba corpusBitextMinings2s1120020000039.4
Bornholm parallelstrombergnlp/bornholmsk_parallelDanish Bornholmsk Parallel Corpus.BitextMinings2s210010010064.686.289.7
AmazonCounterfactualClassificationmteb/amazon_counterfactualA collection of Amazon customer reviews annotated for counterfactual detection pair classification.Classifications2s44018335670107.3109.2106.1
AmazonPolarityClassificationmteb/amazon_polarityAmazon Polarity Classification Dataset.Classifications2s136000000400000431.60431.4
AmazonReviewsClassificationmteb/amazon_reviews_multiA collection of Amazon reviews specifically designed to aid research in multilingual text classification.Classifications2s612000003000030000160.5159.2160.4
Banking77Classificationmteb/banking77Dataset composed of online banking queries annotated with their corresponding intents.Classifications2s1100030308059.5054.2
EmotionClassificationmteb/emotionEmotion is a dataset of English Twitter messages with six basic emotions: anger, fear, joy, love, sadness, and surprise. For more detailed information please refer to the paper.Classifications2s1160002000200096.895.396.6
ImdbClassificationmteb/imdbLarge Movie Review DatasetClassificationp2p1250000250001325.101293.8
MassiveIntentClassificationmteb/amazon_massive_intentMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MassiveScenarioClassificationmteb/amazon_massive_scenarioMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MTOPDomainClassificationmteb/mtop_domainMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
MTOPIntentClassificationmteb/mtop_intentMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
ToxicConversationsClassificationmteb/toxic_conversations_50kCollection of comments from the Civil Comments platform together with annotations if the comment is toxic or not.Classifications2s150000050000298.80296.6
TweetSentimentExtractionClassificationmteb/tweet_sentiment_extractionClassifications2s1274810353468.3067.8
AngryTweetsClassificationmteb/DDSC/angry-tweetsA sentiment dataset with 3 classes (positiv, negativ, neutral) for Danish tweetsClassifications2s1241001050153.00156.1
DKHateClassificationDDSC/dkhateDanish Tweets annotated for Hate SpeechClassifications2s12960032988.20104.0
DalajClassificationAI-Sweden/SuperLimA Swedish dataset for linguistic accebtablity. Available as a part of SuperlimClassifications2s13840445444243.7242.5243.8
DanishPoliticalCommentsClassificationdanish_political_commentsA dataset of Danish political comments rated for sentimentClassifications2s190100069.900
LccClassificationDDSC/lccThe leipzig corpora collection, annotated for sentimentClassifications2s13490150113.50118.7
NoRecClassificationScandEval/norec-miniA Norwegian dataset for sentiment classification on reviewClassifications2s11020256205086.989.682.0
NordicLangClassificationstrombergnlp/nordic_langidA dataset for Nordic language identification.Classifications2s6570000300078.4078.2
NorwegianParliamentClassificationNbAiLab/norwegian_parliamentNorwegian parliament speeches annotated for sentimentClassifications2s13600120012001773.61911.01884.0
ScalaDaClassificationScandEval/scala-daA modified version of DDT modified for linguistic acceptability classificationClassifications2s110242562048107.6100.8109.4
ScalaNbClassificationScandEval/scala-nbA Norwegian dataset for linguistic acceptability classification for BokmålClassifications2s11024256204895.594.898.4
ScalaNnClassificationScandEval/scala-nnA Norwegian dataset for linguistic acceptability classification for NynorskClassifications2s110242562048105.3103.5104.8
ScalaSvClassificationScandEval/scala-svA Swedish dataset for linguistic acceptability classificationClassifications2s110242562048102.6113.098.3
SweRecClassificitionScandEval/swerec-miniA Swedish dataset for sentiment classification on reviewsClassifications2s110242562048317.7293.4318.8
CBDPL-MTEB/cbdPolish Tweets annotated for cyberbullying detection.Classifications2s1100410100093.6093.2
PolEmo2.0-INPL-MTEB/polemo2_inA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-IN task is to predict the sentiment of in-domain (medicine and hotels) reviews.Classifications2s15783723722780.6769.4756.2
PolEmo2.0-OUTPL-MTEB/polemo2_outA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-OUT task is to predict the sentiment of out-of-domain (products and school) reviews using models train on reviews from medicine and hotels domains.Classifications2s15783494494780.6589.3587.0
AllegroReviewsPL-MTEB/allegro-reviewsA Polish dataset for sentiment classification on reviews from e-commerce marketplace Allegro.Classifications2s1957710021006477.9480.9477.2
PAClaugustyniak/abusive-clauses-plPolish Abusive Clauses DatasetClassifications2s1428415193453185.3256.8185.3
ArxivClusteringP2Pmteb/arxiv-clustering-p2pClustering of titles+abstract from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusteringp2p100732723001009.9
ArxivClusteringS2Smteb/arxiv-clustering-s2sClustering of titles from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusterings2s1007327230074.0
BiorxivClusteringP2Pmteb/biorxiv-clustering-p2pClustering of titles+abstract from biorxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10075000001666.2
BiorxivClusteringS2Smteb/biorxiv-clustering-s2sClustering of titles from biorxiv. Clustering of 10 sets, based on the main category.Clusterings2s1007500000101.6
BlurbsClusteringP2Pslvnwhrl/blurbs-clustering-p2pClustering of book titles+blurbs. Clustering of 28 sets, either on the main or secondary genreClusteringp2p10017463700664.09
BlurbsClusteringS2Sslvnwhrl/blurbs-clustering-s2sClustering of book titles. Clustering of 28 sets, either on the main or secondary genre.Clusterings2s1001746370023.02
MedrxivClusteringP2Pmteb/medrxiv-clustering-p2pClustering of titles+abstract from medrxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10037500001981.2
MedrxivClusteringS2Smteb/medrxiv-clustering-s2sClustering of titles from medrxiv. Clustering of 10 sets, based on the main category.Clusterings2s1003750000114.7
RedditClusteringmteb/reddit-clusteringClustering of titles from 199 subreddits. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s1004204640064.7
RedditClusteringP2Pmteb/reddit-clustering-p2pClustering of title+posts from reddit. Clustering of 10 sets of 50k paragraphs and 40 sets of 10k paragraphs.Clusteringp2p10045939900727.7
StackExchangeClusteringmteb/stackexchange-clusteringClustering of titles from 121 stackexchanges. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s10417060373850056.857.0
StackExchangeClusteringP2Pmteb/stackexchange-clustering-p2pClustering of title+body from stackexchange. Clustering of 5 sets of 10k paragraphs and 5 sets of 5k paragraphs.Clusteringp2p10075000001090.7
TenKGnadClusteringP2Pslvnwhrl/tenkgnad-clustering-p2pClustering of news article titles+subheadings+texts. Clustering of 10 splits on the news article category.Clusteringp2p10045914002641.03
TenKGnadClusteringS2Sslvnwhrl/tenkgnad-clustering-s2sClustering of news article titles. Clustering of 10 splits on the news article category.Clusterings2s100459140050.96
TwentyNewsgroupsClusteringmteb/twentynewsgroups-clusteringClustering of the 20 Newsgroups dataset (subject only).Clusterings2s100595450032.0
8TagsClusteringPL-MTEB/8tags-clusteringClustering of headlines from social media posts in Polish belonging to 8 categories: film, history, food, medicine, motorization, work, sport and technology.Clusterings2s1400015000437278.277.679.2
SprintDuplicateQuestionsmteb/sprintduplicatequestions-pairclassificationDuplicate questions from the Sprint community.PairClassifications2s10101000101000065.267.9
TwitterSemEval2015mteb/twittersemeval2015-pairclassificationParaphrase-Pairs of Tweets from the SemEval 2015 workshop.PairClassifications2s100167770038.3
TwitterURLCorpusmteb/twitterurlcorpus-pairclassificationParaphrase-Pairs of Tweets.PairClassifications2s100515340079.5
PPCPL-MTEB/ppc-pairclassificationPolish Paraphrase CorpusPairClassifications2s150001000100041.041.040.2
PSCPL-MTEB/psc-pairclassificationPolish Summaries CorpusPairClassifications2s1430201078537.10549.3
SICK-E-PLPL-MTEB/sicke-pl-pairclassificationPolish version of SICK dataset for textual entailment.PairClassifications2s14439495490643.444.743.2
CDSC-EPL-MTEB/cdsce-pairclassificationCompositional Distributional Semantics Corpus for textual entailment.PairClassifications2s180001000100071.973.575.2
AskUbuntuDupQuestionsmteb/askubuntudupquestions-rerankingAskUbuntu Question Dataset - Questions from AskUbuntu with manual annotations marking pairs of questions as similar or non-similarRerankings2s10022550052.5
MindSmallRerankingmteb/mind_smallMicrosoft News Dataset: A Large-Scale English Dataset for News Recommendation ResearchRerankings2s1231530010796869.0070.9
SciDocsRRmteb/scidocs-rerankingRanking of related scientific papers based on their title.Rerankings2s101959419599069.469.0
StackOverflowDupQuestionsmteb/stackoverflowdupquestions-rerankingStack Overflow Duplicate Questions Task for questions with the tags Java, JavaScript and PythonRerankings2s1230180346749.6049.8
ArguAnaBeIR/arguanaNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
ClimateFEVERBeIR/climate-feverCLIMATE-FEVER is a dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change.Retrievals2p100541812800539.1
CQADupstackAndroidRetrievalBeIR/cqadupstack/androidCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1002369700578.7
CQADupstackEnglishRetrievalBeIR/cqadupstack/englishCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004179100467.1
CQADupstackGamingRetrievalBeIR/cqadupstack/gamingCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004689600474.7
CQADupstackGisRetrievalBeIR/cqadupstack/gisCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003852200991.1
CQADupstackMathematicaRetrievalBeIR/cqadupstack/mathematicaCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10017509001103.7
CQADupstackPhysicsRetrievalBeIR/cqadupstack/physicsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003935500799.4
CQADupstackProgrammersRetrievalBeIR/cqadupstack/programmersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10033052001030.2
CQADupstackStatsRetrievalBeIR/cqadupstack/statsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10042921001041.0
CQADupstackTexRetrievalBeIR/cqadupstack/texCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10071090001246.9
CQADupstackUnixRetrievalBeIR/cqadupstack/unixCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004845400984.7
CQADupstackWebmastersRetrievalBeIR/cqadupstack/webmastersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1001791100689.8
CQADupstackWordpressRetrievalBeIR/cqadupstack/wordpressCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10049146001111.9
DBPediaBeIR/dbpedia-entityDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FEVERBeIR/feverFEVER (Fact Extraction and VERification) consists of 185,445 claims generated by altering sentences extracted from Wikipedia and subsequently verified without knowledge of the sentence they were derived from.Retrievals2p100542323400538.6
FiQA2018BeIR/fiqaFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQABeIR/hotpotqaHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCOBeIR/msmarcoMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
MSMARCOv2BeIR/msmarco-v2MS MARCO is a collection of datasets focused on deep learning in searchRetrievals2p11386413421383681010341.4342.00
NFCorpusBeIR/nfcorpusNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQBeIR/nqNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p100268492000492.7
QuoraRetrievalBeIR/quoraQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCSBeIR/scidocsSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFactBeIR/scifactSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
Touche2020BeIR/webis-touche2020Touché Task 1: Argument Retrieval for Controversial QuestionsRetrievals2p100382594001720.1
TRECCOVIDBeIR/trec-covidTRECCOVID is an ad-hoc search challenge based on the CORD-19 dataset containing scientific articles related to the COVID-19 pandemicRetrievals2p100171382001117.4
ArguAna-PLBeIR-PL/arguana-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
DBPedia-PLBeIR-PL/dbpedia-plDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FiQA-PLBeIR-PL/fiqa-plFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQA-PLBeIR-PL/hotpotqa-plHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCO-PLBeIR-PL/msmarco-plMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
NFCorpus-PLBeIR-PL/nfcorpus-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQ-PLBeIR-PL/nq-plNatural Questions: A Benchmark for Question Answering ResearchRetrievals2p100268492000492.7
Quora-PLBeIR-PL/quora-plQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCS-PLBeIR-PL/scidocs-plSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFact-PLBeIR-PL/scifact-plSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
SweFAQAI-Sweden/SuperLimFrequently asked questions from Swedish authorities' websitesRetrievals2p10051300390.57
BIOSSESmteb/biosses-stsBiomedical Semantic Similarity Estimation.STSs2s10020000156.6
SICK-Rmteb/sickr-stsSemantic Textual Similarity SICK-R dataset as described here:STSs2s100198540046.1
STS12mteb/sts12-stsSemEval STS 2012 dataset.STSs2s1446806216100.7064.7
STS13mteb/sts13-stsSemEval STS 2013 dataset.STSs2s10030000054.0
STS14mteb/sts14-stsSemEval STS 2014 dataset. Currently only the English datasetSTSs2s10075000054.3
STS15mteb/sts15-stsSemEval STS 2015 datasetSTSs2s10060000057.7
STS16mteb/sts16-stsSemEval STS 2016 datasetSTSs2s10023720065.3
STS17mteb/sts17-crosslingual-stsSTS 2017 datasetSTSs2s11005000043.3
STS22mteb/sts22-crosslingual-stsSemEval 2022 Task 8: Multilingual News Article SimilaritySTSs2s18008060001992.8
STSBenchmarkmteb/stsbenchmark-stsSemantic Textual Similarity Benchmark (STSbenchmark) dataset.STSs2s1114983000275857.664.053.6
SICK-R-PLPL-MTEB/sickr-pl-stsPolish version of SICK dataset for textual relatedness.STSs2s18878990981242.944.042.8
CDSC-RPL-MTEB/cdscr-stsCompositional Distributional Semantics Corpus for textual relatedness.STSs2s1160002000200072.173.275.0
SummEvalmteb/summevalNews Article Summary Semantic Similarity Estimation.Summarizations2s100280000359.8

For Chinese tasks, you can refer to C_MTEB.

Citation

If you find MTEB useful, feel free to cite our publication MTEB: Massive Text Embedding Benchmark:

@article{muennighoff2022mteb,
doi = {10.48550/ARXIV.2210.07316},
url = {https://arxiv.org/abs/2210.07316},
author = {Muennighoff, Niklas and Tazi, Nouamane and Magne, Lo{\"\i}c and Reimers, Nils},
title = {MTEB: Massive Text Embedding Benchmark},
publisher = {arXiv},
journal={arXiv preprint arXiv:2210.07316}, year = {2022}
}

About

MTEB: Massive Text Embedding Benchmark

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - Clibrain/MSTEB: MTEB: Massive Text Embedding Benchmark · GitHub
Skip to content

Repository files navigation

Massive Text Embedding Benchmark

GitHub releaseGitHub releaseBuildLicenseDownloads

Installation

pip install mteb

Usage

frommtebimportMTEBfromsentence_transformersimportSentenceTransformer# Define the sentence-transformers model namemodel_name="average_word_embeddings_komninos"model=SentenceTransformer(model_name)
evaluation=MTEB(tasks=["Banking77Classification"])
results=evaluation.run(model, output_folder=f"results/{model_name}")
  • Using CLI
mteb --available_tasks
mteb -m average_word_embeddings_komninos \
-t Banking77Classification \
--output_folder results/average_word_embeddings_komninos \
--verbosity 3
  • Using multiple GPUs in parallel can be done by just having a custom encode function that distributes the inputs to multiple GPUs like e.g. here. For retrieval tasks you can also use the below (see scripts/retrieval.slurm for multi-node slurm script example):
pipinstallgit+https://github.com/NouamaneTazi/beir@nouamane/better-multi-gpu# Run on 2 gpustorchrun--nproc_per_node=2scripts/retrieval_multigpu.py

Advanced usage

Dataset selection

Datasets can be selected by providing the list of datasets, but also

  • by their task (e.g. "Clustering" or "Classification")
evaluation=MTEB(task_types=['Clustering', 'Retrieval']) # Only select clustering and retrieval tasks
  • by their categories e.g. "S2S" (sentence to sentence) or "P2P" (paragraph to paragraph)
evaluation=MTEB(task_categories=['S2S']) # Only select sentence2sentence datasets
  • by their languages
evaluation=MTEB(task_langs=["en", "de"]) # Only select datasets which are "en", "de" or "en-de"

You can also specify which languages to load for multilingual/crosslingual tasks like below:

frommteb.tasksimportAmazonReviewsClassification, BUCCBitextMiningevaluation=MTEB(tasks=[
AmazonReviewsClassification(langs=["en", "fr"]) # Only load "en" and "fr" subsets of Amazon ReviewsBUCCBitextMining(langs=["de-en"]), # Only load "de-en" subset of BUCC
])

Evaluation split

You can evaluate only on test splits of all tasks by doing the following:

evaluation.run(model, eval_splits=["test"])

Note that the public leaderboard uses the test splits for all datasets except MSMARCO, where the "dev" split is used.

Using a custom model

Models should implement the following interface, implementing an encode function taking as inputs a list of sentences, and returning a list of embeddings (embeddings can be np.array, torch.tensor, etc.). For inspiration, you can look at the mteb/mtebscripts repo used for running diverse models via SLURM scripts for the paper.

classMyModel():
defencode(self, sentences, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: sentences (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passmodel=MyModel()
evaluation=MTEB(tasks=["Banking77Classification"])
evaluation.run(model)

If you'd like to use different encoding functions for query and corpus when evaluating on Retrieval or Reranking tasks, you can add separate methods for encode_queries and encode_corpus. If these methods exist, they will be automatically used for those tasks. You can refer to the DRESModel at mteb/mteb/abstasks/AbsTaskRetrieval.py for an example of these functions.

classMyModel():
defencode_queries(self, queries, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: queries (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passdefencode_corpus(self, corpus, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: corpus (`List[str]` or `List[Dict[str, str]]`): List of sentences to encode or list of dictionaries with keys "title" and "text" batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """pass

Evaluating on a custom task

To add a new task, you need to implement a new class that inherits from the AbsTask associated with the task type (e.g. AbsTaskReranking for reranking tasks). You can find the supported task types in here.

frommtebimportMTEBfrommteb.abstasks.AbsTaskRerankingimportAbsTaskRerankingfromsentence_transformersimportSentenceTransformerclassMindSmallReranking(AbsTaskReranking):
@propertydefdescription(self):
return {
"name": "MindSmallReranking",
"hf_hub_name": "mteb/mind_small",
"description": "Microsoft News Dataset: A Large-Scale English Dataset for News Recommendation Research",
"reference": "https://www.microsoft.com/en-us/research/uploads/prod/2019/03/nl4se18LinkSO.pdf",
"type": "Reranking",
"category": "s2s",
"eval_splits": ["validation"],
"eval_langs": ["en"],
"main_score": "map",
}
model=SentenceTransformer("average_word_embeddings_komninos")
evaluation=MTEB(tasks=[MindSmallReranking()])
evaluation.run(model)

Note: for multilingual tasks, make sure your class also inherits from the MultilingualTask class like in this example.

Leaderboard

The MTEB Leaderboard is available here. To submit:

  1. Run on MTEB: You can reference scripts/run_mteb_english.py for all MTEB English datasets used in the main ranking, or scripts/run_mteb_chinese.py for the Chinese ones. Advanced scripts with different models are available in the mteb/mtebscripts repo.
  2. Format the json files into metadata using the script at scripts/mteb_meta.py. For example python scripts/mteb_meta.py path_to_results_folder, which will create a mteb_metadata.md file. If you ran CQADupstack retrieval, make sure to merge the results first with python scripts/merge_cqadupstack.py path_to_results_folder.
  3. Copy the content of the mteb_metadata.md file to the top of a README.md file of your model on the Hub. See here for an example.
  4. Hit the Refresh button at the bottom of the leaderboard and you should see your scores 🥇
  5. To have the scores appear without refreshing, you can open an issue on the Community Tab of the LB and someone will restart the space to cache your average scores. The cache is updated anyways ~1x/week.

Available tasks

NameHub URLDescriptionTypeCategory#LanguagesTrain #SamplesDev #SamplesTest #SamplesAvg. chars / trainAvg. chars / devAvg. chars / test
BUCCmteb/bucc-bitext-miningBUCC bitext mining datasetBitextMinings2s40064168400101.3
Tatoebamteb/tatoeba-bitext-mining1,000 English-aligned sentence pairs for each language based on the Tatoeba corpusBitextMinings2s1120020000039.4
Bornholm parallelstrombergnlp/bornholmsk_parallelDanish Bornholmsk Parallel Corpus.BitextMinings2s210010010064.686.289.7
AmazonCounterfactualClassificationmteb/amazon_counterfactualA collection of Amazon customer reviews annotated for counterfactual detection pair classification.Classifications2s44018335670107.3109.2106.1
AmazonPolarityClassificationmteb/amazon_polarityAmazon Polarity Classification Dataset.Classifications2s136000000400000431.60431.4
AmazonReviewsClassificationmteb/amazon_reviews_multiA collection of Amazon reviews specifically designed to aid research in multilingual text classification.Classifications2s612000003000030000160.5159.2160.4
Banking77Classificationmteb/banking77Dataset composed of online banking queries annotated with their corresponding intents.Classifications2s1100030308059.5054.2
EmotionClassificationmteb/emotionEmotion is a dataset of English Twitter messages with six basic emotions: anger, fear, joy, love, sadness, and surprise. For more detailed information please refer to the paper.Classifications2s1160002000200096.895.396.6
ImdbClassificationmteb/imdbLarge Movie Review DatasetClassificationp2p1250000250001325.101293.8
MassiveIntentClassificationmteb/amazon_massive_intentMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MassiveScenarioClassificationmteb/amazon_massive_scenarioMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MTOPDomainClassificationmteb/mtop_domainMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
MTOPIntentClassificationmteb/mtop_intentMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
ToxicConversationsClassificationmteb/toxic_conversations_50kCollection of comments from the Civil Comments platform together with annotations if the comment is toxic or not.Classifications2s150000050000298.80296.6
TweetSentimentExtractionClassificationmteb/tweet_sentiment_extractionClassifications2s1274810353468.3067.8
AngryTweetsClassificationmteb/DDSC/angry-tweetsA sentiment dataset with 3 classes (positiv, negativ, neutral) for Danish tweetsClassifications2s1241001050153.00156.1
DKHateClassificationDDSC/dkhateDanish Tweets annotated for Hate SpeechClassifications2s12960032988.20104.0
DalajClassificationAI-Sweden/SuperLimA Swedish dataset for linguistic accebtablity. Available as a part of SuperlimClassifications2s13840445444243.7242.5243.8
DanishPoliticalCommentsClassificationdanish_political_commentsA dataset of Danish political comments rated for sentimentClassifications2s190100069.900
LccClassificationDDSC/lccThe leipzig corpora collection, annotated for sentimentClassifications2s13490150113.50118.7
NoRecClassificationScandEval/norec-miniA Norwegian dataset for sentiment classification on reviewClassifications2s11020256205086.989.682.0
NordicLangClassificationstrombergnlp/nordic_langidA dataset for Nordic language identification.Classifications2s6570000300078.4078.2
NorwegianParliamentClassificationNbAiLab/norwegian_parliamentNorwegian parliament speeches annotated for sentimentClassifications2s13600120012001773.61911.01884.0
ScalaDaClassificationScandEval/scala-daA modified version of DDT modified for linguistic acceptability classificationClassifications2s110242562048107.6100.8109.4
ScalaNbClassificationScandEval/scala-nbA Norwegian dataset for linguistic acceptability classification for BokmålClassifications2s11024256204895.594.898.4
ScalaNnClassificationScandEval/scala-nnA Norwegian dataset for linguistic acceptability classification for NynorskClassifications2s110242562048105.3103.5104.8
ScalaSvClassificationScandEval/scala-svA Swedish dataset for linguistic acceptability classificationClassifications2s110242562048102.6113.098.3
SweRecClassificitionScandEval/swerec-miniA Swedish dataset for sentiment classification on reviewsClassifications2s110242562048317.7293.4318.8
CBDPL-MTEB/cbdPolish Tweets annotated for cyberbullying detection.Classifications2s1100410100093.6093.2
PolEmo2.0-INPL-MTEB/polemo2_inA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-IN task is to predict the sentiment of in-domain (medicine and hotels) reviews.Classifications2s15783723722780.6769.4756.2
PolEmo2.0-OUTPL-MTEB/polemo2_outA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-OUT task is to predict the sentiment of out-of-domain (products and school) reviews using models train on reviews from medicine and hotels domains.Classifications2s15783494494780.6589.3587.0
AllegroReviewsPL-MTEB/allegro-reviewsA Polish dataset for sentiment classification on reviews from e-commerce marketplace Allegro.Classifications2s1957710021006477.9480.9477.2
PAClaugustyniak/abusive-clauses-plPolish Abusive Clauses DatasetClassifications2s1428415193453185.3256.8185.3
ArxivClusteringP2Pmteb/arxiv-clustering-p2pClustering of titles+abstract from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusteringp2p100732723001009.9
ArxivClusteringS2Smteb/arxiv-clustering-s2sClustering of titles from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusterings2s1007327230074.0
BiorxivClusteringP2Pmteb/biorxiv-clustering-p2pClustering of titles+abstract from biorxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10075000001666.2
BiorxivClusteringS2Smteb/biorxiv-clustering-s2sClustering of titles from biorxiv. Clustering of 10 sets, based on the main category.Clusterings2s1007500000101.6
BlurbsClusteringP2Pslvnwhrl/blurbs-clustering-p2pClustering of book titles+blurbs. Clustering of 28 sets, either on the main or secondary genreClusteringp2p10017463700664.09
BlurbsClusteringS2Sslvnwhrl/blurbs-clustering-s2sClustering of book titles. Clustering of 28 sets, either on the main or secondary genre.Clusterings2s1001746370023.02
MedrxivClusteringP2Pmteb/medrxiv-clustering-p2pClustering of titles+abstract from medrxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10037500001981.2
MedrxivClusteringS2Smteb/medrxiv-clustering-s2sClustering of titles from medrxiv. Clustering of 10 sets, based on the main category.Clusterings2s1003750000114.7
RedditClusteringmteb/reddit-clusteringClustering of titles from 199 subreddits. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s1004204640064.7
RedditClusteringP2Pmteb/reddit-clustering-p2pClustering of title+posts from reddit. Clustering of 10 sets of 50k paragraphs and 40 sets of 10k paragraphs.Clusteringp2p10045939900727.7
StackExchangeClusteringmteb/stackexchange-clusteringClustering of titles from 121 stackexchanges. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s10417060373850056.857.0
StackExchangeClusteringP2Pmteb/stackexchange-clustering-p2pClustering of title+body from stackexchange. Clustering of 5 sets of 10k paragraphs and 5 sets of 5k paragraphs.Clusteringp2p10075000001090.7
TenKGnadClusteringP2Pslvnwhrl/tenkgnad-clustering-p2pClustering of news article titles+subheadings+texts. Clustering of 10 splits on the news article category.Clusteringp2p10045914002641.03
TenKGnadClusteringS2Sslvnwhrl/tenkgnad-clustering-s2sClustering of news article titles. Clustering of 10 splits on the news article category.Clusterings2s100459140050.96
TwentyNewsgroupsClusteringmteb/twentynewsgroups-clusteringClustering of the 20 Newsgroups dataset (subject only).Clusterings2s100595450032.0
8TagsClusteringPL-MTEB/8tags-clusteringClustering of headlines from social media posts in Polish belonging to 8 categories: film, history, food, medicine, motorization, work, sport and technology.Clusterings2s1400015000437278.277.679.2
SprintDuplicateQuestionsmteb/sprintduplicatequestions-pairclassificationDuplicate questions from the Sprint community.PairClassifications2s10101000101000065.267.9
TwitterSemEval2015mteb/twittersemeval2015-pairclassificationParaphrase-Pairs of Tweets from the SemEval 2015 workshop.PairClassifications2s100167770038.3
TwitterURLCorpusmteb/twitterurlcorpus-pairclassificationParaphrase-Pairs of Tweets.PairClassifications2s100515340079.5
PPCPL-MTEB/ppc-pairclassificationPolish Paraphrase CorpusPairClassifications2s150001000100041.041.040.2
PSCPL-MTEB/psc-pairclassificationPolish Summaries CorpusPairClassifications2s1430201078537.10549.3
SICK-E-PLPL-MTEB/sicke-pl-pairclassificationPolish version of SICK dataset for textual entailment.PairClassifications2s14439495490643.444.743.2
CDSC-EPL-MTEB/cdsce-pairclassificationCompositional Distributional Semantics Corpus for textual entailment.PairClassifications2s180001000100071.973.575.2
AskUbuntuDupQuestionsmteb/askubuntudupquestions-rerankingAskUbuntu Question Dataset - Questions from AskUbuntu with manual annotations marking pairs of questions as similar or non-similarRerankings2s10022550052.5
MindSmallRerankingmteb/mind_smallMicrosoft News Dataset: A Large-Scale English Dataset for News Recommendation ResearchRerankings2s1231530010796869.0070.9
SciDocsRRmteb/scidocs-rerankingRanking of related scientific papers based on their title.Rerankings2s101959419599069.469.0
StackOverflowDupQuestionsmteb/stackoverflowdupquestions-rerankingStack Overflow Duplicate Questions Task for questions with the tags Java, JavaScript and PythonRerankings2s1230180346749.6049.8
ArguAnaBeIR/arguanaNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
ClimateFEVERBeIR/climate-feverCLIMATE-FEVER is a dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change.Retrievals2p100541812800539.1
CQADupstackAndroidRetrievalBeIR/cqadupstack/androidCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1002369700578.7
CQADupstackEnglishRetrievalBeIR/cqadupstack/englishCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004179100467.1
CQADupstackGamingRetrievalBeIR/cqadupstack/gamingCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004689600474.7
CQADupstackGisRetrievalBeIR/cqadupstack/gisCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003852200991.1
CQADupstackMathematicaRetrievalBeIR/cqadupstack/mathematicaCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10017509001103.7
CQADupstackPhysicsRetrievalBeIR/cqadupstack/physicsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003935500799.4
CQADupstackProgrammersRetrievalBeIR/cqadupstack/programmersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10033052001030.2
CQADupstackStatsRetrievalBeIR/cqadupstack/statsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10042921001041.0
CQADupstackTexRetrievalBeIR/cqadupstack/texCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10071090001246.9
CQADupstackUnixRetrievalBeIR/cqadupstack/unixCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004845400984.7
CQADupstackWebmastersRetrievalBeIR/cqadupstack/webmastersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1001791100689.8
CQADupstackWordpressRetrievalBeIR/cqadupstack/wordpressCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10049146001111.9
DBPediaBeIR/dbpedia-entityDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FEVERBeIR/feverFEVER (Fact Extraction and VERification) consists of 185,445 claims generated by altering sentences extracted from Wikipedia and subsequently verified without knowledge of the sentence they were derived from.Retrievals2p100542323400538.6
FiQA2018BeIR/fiqaFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQABeIR/hotpotqaHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCOBeIR/msmarcoMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
MSMARCOv2BeIR/msmarco-v2MS MARCO is a collection of datasets focused on deep learning in searchRetrievals2p11386413421383681010341.4342.00
NFCorpusBeIR/nfcorpusNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQBeIR/nqNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p100268492000492.7
QuoraRetrievalBeIR/quoraQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCSBeIR/scidocsSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFactBeIR/scifactSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
Touche2020BeIR/webis-touche2020Touché Task 1: Argument Retrieval for Controversial QuestionsRetrievals2p100382594001720.1
TRECCOVIDBeIR/trec-covidTRECCOVID is an ad-hoc search challenge based on the CORD-19 dataset containing scientific articles related to the COVID-19 pandemicRetrievals2p100171382001117.4
ArguAna-PLBeIR-PL/arguana-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
DBPedia-PLBeIR-PL/dbpedia-plDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FiQA-PLBeIR-PL/fiqa-plFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQA-PLBeIR-PL/hotpotqa-plHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCO-PLBeIR-PL/msmarco-plMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
NFCorpus-PLBeIR-PL/nfcorpus-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQ-PLBeIR-PL/nq-plNatural Questions: A Benchmark for Question Answering ResearchRetrievals2p100268492000492.7
Quora-PLBeIR-PL/quora-plQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCS-PLBeIR-PL/scidocs-plSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFact-PLBeIR-PL/scifact-plSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
SweFAQAI-Sweden/SuperLimFrequently asked questions from Swedish authorities' websitesRetrievals2p10051300390.57
BIOSSESmteb/biosses-stsBiomedical Semantic Similarity Estimation.STSs2s10020000156.6
SICK-Rmteb/sickr-stsSemantic Textual Similarity SICK-R dataset as described here:STSs2s100198540046.1
STS12mteb/sts12-stsSemEval STS 2012 dataset.STSs2s1446806216100.7064.7
STS13mteb/sts13-stsSemEval STS 2013 dataset.STSs2s10030000054.0
STS14mteb/sts14-stsSemEval STS 2014 dataset. Currently only the English datasetSTSs2s10075000054.3
STS15mteb/sts15-stsSemEval STS 2015 datasetSTSs2s10060000057.7
STS16mteb/sts16-stsSemEval STS 2016 datasetSTSs2s10023720065.3
STS17mteb/sts17-crosslingual-stsSTS 2017 datasetSTSs2s11005000043.3
STS22mteb/sts22-crosslingual-stsSemEval 2022 Task 8: Multilingual News Article SimilaritySTSs2s18008060001992.8
STSBenchmarkmteb/stsbenchmark-stsSemantic Textual Similarity Benchmark (STSbenchmark) dataset.STSs2s1114983000275857.664.053.6
SICK-R-PLPL-MTEB/sickr-pl-stsPolish version of SICK dataset for textual relatedness.STSs2s18878990981242.944.042.8
CDSC-RPL-MTEB/cdscr-stsCompositional Distributional Semantics Corpus for textual relatedness.STSs2s1160002000200072.173.275.0
SummEvalmteb/summevalNews Article Summary Semantic Similarity Estimation.Summarizations2s100280000359.8

For Chinese tasks, you can refer to C_MTEB.

Citation

If you find MTEB useful, feel free to cite our publication MTEB: Massive Text Embedding Benchmark:

@article{muennighoff2022mteb,
doi = {10.48550/ARXIV.2210.07316},
url = {https://arxiv.org/abs/2210.07316},
author = {Muennighoff, Niklas and Tazi, Nouamane and Magne, Lo{\"\i}c and Reimers, Nils},
title = {MTEB: Massive Text Embedding Benchmark},
publisher = {arXiv},
journal={arXiv preprint arXiv:2210.07316}, year = {2022}
}

About

MTEB: Massive Text Embedding Benchmark

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - Clibrain/MSTEB: MTEB: Massive Text Embedding Benchmark · GitHub
Skip to content

Repository files navigation

Massive Text Embedding Benchmark

GitHub releaseGitHub releaseBuildLicenseDownloads

Installation

pip install mteb

Usage

frommtebimportMTEBfromsentence_transformersimportSentenceTransformer# Define the sentence-transformers model namemodel_name="average_word_embeddings_komninos"model=SentenceTransformer(model_name)
evaluation=MTEB(tasks=["Banking77Classification"])
results=evaluation.run(model, output_folder=f"results/{model_name}")
  • Using CLI
mteb --available_tasks
mteb -m average_word_embeddings_komninos \
-t Banking77Classification \
--output_folder results/average_word_embeddings_komninos \
--verbosity 3
  • Using multiple GPUs in parallel can be done by just having a custom encode function that distributes the inputs to multiple GPUs like e.g. here. For retrieval tasks you can also use the below (see scripts/retrieval.slurm for multi-node slurm script example):
pipinstallgit+https://github.com/NouamaneTazi/beir@nouamane/better-multi-gpu# Run on 2 gpustorchrun--nproc_per_node=2scripts/retrieval_multigpu.py

Advanced usage

Dataset selection

Datasets can be selected by providing the list of datasets, but also

  • by their task (e.g. "Clustering" or "Classification")
evaluation=MTEB(task_types=['Clustering', 'Retrieval']) # Only select clustering and retrieval tasks
  • by their categories e.g. "S2S" (sentence to sentence) or "P2P" (paragraph to paragraph)
evaluation=MTEB(task_categories=['S2S']) # Only select sentence2sentence datasets
  • by their languages
evaluation=MTEB(task_langs=["en", "de"]) # Only select datasets which are "en", "de" or "en-de"

You can also specify which languages to load for multilingual/crosslingual tasks like below:

frommteb.tasksimportAmazonReviewsClassification, BUCCBitextMiningevaluation=MTEB(tasks=[
AmazonReviewsClassification(langs=["en", "fr"]) # Only load "en" and "fr" subsets of Amazon ReviewsBUCCBitextMining(langs=["de-en"]), # Only load "de-en" subset of BUCC
])

Evaluation split

You can evaluate only on test splits of all tasks by doing the following:

evaluation.run(model, eval_splits=["test"])

Note that the public leaderboard uses the test splits for all datasets except MSMARCO, where the "dev" split is used.

Using a custom model

Models should implement the following interface, implementing an encode function taking as inputs a list of sentences, and returning a list of embeddings (embeddings can be np.array, torch.tensor, etc.). For inspiration, you can look at the mteb/mtebscripts repo used for running diverse models via SLURM scripts for the paper.

classMyModel():
defencode(self, sentences, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: sentences (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passmodel=MyModel()
evaluation=MTEB(tasks=["Banking77Classification"])
evaluation.run(model)

If you'd like to use different encoding functions for query and corpus when evaluating on Retrieval or Reranking tasks, you can add separate methods for encode_queries and encode_corpus. If these methods exist, they will be automatically used for those tasks. You can refer to the DRESModel at mteb/mteb/abstasks/AbsTaskRetrieval.py for an example of these functions.

classMyModel():
defencode_queries(self, queries, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: queries (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passdefencode_corpus(self, corpus, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: corpus (`List[str]` or `List[Dict[str, str]]`): List of sentences to encode or list of dictionaries with keys "title" and "text" batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """pass

Evaluating on a custom task

To add a new task, you need to implement a new class that inherits from the AbsTask associated with the task type (e.g. AbsTaskReranking for reranking tasks). You can find the supported task types in here.

frommtebimportMTEBfrommteb.abstasks.AbsTaskRerankingimportAbsTaskRerankingfromsentence_transformersimportSentenceTransformerclassMindSmallReranking(AbsTaskReranking):
@propertydefdescription(self):
return {
"name": "MindSmallReranking",
"hf_hub_name": "mteb/mind_small",
"description": "Microsoft News Dataset: A Large-Scale English Dataset for News Recommendation Research",
"reference": "https://www.microsoft.com/en-us/research/uploads/prod/2019/03/nl4se18LinkSO.pdf",
"type": "Reranking",
"category": "s2s",
"eval_splits": ["validation"],
"eval_langs": ["en"],
"main_score": "map",
}
model=SentenceTransformer("average_word_embeddings_komninos")
evaluation=MTEB(tasks=[MindSmallReranking()])
evaluation.run(model)

Note: for multilingual tasks, make sure your class also inherits from the MultilingualTask class like in this example.

Leaderboard

The MTEB Leaderboard is available here. To submit:

  1. Run on MTEB: You can reference scripts/run_mteb_english.py for all MTEB English datasets used in the main ranking, or scripts/run_mteb_chinese.py for the Chinese ones. Advanced scripts with different models are available in the mteb/mtebscripts repo.
  2. Format the json files into metadata using the script at scripts/mteb_meta.py. For example python scripts/mteb_meta.py path_to_results_folder, which will create a mteb_metadata.md file. If you ran CQADupstack retrieval, make sure to merge the results first with python scripts/merge_cqadupstack.py path_to_results_folder.
  3. Copy the content of the mteb_metadata.md file to the top of a README.md file of your model on the Hub. See here for an example.
  4. Hit the Refresh button at the bottom of the leaderboard and you should see your scores 🥇
  5. To have the scores appear without refreshing, you can open an issue on the Community Tab of the LB and someone will restart the space to cache your average scores. The cache is updated anyways ~1x/week.

Available tasks

NameHub URLDescriptionTypeCategory#LanguagesTrain #SamplesDev #SamplesTest #SamplesAvg. chars / trainAvg. chars / devAvg. chars / test
BUCCmteb/bucc-bitext-miningBUCC bitext mining datasetBitextMinings2s40064168400101.3
Tatoebamteb/tatoeba-bitext-mining1,000 English-aligned sentence pairs for each language based on the Tatoeba corpusBitextMinings2s1120020000039.4
Bornholm parallelstrombergnlp/bornholmsk_parallelDanish Bornholmsk Parallel Corpus.BitextMinings2s210010010064.686.289.7
AmazonCounterfactualClassificationmteb/amazon_counterfactualA collection of Amazon customer reviews annotated for counterfactual detection pair classification.Classifications2s44018335670107.3109.2106.1
AmazonPolarityClassificationmteb/amazon_polarityAmazon Polarity Classification Dataset.Classifications2s136000000400000431.60431.4
AmazonReviewsClassificationmteb/amazon_reviews_multiA collection of Amazon reviews specifically designed to aid research in multilingual text classification.Classifications2s612000003000030000160.5159.2160.4
Banking77Classificationmteb/banking77Dataset composed of online banking queries annotated with their corresponding intents.Classifications2s1100030308059.5054.2
EmotionClassificationmteb/emotionEmotion is a dataset of English Twitter messages with six basic emotions: anger, fear, joy, love, sadness, and surprise. For more detailed information please refer to the paper.Classifications2s1160002000200096.895.396.6
ImdbClassificationmteb/imdbLarge Movie Review DatasetClassificationp2p1250000250001325.101293.8
MassiveIntentClassificationmteb/amazon_massive_intentMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MassiveScenarioClassificationmteb/amazon_massive_scenarioMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MTOPDomainClassificationmteb/mtop_domainMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
MTOPIntentClassificationmteb/mtop_intentMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
ToxicConversationsClassificationmteb/toxic_conversations_50kCollection of comments from the Civil Comments platform together with annotations if the comment is toxic or not.Classifications2s150000050000298.80296.6
TweetSentimentExtractionClassificationmteb/tweet_sentiment_extractionClassifications2s1274810353468.3067.8
AngryTweetsClassificationmteb/DDSC/angry-tweetsA sentiment dataset with 3 classes (positiv, negativ, neutral) for Danish tweetsClassifications2s1241001050153.00156.1
DKHateClassificationDDSC/dkhateDanish Tweets annotated for Hate SpeechClassifications2s12960032988.20104.0
DalajClassificationAI-Sweden/SuperLimA Swedish dataset for linguistic accebtablity. Available as a part of SuperlimClassifications2s13840445444243.7242.5243.8
DanishPoliticalCommentsClassificationdanish_political_commentsA dataset of Danish political comments rated for sentimentClassifications2s190100069.900
LccClassificationDDSC/lccThe leipzig corpora collection, annotated for sentimentClassifications2s13490150113.50118.7
NoRecClassificationScandEval/norec-miniA Norwegian dataset for sentiment classification on reviewClassifications2s11020256205086.989.682.0
NordicLangClassificationstrombergnlp/nordic_langidA dataset for Nordic language identification.Classifications2s6570000300078.4078.2
NorwegianParliamentClassificationNbAiLab/norwegian_parliamentNorwegian parliament speeches annotated for sentimentClassifications2s13600120012001773.61911.01884.0
ScalaDaClassificationScandEval/scala-daA modified version of DDT modified for linguistic acceptability classificationClassifications2s110242562048107.6100.8109.4
ScalaNbClassificationScandEval/scala-nbA Norwegian dataset for linguistic acceptability classification for BokmålClassifications2s11024256204895.594.898.4
ScalaNnClassificationScandEval/scala-nnA Norwegian dataset for linguistic acceptability classification for NynorskClassifications2s110242562048105.3103.5104.8
ScalaSvClassificationScandEval/scala-svA Swedish dataset for linguistic acceptability classificationClassifications2s110242562048102.6113.098.3
SweRecClassificitionScandEval/swerec-miniA Swedish dataset for sentiment classification on reviewsClassifications2s110242562048317.7293.4318.8
CBDPL-MTEB/cbdPolish Tweets annotated for cyberbullying detection.Classifications2s1100410100093.6093.2
PolEmo2.0-INPL-MTEB/polemo2_inA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-IN task is to predict the sentiment of in-domain (medicine and hotels) reviews.Classifications2s15783723722780.6769.4756.2
PolEmo2.0-OUTPL-MTEB/polemo2_outA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-OUT task is to predict the sentiment of out-of-domain (products and school) reviews using models train on reviews from medicine and hotels domains.Classifications2s15783494494780.6589.3587.0
AllegroReviewsPL-MTEB/allegro-reviewsA Polish dataset for sentiment classification on reviews from e-commerce marketplace Allegro.Classifications2s1957710021006477.9480.9477.2
PAClaugustyniak/abusive-clauses-plPolish Abusive Clauses DatasetClassifications2s1428415193453185.3256.8185.3
ArxivClusteringP2Pmteb/arxiv-clustering-p2pClustering of titles+abstract from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusteringp2p100732723001009.9
ArxivClusteringS2Smteb/arxiv-clustering-s2sClustering of titles from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusterings2s1007327230074.0
BiorxivClusteringP2Pmteb/biorxiv-clustering-p2pClustering of titles+abstract from biorxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10075000001666.2
BiorxivClusteringS2Smteb/biorxiv-clustering-s2sClustering of titles from biorxiv. Clustering of 10 sets, based on the main category.Clusterings2s1007500000101.6
BlurbsClusteringP2Pslvnwhrl/blurbs-clustering-p2pClustering of book titles+blurbs. Clustering of 28 sets, either on the main or secondary genreClusteringp2p10017463700664.09
BlurbsClusteringS2Sslvnwhrl/blurbs-clustering-s2sClustering of book titles. Clustering of 28 sets, either on the main or secondary genre.Clusterings2s1001746370023.02
MedrxivClusteringP2Pmteb/medrxiv-clustering-p2pClustering of titles+abstract from medrxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10037500001981.2
MedrxivClusteringS2Smteb/medrxiv-clustering-s2sClustering of titles from medrxiv. Clustering of 10 sets, based on the main category.Clusterings2s1003750000114.7
RedditClusteringmteb/reddit-clusteringClustering of titles from 199 subreddits. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s1004204640064.7
RedditClusteringP2Pmteb/reddit-clustering-p2pClustering of title+posts from reddit. Clustering of 10 sets of 50k paragraphs and 40 sets of 10k paragraphs.Clusteringp2p10045939900727.7
StackExchangeClusteringmteb/stackexchange-clusteringClustering of titles from 121 stackexchanges. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s10417060373850056.857.0
StackExchangeClusteringP2Pmteb/stackexchange-clustering-p2pClustering of title+body from stackexchange. Clustering of 5 sets of 10k paragraphs and 5 sets of 5k paragraphs.Clusteringp2p10075000001090.7
TenKGnadClusteringP2Pslvnwhrl/tenkgnad-clustering-p2pClustering of news article titles+subheadings+texts. Clustering of 10 splits on the news article category.Clusteringp2p10045914002641.03
TenKGnadClusteringS2Sslvnwhrl/tenkgnad-clustering-s2sClustering of news article titles. Clustering of 10 splits on the news article category.Clusterings2s100459140050.96
TwentyNewsgroupsClusteringmteb/twentynewsgroups-clusteringClustering of the 20 Newsgroups dataset (subject only).Clusterings2s100595450032.0
8TagsClusteringPL-MTEB/8tags-clusteringClustering of headlines from social media posts in Polish belonging to 8 categories: film, history, food, medicine, motorization, work, sport and technology.Clusterings2s1400015000437278.277.679.2
SprintDuplicateQuestionsmteb/sprintduplicatequestions-pairclassificationDuplicate questions from the Sprint community.PairClassifications2s10101000101000065.267.9
TwitterSemEval2015mteb/twittersemeval2015-pairclassificationParaphrase-Pairs of Tweets from the SemEval 2015 workshop.PairClassifications2s100167770038.3
TwitterURLCorpusmteb/twitterurlcorpus-pairclassificationParaphrase-Pairs of Tweets.PairClassifications2s100515340079.5
PPCPL-MTEB/ppc-pairclassificationPolish Paraphrase CorpusPairClassifications2s150001000100041.041.040.2
PSCPL-MTEB/psc-pairclassificationPolish Summaries CorpusPairClassifications2s1430201078537.10549.3
SICK-E-PLPL-MTEB/sicke-pl-pairclassificationPolish version of SICK dataset for textual entailment.PairClassifications2s14439495490643.444.743.2
CDSC-EPL-MTEB/cdsce-pairclassificationCompositional Distributional Semantics Corpus for textual entailment.PairClassifications2s180001000100071.973.575.2
AskUbuntuDupQuestionsmteb/askubuntudupquestions-rerankingAskUbuntu Question Dataset - Questions from AskUbuntu with manual annotations marking pairs of questions as similar or non-similarRerankings2s10022550052.5
MindSmallRerankingmteb/mind_smallMicrosoft News Dataset: A Large-Scale English Dataset for News Recommendation ResearchRerankings2s1231530010796869.0070.9
SciDocsRRmteb/scidocs-rerankingRanking of related scientific papers based on their title.Rerankings2s101959419599069.469.0
StackOverflowDupQuestionsmteb/stackoverflowdupquestions-rerankingStack Overflow Duplicate Questions Task for questions with the tags Java, JavaScript and PythonRerankings2s1230180346749.6049.8
ArguAnaBeIR/arguanaNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
ClimateFEVERBeIR/climate-feverCLIMATE-FEVER is a dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change.Retrievals2p100541812800539.1
CQADupstackAndroidRetrievalBeIR/cqadupstack/androidCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1002369700578.7
CQADupstackEnglishRetrievalBeIR/cqadupstack/englishCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004179100467.1
CQADupstackGamingRetrievalBeIR/cqadupstack/gamingCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004689600474.7
CQADupstackGisRetrievalBeIR/cqadupstack/gisCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003852200991.1
CQADupstackMathematicaRetrievalBeIR/cqadupstack/mathematicaCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10017509001103.7
CQADupstackPhysicsRetrievalBeIR/cqadupstack/physicsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003935500799.4
CQADupstackProgrammersRetrievalBeIR/cqadupstack/programmersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10033052001030.2
CQADupstackStatsRetrievalBeIR/cqadupstack/statsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10042921001041.0
CQADupstackTexRetrievalBeIR/cqadupstack/texCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10071090001246.9
CQADupstackUnixRetrievalBeIR/cqadupstack/unixCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004845400984.7
CQADupstackWebmastersRetrievalBeIR/cqadupstack/webmastersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1001791100689.8
CQADupstackWordpressRetrievalBeIR/cqadupstack/wordpressCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10049146001111.9
DBPediaBeIR/dbpedia-entityDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FEVERBeIR/feverFEVER (Fact Extraction and VERification) consists of 185,445 claims generated by altering sentences extracted from Wikipedia and subsequently verified without knowledge of the sentence they were derived from.Retrievals2p100542323400538.6
FiQA2018BeIR/fiqaFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQABeIR/hotpotqaHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCOBeIR/msmarcoMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
MSMARCOv2BeIR/msmarco-v2MS MARCO is a collection of datasets focused on deep learning in searchRetrievals2p11386413421383681010341.4342.00
NFCorpusBeIR/nfcorpusNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQBeIR/nqNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p100268492000492.7
QuoraRetrievalBeIR/quoraQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCSBeIR/scidocsSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFactBeIR/scifactSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
Touche2020BeIR/webis-touche2020Touché Task 1: Argument Retrieval for Controversial QuestionsRetrievals2p100382594001720.1
TRECCOVIDBeIR/trec-covidTRECCOVID is an ad-hoc search challenge based on the CORD-19 dataset containing scientific articles related to the COVID-19 pandemicRetrievals2p100171382001117.4
ArguAna-PLBeIR-PL/arguana-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
DBPedia-PLBeIR-PL/dbpedia-plDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FiQA-PLBeIR-PL/fiqa-plFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQA-PLBeIR-PL/hotpotqa-plHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCO-PLBeIR-PL/msmarco-plMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
NFCorpus-PLBeIR-PL/nfcorpus-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQ-PLBeIR-PL/nq-plNatural Questions: A Benchmark for Question Answering ResearchRetrievals2p100268492000492.7
Quora-PLBeIR-PL/quora-plQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCS-PLBeIR-PL/scidocs-plSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFact-PLBeIR-PL/scifact-plSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
SweFAQAI-Sweden/SuperLimFrequently asked questions from Swedish authorities' websitesRetrievals2p10051300390.57
BIOSSESmteb/biosses-stsBiomedical Semantic Similarity Estimation.STSs2s10020000156.6
SICK-Rmteb/sickr-stsSemantic Textual Similarity SICK-R dataset as described here:STSs2s100198540046.1
STS12mteb/sts12-stsSemEval STS 2012 dataset.STSs2s1446806216100.7064.7
STS13mteb/sts13-stsSemEval STS 2013 dataset.STSs2s10030000054.0
STS14mteb/sts14-stsSemEval STS 2014 dataset. Currently only the English datasetSTSs2s10075000054.3
STS15mteb/sts15-stsSemEval STS 2015 datasetSTSs2s10060000057.7
STS16mteb/sts16-stsSemEval STS 2016 datasetSTSs2s10023720065.3
STS17mteb/sts17-crosslingual-stsSTS 2017 datasetSTSs2s11005000043.3
STS22mteb/sts22-crosslingual-stsSemEval 2022 Task 8: Multilingual News Article SimilaritySTSs2s18008060001992.8
STSBenchmarkmteb/stsbenchmark-stsSemantic Textual Similarity Benchmark (STSbenchmark) dataset.STSs2s1114983000275857.664.053.6
SICK-R-PLPL-MTEB/sickr-pl-stsPolish version of SICK dataset for textual relatedness.STSs2s18878990981242.944.042.8
CDSC-RPL-MTEB/cdscr-stsCompositional Distributional Semantics Corpus for textual relatedness.STSs2s1160002000200072.173.275.0
SummEvalmteb/summevalNews Article Summary Semantic Similarity Estimation.Summarizations2s100280000359.8

For Chinese tasks, you can refer to C_MTEB.

Citation

If you find MTEB useful, feel free to cite our publication MTEB: Massive Text Embedding Benchmark:

@article{muennighoff2022mteb,
doi = {10.48550/ARXIV.2210.07316},
url = {https://arxiv.org/abs/2210.07316},
author = {Muennighoff, Niklas and Tazi, Nouamane and Magne, Lo{\"\i}c and Reimers, Nils},
title = {MTEB: Massive Text Embedding Benchmark},
publisher = {arXiv},
journal={arXiv preprint arXiv:2210.07316}, year = {2022}
}

About

MTEB: Massive Text Embedding Benchmark

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - Clibrain/MSTEB: MTEB: Massive Text Embedding Benchmark · GitHub
Skip to content

Repository files navigation

Massive Text Embedding Benchmark

GitHub releaseGitHub releaseBuildLicenseDownloads

Installation

pip install mteb

Usage

frommtebimportMTEBfromsentence_transformersimportSentenceTransformer# Define the sentence-transformers model namemodel_name="average_word_embeddings_komninos"model=SentenceTransformer(model_name)
evaluation=MTEB(tasks=["Banking77Classification"])
results=evaluation.run(model, output_folder=f"results/{model_name}")
  • Using CLI
mteb --available_tasks
mteb -m average_word_embeddings_komninos \
-t Banking77Classification \
--output_folder results/average_word_embeddings_komninos \
--verbosity 3
  • Using multiple GPUs in parallel can be done by just having a custom encode function that distributes the inputs to multiple GPUs like e.g. here. For retrieval tasks you can also use the below (see scripts/retrieval.slurm for multi-node slurm script example):
pipinstallgit+https://github.com/NouamaneTazi/beir@nouamane/better-multi-gpu# Run on 2 gpustorchrun--nproc_per_node=2scripts/retrieval_multigpu.py

Advanced usage

Dataset selection

Datasets can be selected by providing the list of datasets, but also

  • by their task (e.g. "Clustering" or "Classification")
evaluation=MTEB(task_types=['Clustering', 'Retrieval']) # Only select clustering and retrieval tasks
  • by their categories e.g. "S2S" (sentence to sentence) or "P2P" (paragraph to paragraph)
evaluation=MTEB(task_categories=['S2S']) # Only select sentence2sentence datasets
  • by their languages
evaluation=MTEB(task_langs=["en", "de"]) # Only select datasets which are "en", "de" or "en-de"

You can also specify which languages to load for multilingual/crosslingual tasks like below:

frommteb.tasksimportAmazonReviewsClassification, BUCCBitextMiningevaluation=MTEB(tasks=[
AmazonReviewsClassification(langs=["en", "fr"]) # Only load "en" and "fr" subsets of Amazon ReviewsBUCCBitextMining(langs=["de-en"]), # Only load "de-en" subset of BUCC
])

Evaluation split

You can evaluate only on test splits of all tasks by doing the following:

evaluation.run(model, eval_splits=["test"])

Note that the public leaderboard uses the test splits for all datasets except MSMARCO, where the "dev" split is used.

Using a custom model

Models should implement the following interface, implementing an encode function taking as inputs a list of sentences, and returning a list of embeddings (embeddings can be np.array, torch.tensor, etc.). For inspiration, you can look at the mteb/mtebscripts repo used for running diverse models via SLURM scripts for the paper.

classMyModel():
defencode(self, sentences, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: sentences (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passmodel=MyModel()
evaluation=MTEB(tasks=["Banking77Classification"])
evaluation.run(model)

If you'd like to use different encoding functions for query and corpus when evaluating on Retrieval or Reranking tasks, you can add separate methods for encode_queries and encode_corpus. If these methods exist, they will be automatically used for those tasks. You can refer to the DRESModel at mteb/mteb/abstasks/AbsTaskRetrieval.py for an example of these functions.

classMyModel():
defencode_queries(self, queries, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: queries (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passdefencode_corpus(self, corpus, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: corpus (`List[str]` or `List[Dict[str, str]]`): List of sentences to encode or list of dictionaries with keys "title" and "text" batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """pass

Evaluating on a custom task

To add a new task, you need to implement a new class that inherits from the AbsTask associated with the task type (e.g. AbsTaskReranking for reranking tasks). You can find the supported task types in here.

frommtebimportMTEBfrommteb.abstasks.AbsTaskRerankingimportAbsTaskRerankingfromsentence_transformersimportSentenceTransformerclassMindSmallReranking(AbsTaskReranking):
@propertydefdescription(self):
return {
"name": "MindSmallReranking",
"hf_hub_name": "mteb/mind_small",
"description": "Microsoft News Dataset: A Large-Scale English Dataset for News Recommendation Research",
"reference": "https://www.microsoft.com/en-us/research/uploads/prod/2019/03/nl4se18LinkSO.pdf",
"type": "Reranking",
"category": "s2s",
"eval_splits": ["validation"],
"eval_langs": ["en"],
"main_score": "map",
}
model=SentenceTransformer("average_word_embeddings_komninos")
evaluation=MTEB(tasks=[MindSmallReranking()])
evaluation.run(model)

Note: for multilingual tasks, make sure your class also inherits from the MultilingualTask class like in this example.

Leaderboard

The MTEB Leaderboard is available here. To submit:

  1. Run on MTEB: You can reference scripts/run_mteb_english.py for all MTEB English datasets used in the main ranking, or scripts/run_mteb_chinese.py for the Chinese ones. Advanced scripts with different models are available in the mteb/mtebscripts repo.
  2. Format the json files into metadata using the script at scripts/mteb_meta.py. For example python scripts/mteb_meta.py path_to_results_folder, which will create a mteb_metadata.md file. If you ran CQADupstack retrieval, make sure to merge the results first with python scripts/merge_cqadupstack.py path_to_results_folder.
  3. Copy the content of the mteb_metadata.md file to the top of a README.md file of your model on the Hub. See here for an example.
  4. Hit the Refresh button at the bottom of the leaderboard and you should see your scores 🥇
  5. To have the scores appear without refreshing, you can open an issue on the Community Tab of the LB and someone will restart the space to cache your average scores. The cache is updated anyways ~1x/week.

Available tasks

NameHub URLDescriptionTypeCategory#LanguagesTrain #SamplesDev #SamplesTest #SamplesAvg. chars / trainAvg. chars / devAvg. chars / test
BUCCmteb/bucc-bitext-miningBUCC bitext mining datasetBitextMinings2s40064168400101.3
Tatoebamteb/tatoeba-bitext-mining1,000 English-aligned sentence pairs for each language based on the Tatoeba corpusBitextMinings2s1120020000039.4
Bornholm parallelstrombergnlp/bornholmsk_parallelDanish Bornholmsk Parallel Corpus.BitextMinings2s210010010064.686.289.7
AmazonCounterfactualClassificationmteb/amazon_counterfactualA collection of Amazon customer reviews annotated for counterfactual detection pair classification.Classifications2s44018335670107.3109.2106.1
AmazonPolarityClassificationmteb/amazon_polarityAmazon Polarity Classification Dataset.Classifications2s136000000400000431.60431.4
AmazonReviewsClassificationmteb/amazon_reviews_multiA collection of Amazon reviews specifically designed to aid research in multilingual text classification.Classifications2s612000003000030000160.5159.2160.4
Banking77Classificationmteb/banking77Dataset composed of online banking queries annotated with their corresponding intents.Classifications2s1100030308059.5054.2
EmotionClassificationmteb/emotionEmotion is a dataset of English Twitter messages with six basic emotions: anger, fear, joy, love, sadness, and surprise. For more detailed information please refer to the paper.Classifications2s1160002000200096.895.396.6
ImdbClassificationmteb/imdbLarge Movie Review DatasetClassificationp2p1250000250001325.101293.8
MassiveIntentClassificationmteb/amazon_massive_intentMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MassiveScenarioClassificationmteb/amazon_massive_scenarioMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MTOPDomainClassificationmteb/mtop_domainMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
MTOPIntentClassificationmteb/mtop_intentMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
ToxicConversationsClassificationmteb/toxic_conversations_50kCollection of comments from the Civil Comments platform together with annotations if the comment is toxic or not.Classifications2s150000050000298.80296.6
TweetSentimentExtractionClassificationmteb/tweet_sentiment_extractionClassifications2s1274810353468.3067.8
AngryTweetsClassificationmteb/DDSC/angry-tweetsA sentiment dataset with 3 classes (positiv, negativ, neutral) for Danish tweetsClassifications2s1241001050153.00156.1
DKHateClassificationDDSC/dkhateDanish Tweets annotated for Hate SpeechClassifications2s12960032988.20104.0
DalajClassificationAI-Sweden/SuperLimA Swedish dataset for linguistic accebtablity. Available as a part of SuperlimClassifications2s13840445444243.7242.5243.8
DanishPoliticalCommentsClassificationdanish_political_commentsA dataset of Danish political comments rated for sentimentClassifications2s190100069.900
LccClassificationDDSC/lccThe leipzig corpora collection, annotated for sentimentClassifications2s13490150113.50118.7
NoRecClassificationScandEval/norec-miniA Norwegian dataset for sentiment classification on reviewClassifications2s11020256205086.989.682.0
NordicLangClassificationstrombergnlp/nordic_langidA dataset for Nordic language identification.Classifications2s6570000300078.4078.2
NorwegianParliamentClassificationNbAiLab/norwegian_parliamentNorwegian parliament speeches annotated for sentimentClassifications2s13600120012001773.61911.01884.0
ScalaDaClassificationScandEval/scala-daA modified version of DDT modified for linguistic acceptability classificationClassifications2s110242562048107.6100.8109.4
ScalaNbClassificationScandEval/scala-nbA Norwegian dataset for linguistic acceptability classification for BokmålClassifications2s11024256204895.594.898.4
ScalaNnClassificationScandEval/scala-nnA Norwegian dataset for linguistic acceptability classification for NynorskClassifications2s110242562048105.3103.5104.8
ScalaSvClassificationScandEval/scala-svA Swedish dataset for linguistic acceptability classificationClassifications2s110242562048102.6113.098.3
SweRecClassificitionScandEval/swerec-miniA Swedish dataset for sentiment classification on reviewsClassifications2s110242562048317.7293.4318.8
CBDPL-MTEB/cbdPolish Tweets annotated for cyberbullying detection.Classifications2s1100410100093.6093.2
PolEmo2.0-INPL-MTEB/polemo2_inA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-IN task is to predict the sentiment of in-domain (medicine and hotels) reviews.Classifications2s15783723722780.6769.4756.2
PolEmo2.0-OUTPL-MTEB/polemo2_outA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-OUT task is to predict the sentiment of out-of-domain (products and school) reviews using models train on reviews from medicine and hotels domains.Classifications2s15783494494780.6589.3587.0
AllegroReviewsPL-MTEB/allegro-reviewsA Polish dataset for sentiment classification on reviews from e-commerce marketplace Allegro.Classifications2s1957710021006477.9480.9477.2
PAClaugustyniak/abusive-clauses-plPolish Abusive Clauses DatasetClassifications2s1428415193453185.3256.8185.3
ArxivClusteringP2Pmteb/arxiv-clustering-p2pClustering of titles+abstract from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusteringp2p100732723001009.9
ArxivClusteringS2Smteb/arxiv-clustering-s2sClustering of titles from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusterings2s1007327230074.0
BiorxivClusteringP2Pmteb/biorxiv-clustering-p2pClustering of titles+abstract from biorxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10075000001666.2
BiorxivClusteringS2Smteb/biorxiv-clustering-s2sClustering of titles from biorxiv. Clustering of 10 sets, based on the main category.Clusterings2s1007500000101.6
BlurbsClusteringP2Pslvnwhrl/blurbs-clustering-p2pClustering of book titles+blurbs. Clustering of 28 sets, either on the main or secondary genreClusteringp2p10017463700664.09
BlurbsClusteringS2Sslvnwhrl/blurbs-clustering-s2sClustering of book titles. Clustering of 28 sets, either on the main or secondary genre.Clusterings2s1001746370023.02
MedrxivClusteringP2Pmteb/medrxiv-clustering-p2pClustering of titles+abstract from medrxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10037500001981.2
MedrxivClusteringS2Smteb/medrxiv-clustering-s2sClustering of titles from medrxiv. Clustering of 10 sets, based on the main category.Clusterings2s1003750000114.7
RedditClusteringmteb/reddit-clusteringClustering of titles from 199 subreddits. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s1004204640064.7
RedditClusteringP2Pmteb/reddit-clustering-p2pClustering of title+posts from reddit. Clustering of 10 sets of 50k paragraphs and 40 sets of 10k paragraphs.Clusteringp2p10045939900727.7
StackExchangeClusteringmteb/stackexchange-clusteringClustering of titles from 121 stackexchanges. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s10417060373850056.857.0
StackExchangeClusteringP2Pmteb/stackexchange-clustering-p2pClustering of title+body from stackexchange. Clustering of 5 sets of 10k paragraphs and 5 sets of 5k paragraphs.Clusteringp2p10075000001090.7
TenKGnadClusteringP2Pslvnwhrl/tenkgnad-clustering-p2pClustering of news article titles+subheadings+texts. Clustering of 10 splits on the news article category.Clusteringp2p10045914002641.03
TenKGnadClusteringS2Sslvnwhrl/tenkgnad-clustering-s2sClustering of news article titles. Clustering of 10 splits on the news article category.Clusterings2s100459140050.96
TwentyNewsgroupsClusteringmteb/twentynewsgroups-clusteringClustering of the 20 Newsgroups dataset (subject only).Clusterings2s100595450032.0
8TagsClusteringPL-MTEB/8tags-clusteringClustering of headlines from social media posts in Polish belonging to 8 categories: film, history, food, medicine, motorization, work, sport and technology.Clusterings2s1400015000437278.277.679.2
SprintDuplicateQuestionsmteb/sprintduplicatequestions-pairclassificationDuplicate questions from the Sprint community.PairClassifications2s10101000101000065.267.9
TwitterSemEval2015mteb/twittersemeval2015-pairclassificationParaphrase-Pairs of Tweets from the SemEval 2015 workshop.PairClassifications2s100167770038.3
TwitterURLCorpusmteb/twitterurlcorpus-pairclassificationParaphrase-Pairs of Tweets.PairClassifications2s100515340079.5
PPCPL-MTEB/ppc-pairclassificationPolish Paraphrase CorpusPairClassifications2s150001000100041.041.040.2
PSCPL-MTEB/psc-pairclassificationPolish Summaries CorpusPairClassifications2s1430201078537.10549.3
SICK-E-PLPL-MTEB/sicke-pl-pairclassificationPolish version of SICK dataset for textual entailment.PairClassifications2s14439495490643.444.743.2
CDSC-EPL-MTEB/cdsce-pairclassificationCompositional Distributional Semantics Corpus for textual entailment.PairClassifications2s180001000100071.973.575.2
AskUbuntuDupQuestionsmteb/askubuntudupquestions-rerankingAskUbuntu Question Dataset - Questions from AskUbuntu with manual annotations marking pairs of questions as similar or non-similarRerankings2s10022550052.5
MindSmallRerankingmteb/mind_smallMicrosoft News Dataset: A Large-Scale English Dataset for News Recommendation ResearchRerankings2s1231530010796869.0070.9
SciDocsRRmteb/scidocs-rerankingRanking of related scientific papers based on their title.Rerankings2s101959419599069.469.0
StackOverflowDupQuestionsmteb/stackoverflowdupquestions-rerankingStack Overflow Duplicate Questions Task for questions with the tags Java, JavaScript and PythonRerankings2s1230180346749.6049.8
ArguAnaBeIR/arguanaNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
ClimateFEVERBeIR/climate-feverCLIMATE-FEVER is a dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change.Retrievals2p100541812800539.1
CQADupstackAndroidRetrievalBeIR/cqadupstack/androidCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1002369700578.7
CQADupstackEnglishRetrievalBeIR/cqadupstack/englishCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004179100467.1
CQADupstackGamingRetrievalBeIR/cqadupstack/gamingCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004689600474.7
CQADupstackGisRetrievalBeIR/cqadupstack/gisCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003852200991.1
CQADupstackMathematicaRetrievalBeIR/cqadupstack/mathematicaCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10017509001103.7
CQADupstackPhysicsRetrievalBeIR/cqadupstack/physicsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003935500799.4
CQADupstackProgrammersRetrievalBeIR/cqadupstack/programmersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10033052001030.2
CQADupstackStatsRetrievalBeIR/cqadupstack/statsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10042921001041.0
CQADupstackTexRetrievalBeIR/cqadupstack/texCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10071090001246.9
CQADupstackUnixRetrievalBeIR/cqadupstack/unixCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004845400984.7
CQADupstackWebmastersRetrievalBeIR/cqadupstack/webmastersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1001791100689.8
CQADupstackWordpressRetrievalBeIR/cqadupstack/wordpressCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10049146001111.9
DBPediaBeIR/dbpedia-entityDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FEVERBeIR/feverFEVER (Fact Extraction and VERification) consists of 185,445 claims generated by altering sentences extracted from Wikipedia and subsequently verified without knowledge of the sentence they were derived from.Retrievals2p100542323400538.6
FiQA2018BeIR/fiqaFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQABeIR/hotpotqaHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCOBeIR/msmarcoMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
MSMARCOv2BeIR/msmarco-v2MS MARCO is a collection of datasets focused on deep learning in searchRetrievals2p11386413421383681010341.4342.00
NFCorpusBeIR/nfcorpusNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQBeIR/nqNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p100268492000492.7
QuoraRetrievalBeIR/quoraQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCSBeIR/scidocsSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFactBeIR/scifactSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
Touche2020BeIR/webis-touche2020Touché Task 1: Argument Retrieval for Controversial QuestionsRetrievals2p100382594001720.1
TRECCOVIDBeIR/trec-covidTRECCOVID is an ad-hoc search challenge based on the CORD-19 dataset containing scientific articles related to the COVID-19 pandemicRetrievals2p100171382001117.4
ArguAna-PLBeIR-PL/arguana-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
DBPedia-PLBeIR-PL/dbpedia-plDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FiQA-PLBeIR-PL/fiqa-plFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQA-PLBeIR-PL/hotpotqa-plHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCO-PLBeIR-PL/msmarco-plMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
NFCorpus-PLBeIR-PL/nfcorpus-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQ-PLBeIR-PL/nq-plNatural Questions: A Benchmark for Question Answering ResearchRetrievals2p100268492000492.7
Quora-PLBeIR-PL/quora-plQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCS-PLBeIR-PL/scidocs-plSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFact-PLBeIR-PL/scifact-plSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
SweFAQAI-Sweden/SuperLimFrequently asked questions from Swedish authorities' websitesRetrievals2p10051300390.57
BIOSSESmteb/biosses-stsBiomedical Semantic Similarity Estimation.STSs2s10020000156.6
SICK-Rmteb/sickr-stsSemantic Textual Similarity SICK-R dataset as described here:STSs2s100198540046.1
STS12mteb/sts12-stsSemEval STS 2012 dataset.STSs2s1446806216100.7064.7
STS13mteb/sts13-stsSemEval STS 2013 dataset.STSs2s10030000054.0
STS14mteb/sts14-stsSemEval STS 2014 dataset. Currently only the English datasetSTSs2s10075000054.3
STS15mteb/sts15-stsSemEval STS 2015 datasetSTSs2s10060000057.7
STS16mteb/sts16-stsSemEval STS 2016 datasetSTSs2s10023720065.3
STS17mteb/sts17-crosslingual-stsSTS 2017 datasetSTSs2s11005000043.3
STS22mteb/sts22-crosslingual-stsSemEval 2022 Task 8: Multilingual News Article SimilaritySTSs2s18008060001992.8
STSBenchmarkmteb/stsbenchmark-stsSemantic Textual Similarity Benchmark (STSbenchmark) dataset.STSs2s1114983000275857.664.053.6
SICK-R-PLPL-MTEB/sickr-pl-stsPolish version of SICK dataset for textual relatedness.STSs2s18878990981242.944.042.8
CDSC-RPL-MTEB/cdscr-stsCompositional Distributional Semantics Corpus for textual relatedness.STSs2s1160002000200072.173.275.0
SummEvalmteb/summevalNews Article Summary Semantic Similarity Estimation.Summarizations2s100280000359.8

For Chinese tasks, you can refer to C_MTEB.

Citation

If you find MTEB useful, feel free to cite our publication MTEB: Massive Text Embedding Benchmark:

@article{muennighoff2022mteb,
doi = {10.48550/ARXIV.2210.07316},
url = {https://arxiv.org/abs/2210.07316},
author = {Muennighoff, Niklas and Tazi, Nouamane and Magne, Lo{\"\i}c and Reimers, Nils},
title = {MTEB: Massive Text Embedding Benchmark},
publisher = {arXiv},
journal={arXiv preprint arXiv:2210.07316}, year = {2022}
}

About

MTEB: Massive Text Embedding Benchmark

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - Clibrain/MSTEB: MTEB: Massive Text Embedding Benchmark · GitHub
Skip to content

Repository files navigation

Massive Text Embedding Benchmark

GitHub releaseGitHub releaseBuildLicenseDownloads

Installation

pip install mteb

Usage

frommtebimportMTEBfromsentence_transformersimportSentenceTransformer# Define the sentence-transformers model namemodel_name="average_word_embeddings_komninos"model=SentenceTransformer(model_name)
evaluation=MTEB(tasks=["Banking77Classification"])
results=evaluation.run(model, output_folder=f"results/{model_name}")
  • Using CLI
mteb --available_tasks
mteb -m average_word_embeddings_komninos \
-t Banking77Classification \
--output_folder results/average_word_embeddings_komninos \
--verbosity 3
  • Using multiple GPUs in parallel can be done by just having a custom encode function that distributes the inputs to multiple GPUs like e.g. here. For retrieval tasks you can also use the below (see scripts/retrieval.slurm for multi-node slurm script example):
pipinstallgit+https://github.com/NouamaneTazi/beir@nouamane/better-multi-gpu# Run on 2 gpustorchrun--nproc_per_node=2scripts/retrieval_multigpu.py

Advanced usage

Dataset selection

Datasets can be selected by providing the list of datasets, but also

  • by their task (e.g. "Clustering" or "Classification")
evaluation=MTEB(task_types=['Clustering', 'Retrieval']) # Only select clustering and retrieval tasks
  • by their categories e.g. "S2S" (sentence to sentence) or "P2P" (paragraph to paragraph)
evaluation=MTEB(task_categories=['S2S']) # Only select sentence2sentence datasets
  • by their languages
evaluation=MTEB(task_langs=["en", "de"]) # Only select datasets which are "en", "de" or "en-de"

You can also specify which languages to load for multilingual/crosslingual tasks like below:

frommteb.tasksimportAmazonReviewsClassification, BUCCBitextMiningevaluation=MTEB(tasks=[
AmazonReviewsClassification(langs=["en", "fr"]) # Only load "en" and "fr" subsets of Amazon ReviewsBUCCBitextMining(langs=["de-en"]), # Only load "de-en" subset of BUCC
])

Evaluation split

You can evaluate only on test splits of all tasks by doing the following:

evaluation.run(model, eval_splits=["test"])

Note that the public leaderboard uses the test splits for all datasets except MSMARCO, where the "dev" split is used.

Using a custom model

Models should implement the following interface, implementing an encode function taking as inputs a list of sentences, and returning a list of embeddings (embeddings can be np.array, torch.tensor, etc.). For inspiration, you can look at the mteb/mtebscripts repo used for running diverse models via SLURM scripts for the paper.

classMyModel():
defencode(self, sentences, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: sentences (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passmodel=MyModel()
evaluation=MTEB(tasks=["Banking77Classification"])
evaluation.run(model)

If you'd like to use different encoding functions for query and corpus when evaluating on Retrieval or Reranking tasks, you can add separate methods for encode_queries and encode_corpus. If these methods exist, they will be automatically used for those tasks. You can refer to the DRESModel at mteb/mteb/abstasks/AbsTaskRetrieval.py for an example of these functions.

classMyModel():
defencode_queries(self, queries, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: queries (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passdefencode_corpus(self, corpus, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: corpus (`List[str]` or `List[Dict[str, str]]`): List of sentences to encode or list of dictionaries with keys "title" and "text" batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """pass

Evaluating on a custom task

To add a new task, you need to implement a new class that inherits from the AbsTask associated with the task type (e.g. AbsTaskReranking for reranking tasks). You can find the supported task types in here.

frommtebimportMTEBfrommteb.abstasks.AbsTaskRerankingimportAbsTaskRerankingfromsentence_transformersimportSentenceTransformerclassMindSmallReranking(AbsTaskReranking):
@propertydefdescription(self):
return {
"name": "MindSmallReranking",
"hf_hub_name": "mteb/mind_small",
"description": "Microsoft News Dataset: A Large-Scale English Dataset for News Recommendation Research",
"reference": "https://www.microsoft.com/en-us/research/uploads/prod/2019/03/nl4se18LinkSO.pdf",
"type": "Reranking",
"category": "s2s",
"eval_splits": ["validation"],
"eval_langs": ["en"],
"main_score": "map",
}
model=SentenceTransformer("average_word_embeddings_komninos")
evaluation=MTEB(tasks=[MindSmallReranking()])
evaluation.run(model)

Note: for multilingual tasks, make sure your class also inherits from the MultilingualTask class like in this example.

Leaderboard

The MTEB Leaderboard is available here. To submit:

  1. Run on MTEB: You can reference scripts/run_mteb_english.py for all MTEB English datasets used in the main ranking, or scripts/run_mteb_chinese.py for the Chinese ones. Advanced scripts with different models are available in the mteb/mtebscripts repo.
  2. Format the json files into metadata using the script at scripts/mteb_meta.py. For example python scripts/mteb_meta.py path_to_results_folder, which will create a mteb_metadata.md file. If you ran CQADupstack retrieval, make sure to merge the results first with python scripts/merge_cqadupstack.py path_to_results_folder.
  3. Copy the content of the mteb_metadata.md file to the top of a README.md file of your model on the Hub. See here for an example.
  4. Hit the Refresh button at the bottom of the leaderboard and you should see your scores 🥇
  5. To have the scores appear without refreshing, you can open an issue on the Community Tab of the LB and someone will restart the space to cache your average scores. The cache is updated anyways ~1x/week.

Available tasks

NameHub URLDescriptionTypeCategory#LanguagesTrain #SamplesDev #SamplesTest #SamplesAvg. chars / trainAvg. chars / devAvg. chars / test
BUCCmteb/bucc-bitext-miningBUCC bitext mining datasetBitextMinings2s40064168400101.3
Tatoebamteb/tatoeba-bitext-mining1,000 English-aligned sentence pairs for each language based on the Tatoeba corpusBitextMinings2s1120020000039.4
Bornholm parallelstrombergnlp/bornholmsk_parallelDanish Bornholmsk Parallel Corpus.BitextMinings2s210010010064.686.289.7
AmazonCounterfactualClassificationmteb/amazon_counterfactualA collection of Amazon customer reviews annotated for counterfactual detection pair classification.Classifications2s44018335670107.3109.2106.1
AmazonPolarityClassificationmteb/amazon_polarityAmazon Polarity Classification Dataset.Classifications2s136000000400000431.60431.4
AmazonReviewsClassificationmteb/amazon_reviews_multiA collection of Amazon reviews specifically designed to aid research in multilingual text classification.Classifications2s612000003000030000160.5159.2160.4
Banking77Classificationmteb/banking77Dataset composed of online banking queries annotated with their corresponding intents.Classifications2s1100030308059.5054.2
EmotionClassificationmteb/emotionEmotion is a dataset of English Twitter messages with six basic emotions: anger, fear, joy, love, sadness, and surprise. For more detailed information please refer to the paper.Classifications2s1160002000200096.895.396.6
ImdbClassificationmteb/imdbLarge Movie Review DatasetClassificationp2p1250000250001325.101293.8
MassiveIntentClassificationmteb/amazon_massive_intentMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MassiveScenarioClassificationmteb/amazon_massive_scenarioMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MTOPDomainClassificationmteb/mtop_domainMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
MTOPIntentClassificationmteb/mtop_intentMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
ToxicConversationsClassificationmteb/toxic_conversations_50kCollection of comments from the Civil Comments platform together with annotations if the comment is toxic or not.Classifications2s150000050000298.80296.6
TweetSentimentExtractionClassificationmteb/tweet_sentiment_extractionClassifications2s1274810353468.3067.8
AngryTweetsClassificationmteb/DDSC/angry-tweetsA sentiment dataset with 3 classes (positiv, negativ, neutral) for Danish tweetsClassifications2s1241001050153.00156.1
DKHateClassificationDDSC/dkhateDanish Tweets annotated for Hate SpeechClassifications2s12960032988.20104.0
DalajClassificationAI-Sweden/SuperLimA Swedish dataset for linguistic accebtablity. Available as a part of SuperlimClassifications2s13840445444243.7242.5243.8
DanishPoliticalCommentsClassificationdanish_political_commentsA dataset of Danish political comments rated for sentimentClassifications2s190100069.900
LccClassificationDDSC/lccThe leipzig corpora collection, annotated for sentimentClassifications2s13490150113.50118.7
NoRecClassificationScandEval/norec-miniA Norwegian dataset for sentiment classification on reviewClassifications2s11020256205086.989.682.0
NordicLangClassificationstrombergnlp/nordic_langidA dataset for Nordic language identification.Classifications2s6570000300078.4078.2
NorwegianParliamentClassificationNbAiLab/norwegian_parliamentNorwegian parliament speeches annotated for sentimentClassifications2s13600120012001773.61911.01884.0
ScalaDaClassificationScandEval/scala-daA modified version of DDT modified for linguistic acceptability classificationClassifications2s110242562048107.6100.8109.4
ScalaNbClassificationScandEval/scala-nbA Norwegian dataset for linguistic acceptability classification for BokmålClassifications2s11024256204895.594.898.4
ScalaNnClassificationScandEval/scala-nnA Norwegian dataset for linguistic acceptability classification for NynorskClassifications2s110242562048105.3103.5104.8
ScalaSvClassificationScandEval/scala-svA Swedish dataset for linguistic acceptability classificationClassifications2s110242562048102.6113.098.3
SweRecClassificitionScandEval/swerec-miniA Swedish dataset for sentiment classification on reviewsClassifications2s110242562048317.7293.4318.8
CBDPL-MTEB/cbdPolish Tweets annotated for cyberbullying detection.Classifications2s1100410100093.6093.2
PolEmo2.0-INPL-MTEB/polemo2_inA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-IN task is to predict the sentiment of in-domain (medicine and hotels) reviews.Classifications2s15783723722780.6769.4756.2
PolEmo2.0-OUTPL-MTEB/polemo2_outA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-OUT task is to predict the sentiment of out-of-domain (products and school) reviews using models train on reviews from medicine and hotels domains.Classifications2s15783494494780.6589.3587.0
AllegroReviewsPL-MTEB/allegro-reviewsA Polish dataset for sentiment classification on reviews from e-commerce marketplace Allegro.Classifications2s1957710021006477.9480.9477.2
PAClaugustyniak/abusive-clauses-plPolish Abusive Clauses DatasetClassifications2s1428415193453185.3256.8185.3
ArxivClusteringP2Pmteb/arxiv-clustering-p2pClustering of titles+abstract from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusteringp2p100732723001009.9
ArxivClusteringS2Smteb/arxiv-clustering-s2sClustering of titles from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusterings2s1007327230074.0
BiorxivClusteringP2Pmteb/biorxiv-clustering-p2pClustering of titles+abstract from biorxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10075000001666.2
BiorxivClusteringS2Smteb/biorxiv-clustering-s2sClustering of titles from biorxiv. Clustering of 10 sets, based on the main category.Clusterings2s1007500000101.6
BlurbsClusteringP2Pslvnwhrl/blurbs-clustering-p2pClustering of book titles+blurbs. Clustering of 28 sets, either on the main or secondary genreClusteringp2p10017463700664.09
BlurbsClusteringS2Sslvnwhrl/blurbs-clustering-s2sClustering of book titles. Clustering of 28 sets, either on the main or secondary genre.Clusterings2s1001746370023.02
MedrxivClusteringP2Pmteb/medrxiv-clustering-p2pClustering of titles+abstract from medrxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10037500001981.2
MedrxivClusteringS2Smteb/medrxiv-clustering-s2sClustering of titles from medrxiv. Clustering of 10 sets, based on the main category.Clusterings2s1003750000114.7
RedditClusteringmteb/reddit-clusteringClustering of titles from 199 subreddits. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s1004204640064.7
RedditClusteringP2Pmteb/reddit-clustering-p2pClustering of title+posts from reddit. Clustering of 10 sets of 50k paragraphs and 40 sets of 10k paragraphs.Clusteringp2p10045939900727.7
StackExchangeClusteringmteb/stackexchange-clusteringClustering of titles from 121 stackexchanges. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s10417060373850056.857.0
StackExchangeClusteringP2Pmteb/stackexchange-clustering-p2pClustering of title+body from stackexchange. Clustering of 5 sets of 10k paragraphs and 5 sets of 5k paragraphs.Clusteringp2p10075000001090.7
TenKGnadClusteringP2Pslvnwhrl/tenkgnad-clustering-p2pClustering of news article titles+subheadings+texts. Clustering of 10 splits on the news article category.Clusteringp2p10045914002641.03
TenKGnadClusteringS2Sslvnwhrl/tenkgnad-clustering-s2sClustering of news article titles. Clustering of 10 splits on the news article category.Clusterings2s100459140050.96
TwentyNewsgroupsClusteringmteb/twentynewsgroups-clusteringClustering of the 20 Newsgroups dataset (subject only).Clusterings2s100595450032.0
8TagsClusteringPL-MTEB/8tags-clusteringClustering of headlines from social media posts in Polish belonging to 8 categories: film, history, food, medicine, motorization, work, sport and technology.Clusterings2s1400015000437278.277.679.2
SprintDuplicateQuestionsmteb/sprintduplicatequestions-pairclassificationDuplicate questions from the Sprint community.PairClassifications2s10101000101000065.267.9
TwitterSemEval2015mteb/twittersemeval2015-pairclassificationParaphrase-Pairs of Tweets from the SemEval 2015 workshop.PairClassifications2s100167770038.3
TwitterURLCorpusmteb/twitterurlcorpus-pairclassificationParaphrase-Pairs of Tweets.PairClassifications2s100515340079.5
PPCPL-MTEB/ppc-pairclassificationPolish Paraphrase CorpusPairClassifications2s150001000100041.041.040.2
PSCPL-MTEB/psc-pairclassificationPolish Summaries CorpusPairClassifications2s1430201078537.10549.3
SICK-E-PLPL-MTEB/sicke-pl-pairclassificationPolish version of SICK dataset for textual entailment.PairClassifications2s14439495490643.444.743.2
CDSC-EPL-MTEB/cdsce-pairclassificationCompositional Distributional Semantics Corpus for textual entailment.PairClassifications2s180001000100071.973.575.2
AskUbuntuDupQuestionsmteb/askubuntudupquestions-rerankingAskUbuntu Question Dataset - Questions from AskUbuntu with manual annotations marking pairs of questions as similar or non-similarRerankings2s10022550052.5
MindSmallRerankingmteb/mind_smallMicrosoft News Dataset: A Large-Scale English Dataset for News Recommendation ResearchRerankings2s1231530010796869.0070.9
SciDocsRRmteb/scidocs-rerankingRanking of related scientific papers based on their title.Rerankings2s101959419599069.469.0
StackOverflowDupQuestionsmteb/stackoverflowdupquestions-rerankingStack Overflow Duplicate Questions Task for questions with the tags Java, JavaScript and PythonRerankings2s1230180346749.6049.8
ArguAnaBeIR/arguanaNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
ClimateFEVERBeIR/climate-feverCLIMATE-FEVER is a dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change.Retrievals2p100541812800539.1
CQADupstackAndroidRetrievalBeIR/cqadupstack/androidCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1002369700578.7
CQADupstackEnglishRetrievalBeIR/cqadupstack/englishCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004179100467.1
CQADupstackGamingRetrievalBeIR/cqadupstack/gamingCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004689600474.7
CQADupstackGisRetrievalBeIR/cqadupstack/gisCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003852200991.1
CQADupstackMathematicaRetrievalBeIR/cqadupstack/mathematicaCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10017509001103.7
CQADupstackPhysicsRetrievalBeIR/cqadupstack/physicsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003935500799.4
CQADupstackProgrammersRetrievalBeIR/cqadupstack/programmersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10033052001030.2
CQADupstackStatsRetrievalBeIR/cqadupstack/statsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10042921001041.0
CQADupstackTexRetrievalBeIR/cqadupstack/texCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10071090001246.9
CQADupstackUnixRetrievalBeIR/cqadupstack/unixCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004845400984.7
CQADupstackWebmastersRetrievalBeIR/cqadupstack/webmastersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1001791100689.8
CQADupstackWordpressRetrievalBeIR/cqadupstack/wordpressCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10049146001111.9
DBPediaBeIR/dbpedia-entityDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FEVERBeIR/feverFEVER (Fact Extraction and VERification) consists of 185,445 claims generated by altering sentences extracted from Wikipedia and subsequently verified without knowledge of the sentence they were derived from.Retrievals2p100542323400538.6
FiQA2018BeIR/fiqaFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQABeIR/hotpotqaHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCOBeIR/msmarcoMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
MSMARCOv2BeIR/msmarco-v2MS MARCO is a collection of datasets focused on deep learning in searchRetrievals2p11386413421383681010341.4342.00
NFCorpusBeIR/nfcorpusNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQBeIR/nqNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p100268492000492.7
QuoraRetrievalBeIR/quoraQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCSBeIR/scidocsSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFactBeIR/scifactSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
Touche2020BeIR/webis-touche2020Touché Task 1: Argument Retrieval for Controversial QuestionsRetrievals2p100382594001720.1
TRECCOVIDBeIR/trec-covidTRECCOVID is an ad-hoc search challenge based on the CORD-19 dataset containing scientific articles related to the COVID-19 pandemicRetrievals2p100171382001117.4
ArguAna-PLBeIR-PL/arguana-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
DBPedia-PLBeIR-PL/dbpedia-plDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FiQA-PLBeIR-PL/fiqa-plFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQA-PLBeIR-PL/hotpotqa-plHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCO-PLBeIR-PL/msmarco-plMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
NFCorpus-PLBeIR-PL/nfcorpus-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQ-PLBeIR-PL/nq-plNatural Questions: A Benchmark for Question Answering ResearchRetrievals2p100268492000492.7
Quora-PLBeIR-PL/quora-plQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCS-PLBeIR-PL/scidocs-plSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFact-PLBeIR-PL/scifact-plSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
SweFAQAI-Sweden/SuperLimFrequently asked questions from Swedish authorities' websitesRetrievals2p10051300390.57
BIOSSESmteb/biosses-stsBiomedical Semantic Similarity Estimation.STSs2s10020000156.6
SICK-Rmteb/sickr-stsSemantic Textual Similarity SICK-R dataset as described here:STSs2s100198540046.1
STS12mteb/sts12-stsSemEval STS 2012 dataset.STSs2s1446806216100.7064.7
STS13mteb/sts13-stsSemEval STS 2013 dataset.STSs2s10030000054.0
STS14mteb/sts14-stsSemEval STS 2014 dataset. Currently only the English datasetSTSs2s10075000054.3
STS15mteb/sts15-stsSemEval STS 2015 datasetSTSs2s10060000057.7
STS16mteb/sts16-stsSemEval STS 2016 datasetSTSs2s10023720065.3
STS17mteb/sts17-crosslingual-stsSTS 2017 datasetSTSs2s11005000043.3
STS22mteb/sts22-crosslingual-stsSemEval 2022 Task 8: Multilingual News Article SimilaritySTSs2s18008060001992.8
STSBenchmarkmteb/stsbenchmark-stsSemantic Textual Similarity Benchmark (STSbenchmark) dataset.STSs2s1114983000275857.664.053.6
SICK-R-PLPL-MTEB/sickr-pl-stsPolish version of SICK dataset for textual relatedness.STSs2s18878990981242.944.042.8
CDSC-RPL-MTEB/cdscr-stsCompositional Distributional Semantics Corpus for textual relatedness.STSs2s1160002000200072.173.275.0
SummEvalmteb/summevalNews Article Summary Semantic Similarity Estimation.Summarizations2s100280000359.8

For Chinese tasks, you can refer to C_MTEB.

Citation

If you find MTEB useful, feel free to cite our publication MTEB: Massive Text Embedding Benchmark:

@article{muennighoff2022mteb,
doi = {10.48550/ARXIV.2210.07316},
url = {https://arxiv.org/abs/2210.07316},
author = {Muennighoff, Niklas and Tazi, Nouamane and Magne, Lo{\"\i}c and Reimers, Nils},
title = {MTEB: Massive Text Embedding Benchmark},
publisher = {arXiv},
journal={arXiv preprint arXiv:2210.07316}, year = {2022}
}

About

MTEB: Massive Text Embedding Benchmark

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - Clibrain/MSTEB: MTEB: Massive Text Embedding Benchmark · GitHub
Skip to content

Repository files navigation

Massive Text Embedding Benchmark

GitHub releaseGitHub releaseBuildLicenseDownloads

Installation

pip install mteb

Usage

frommtebimportMTEBfromsentence_transformersimportSentenceTransformer# Define the sentence-transformers model namemodel_name="average_word_embeddings_komninos"model=SentenceTransformer(model_name)
evaluation=MTEB(tasks=["Banking77Classification"])
results=evaluation.run(model, output_folder=f"results/{model_name}")
  • Using CLI
mteb --available_tasks
mteb -m average_word_embeddings_komninos \
-t Banking77Classification \
--output_folder results/average_word_embeddings_komninos \
--verbosity 3
  • Using multiple GPUs in parallel can be done by just having a custom encode function that distributes the inputs to multiple GPUs like e.g. here. For retrieval tasks you can also use the below (see scripts/retrieval.slurm for multi-node slurm script example):
pipinstallgit+https://github.com/NouamaneTazi/beir@nouamane/better-multi-gpu# Run on 2 gpustorchrun--nproc_per_node=2scripts/retrieval_multigpu.py

Advanced usage

Dataset selection

Datasets can be selected by providing the list of datasets, but also

  • by their task (e.g. "Clustering" or "Classification")
evaluation=MTEB(task_types=['Clustering', 'Retrieval']) # Only select clustering and retrieval tasks
  • by their categories e.g. "S2S" (sentence to sentence) or "P2P" (paragraph to paragraph)
evaluation=MTEB(task_categories=['S2S']) # Only select sentence2sentence datasets
  • by their languages
evaluation=MTEB(task_langs=["en", "de"]) # Only select datasets which are "en", "de" or "en-de"

You can also specify which languages to load for multilingual/crosslingual tasks like below:

frommteb.tasksimportAmazonReviewsClassification, BUCCBitextMiningevaluation=MTEB(tasks=[
AmazonReviewsClassification(langs=["en", "fr"]) # Only load "en" and "fr" subsets of Amazon ReviewsBUCCBitextMining(langs=["de-en"]), # Only load "de-en" subset of BUCC
])

Evaluation split

You can evaluate only on test splits of all tasks by doing the following:

evaluation.run(model, eval_splits=["test"])

Note that the public leaderboard uses the test splits for all datasets except MSMARCO, where the "dev" split is used.

Using a custom model

Models should implement the following interface, implementing an encode function taking as inputs a list of sentences, and returning a list of embeddings (embeddings can be np.array, torch.tensor, etc.). For inspiration, you can look at the mteb/mtebscripts repo used for running diverse models via SLURM scripts for the paper.

classMyModel():
defencode(self, sentences, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: sentences (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passmodel=MyModel()
evaluation=MTEB(tasks=["Banking77Classification"])
evaluation.run(model)

If you'd like to use different encoding functions for query and corpus when evaluating on Retrieval or Reranking tasks, you can add separate methods for encode_queries and encode_corpus. If these methods exist, they will be automatically used for those tasks. You can refer to the DRESModel at mteb/mteb/abstasks/AbsTaskRetrieval.py for an example of these functions.

classMyModel():
defencode_queries(self, queries, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: queries (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passdefencode_corpus(self, corpus, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: corpus (`List[str]` or `List[Dict[str, str]]`): List of sentences to encode or list of dictionaries with keys "title" and "text" batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """pass

Evaluating on a custom task

To add a new task, you need to implement a new class that inherits from the AbsTask associated with the task type (e.g. AbsTaskReranking for reranking tasks). You can find the supported task types in here.

frommtebimportMTEBfrommteb.abstasks.AbsTaskRerankingimportAbsTaskRerankingfromsentence_transformersimportSentenceTransformerclassMindSmallReranking(AbsTaskReranking):
@propertydefdescription(self):
return {
"name": "MindSmallReranking",
"hf_hub_name": "mteb/mind_small",
"description": "Microsoft News Dataset: A Large-Scale English Dataset for News Recommendation Research",
"reference": "https://www.microsoft.com/en-us/research/uploads/prod/2019/03/nl4se18LinkSO.pdf",
"type": "Reranking",
"category": "s2s",
"eval_splits": ["validation"],
"eval_langs": ["en"],
"main_score": "map",
}
model=SentenceTransformer("average_word_embeddings_komninos")
evaluation=MTEB(tasks=[MindSmallReranking()])
evaluation.run(model)

Note: for multilingual tasks, make sure your class also inherits from the MultilingualTask class like in this example.

Leaderboard

The MTEB Leaderboard is available here. To submit:

  1. Run on MTEB: You can reference scripts/run_mteb_english.py for all MTEB English datasets used in the main ranking, or scripts/run_mteb_chinese.py for the Chinese ones. Advanced scripts with different models are available in the mteb/mtebscripts repo.
  2. Format the json files into metadata using the script at scripts/mteb_meta.py. For example python scripts/mteb_meta.py path_to_results_folder, which will create a mteb_metadata.md file. If you ran CQADupstack retrieval, make sure to merge the results first with python scripts/merge_cqadupstack.py path_to_results_folder.
  3. Copy the content of the mteb_metadata.md file to the top of a README.md file of your model on the Hub. See here for an example.
  4. Hit the Refresh button at the bottom of the leaderboard and you should see your scores 🥇
  5. To have the scores appear without refreshing, you can open an issue on the Community Tab of the LB and someone will restart the space to cache your average scores. The cache is updated anyways ~1x/week.

Available tasks

NameHub URLDescriptionTypeCategory#LanguagesTrain #SamplesDev #SamplesTest #SamplesAvg. chars / trainAvg. chars / devAvg. chars / test
BUCCmteb/bucc-bitext-miningBUCC bitext mining datasetBitextMinings2s40064168400101.3
Tatoebamteb/tatoeba-bitext-mining1,000 English-aligned sentence pairs for each language based on the Tatoeba corpusBitextMinings2s1120020000039.4
Bornholm parallelstrombergnlp/bornholmsk_parallelDanish Bornholmsk Parallel Corpus.BitextMinings2s210010010064.686.289.7
AmazonCounterfactualClassificationmteb/amazon_counterfactualA collection of Amazon customer reviews annotated for counterfactual detection pair classification.Classifications2s44018335670107.3109.2106.1
AmazonPolarityClassificationmteb/amazon_polarityAmazon Polarity Classification Dataset.Classifications2s136000000400000431.60431.4
AmazonReviewsClassificationmteb/amazon_reviews_multiA collection of Amazon reviews specifically designed to aid research in multilingual text classification.Classifications2s612000003000030000160.5159.2160.4
Banking77Classificationmteb/banking77Dataset composed of online banking queries annotated with their corresponding intents.Classifications2s1100030308059.5054.2
EmotionClassificationmteb/emotionEmotion is a dataset of English Twitter messages with six basic emotions: anger, fear, joy, love, sadness, and surprise. For more detailed information please refer to the paper.Classifications2s1160002000200096.895.396.6
ImdbClassificationmteb/imdbLarge Movie Review DatasetClassificationp2p1250000250001325.101293.8
MassiveIntentClassificationmteb/amazon_massive_intentMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MassiveScenarioClassificationmteb/amazon_massive_scenarioMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MTOPDomainClassificationmteb/mtop_domainMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
MTOPIntentClassificationmteb/mtop_intentMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
ToxicConversationsClassificationmteb/toxic_conversations_50kCollection of comments from the Civil Comments platform together with annotations if the comment is toxic or not.Classifications2s150000050000298.80296.6
TweetSentimentExtractionClassificationmteb/tweet_sentiment_extractionClassifications2s1274810353468.3067.8
AngryTweetsClassificationmteb/DDSC/angry-tweetsA sentiment dataset with 3 classes (positiv, negativ, neutral) for Danish tweetsClassifications2s1241001050153.00156.1
DKHateClassificationDDSC/dkhateDanish Tweets annotated for Hate SpeechClassifications2s12960032988.20104.0
DalajClassificationAI-Sweden/SuperLimA Swedish dataset for linguistic accebtablity. Available as a part of SuperlimClassifications2s13840445444243.7242.5243.8
DanishPoliticalCommentsClassificationdanish_political_commentsA dataset of Danish political comments rated for sentimentClassifications2s190100069.900
LccClassificationDDSC/lccThe leipzig corpora collection, annotated for sentimentClassifications2s13490150113.50118.7
NoRecClassificationScandEval/norec-miniA Norwegian dataset for sentiment classification on reviewClassifications2s11020256205086.989.682.0
NordicLangClassificationstrombergnlp/nordic_langidA dataset for Nordic language identification.Classifications2s6570000300078.4078.2
NorwegianParliamentClassificationNbAiLab/norwegian_parliamentNorwegian parliament speeches annotated for sentimentClassifications2s13600120012001773.61911.01884.0
ScalaDaClassificationScandEval/scala-daA modified version of DDT modified for linguistic acceptability classificationClassifications2s110242562048107.6100.8109.4
ScalaNbClassificationScandEval/scala-nbA Norwegian dataset for linguistic acceptability classification for BokmålClassifications2s11024256204895.594.898.4
ScalaNnClassificationScandEval/scala-nnA Norwegian dataset for linguistic acceptability classification for NynorskClassifications2s110242562048105.3103.5104.8
ScalaSvClassificationScandEval/scala-svA Swedish dataset for linguistic acceptability classificationClassifications2s110242562048102.6113.098.3
SweRecClassificitionScandEval/swerec-miniA Swedish dataset for sentiment classification on reviewsClassifications2s110242562048317.7293.4318.8
CBDPL-MTEB/cbdPolish Tweets annotated for cyberbullying detection.Classifications2s1100410100093.6093.2
PolEmo2.0-INPL-MTEB/polemo2_inA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-IN task is to predict the sentiment of in-domain (medicine and hotels) reviews.Classifications2s15783723722780.6769.4756.2
PolEmo2.0-OUTPL-MTEB/polemo2_outA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-OUT task is to predict the sentiment of out-of-domain (products and school) reviews using models train on reviews from medicine and hotels domains.Classifications2s15783494494780.6589.3587.0
AllegroReviewsPL-MTEB/allegro-reviewsA Polish dataset for sentiment classification on reviews from e-commerce marketplace Allegro.Classifications2s1957710021006477.9480.9477.2
PAClaugustyniak/abusive-clauses-plPolish Abusive Clauses DatasetClassifications2s1428415193453185.3256.8185.3
ArxivClusteringP2Pmteb/arxiv-clustering-p2pClustering of titles+abstract from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusteringp2p100732723001009.9
ArxivClusteringS2Smteb/arxiv-clustering-s2sClustering of titles from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusterings2s1007327230074.0
BiorxivClusteringP2Pmteb/biorxiv-clustering-p2pClustering of titles+abstract from biorxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10075000001666.2
BiorxivClusteringS2Smteb/biorxiv-clustering-s2sClustering of titles from biorxiv. Clustering of 10 sets, based on the main category.Clusterings2s1007500000101.6
BlurbsClusteringP2Pslvnwhrl/blurbs-clustering-p2pClustering of book titles+blurbs. Clustering of 28 sets, either on the main or secondary genreClusteringp2p10017463700664.09
BlurbsClusteringS2Sslvnwhrl/blurbs-clustering-s2sClustering of book titles. Clustering of 28 sets, either on the main or secondary genre.Clusterings2s1001746370023.02
MedrxivClusteringP2Pmteb/medrxiv-clustering-p2pClustering of titles+abstract from medrxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10037500001981.2
MedrxivClusteringS2Smteb/medrxiv-clustering-s2sClustering of titles from medrxiv. Clustering of 10 sets, based on the main category.Clusterings2s1003750000114.7
RedditClusteringmteb/reddit-clusteringClustering of titles from 199 subreddits. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s1004204640064.7
RedditClusteringP2Pmteb/reddit-clustering-p2pClustering of title+posts from reddit. Clustering of 10 sets of 50k paragraphs and 40 sets of 10k paragraphs.Clusteringp2p10045939900727.7
StackExchangeClusteringmteb/stackexchange-clusteringClustering of titles from 121 stackexchanges. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s10417060373850056.857.0
StackExchangeClusteringP2Pmteb/stackexchange-clustering-p2pClustering of title+body from stackexchange. Clustering of 5 sets of 10k paragraphs and 5 sets of 5k paragraphs.Clusteringp2p10075000001090.7
TenKGnadClusteringP2Pslvnwhrl/tenkgnad-clustering-p2pClustering of news article titles+subheadings+texts. Clustering of 10 splits on the news article category.Clusteringp2p10045914002641.03
TenKGnadClusteringS2Sslvnwhrl/tenkgnad-clustering-s2sClustering of news article titles. Clustering of 10 splits on the news article category.Clusterings2s100459140050.96
TwentyNewsgroupsClusteringmteb/twentynewsgroups-clusteringClustering of the 20 Newsgroups dataset (subject only).Clusterings2s100595450032.0
8TagsClusteringPL-MTEB/8tags-clusteringClustering of headlines from social media posts in Polish belonging to 8 categories: film, history, food, medicine, motorization, work, sport and technology.Clusterings2s1400015000437278.277.679.2
SprintDuplicateQuestionsmteb/sprintduplicatequestions-pairclassificationDuplicate questions from the Sprint community.PairClassifications2s10101000101000065.267.9
TwitterSemEval2015mteb/twittersemeval2015-pairclassificationParaphrase-Pairs of Tweets from the SemEval 2015 workshop.PairClassifications2s100167770038.3
TwitterURLCorpusmteb/twitterurlcorpus-pairclassificationParaphrase-Pairs of Tweets.PairClassifications2s100515340079.5
PPCPL-MTEB/ppc-pairclassificationPolish Paraphrase CorpusPairClassifications2s150001000100041.041.040.2
PSCPL-MTEB/psc-pairclassificationPolish Summaries CorpusPairClassifications2s1430201078537.10549.3
SICK-E-PLPL-MTEB/sicke-pl-pairclassificationPolish version of SICK dataset for textual entailment.PairClassifications2s14439495490643.444.743.2
CDSC-EPL-MTEB/cdsce-pairclassificationCompositional Distributional Semantics Corpus for textual entailment.PairClassifications2s180001000100071.973.575.2
AskUbuntuDupQuestionsmteb/askubuntudupquestions-rerankingAskUbuntu Question Dataset - Questions from AskUbuntu with manual annotations marking pairs of questions as similar or non-similarRerankings2s10022550052.5
MindSmallRerankingmteb/mind_smallMicrosoft News Dataset: A Large-Scale English Dataset for News Recommendation ResearchRerankings2s1231530010796869.0070.9
SciDocsRRmteb/scidocs-rerankingRanking of related scientific papers based on their title.Rerankings2s101959419599069.469.0
StackOverflowDupQuestionsmteb/stackoverflowdupquestions-rerankingStack Overflow Duplicate Questions Task for questions with the tags Java, JavaScript and PythonRerankings2s1230180346749.6049.8
ArguAnaBeIR/arguanaNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
ClimateFEVERBeIR/climate-feverCLIMATE-FEVER is a dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change.Retrievals2p100541812800539.1
CQADupstackAndroidRetrievalBeIR/cqadupstack/androidCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1002369700578.7
CQADupstackEnglishRetrievalBeIR/cqadupstack/englishCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004179100467.1
CQADupstackGamingRetrievalBeIR/cqadupstack/gamingCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004689600474.7
CQADupstackGisRetrievalBeIR/cqadupstack/gisCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003852200991.1
CQADupstackMathematicaRetrievalBeIR/cqadupstack/mathematicaCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10017509001103.7
CQADupstackPhysicsRetrievalBeIR/cqadupstack/physicsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003935500799.4
CQADupstackProgrammersRetrievalBeIR/cqadupstack/programmersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10033052001030.2
CQADupstackStatsRetrievalBeIR/cqadupstack/statsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10042921001041.0
CQADupstackTexRetrievalBeIR/cqadupstack/texCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10071090001246.9
CQADupstackUnixRetrievalBeIR/cqadupstack/unixCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004845400984.7
CQADupstackWebmastersRetrievalBeIR/cqadupstack/webmastersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1001791100689.8
CQADupstackWordpressRetrievalBeIR/cqadupstack/wordpressCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10049146001111.9
DBPediaBeIR/dbpedia-entityDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FEVERBeIR/feverFEVER (Fact Extraction and VERification) consists of 185,445 claims generated by altering sentences extracted from Wikipedia and subsequently verified without knowledge of the sentence they were derived from.Retrievals2p100542323400538.6
FiQA2018BeIR/fiqaFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQABeIR/hotpotqaHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCOBeIR/msmarcoMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
MSMARCOv2BeIR/msmarco-v2MS MARCO is a collection of datasets focused on deep learning in searchRetrievals2p11386413421383681010341.4342.00
NFCorpusBeIR/nfcorpusNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQBeIR/nqNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p100268492000492.7
QuoraRetrievalBeIR/quoraQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCSBeIR/scidocsSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFactBeIR/scifactSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
Touche2020BeIR/webis-touche2020Touché Task 1: Argument Retrieval for Controversial QuestionsRetrievals2p100382594001720.1
TRECCOVIDBeIR/trec-covidTRECCOVID is an ad-hoc search challenge based on the CORD-19 dataset containing scientific articles related to the COVID-19 pandemicRetrievals2p100171382001117.4
ArguAna-PLBeIR-PL/arguana-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
DBPedia-PLBeIR-PL/dbpedia-plDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FiQA-PLBeIR-PL/fiqa-plFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQA-PLBeIR-PL/hotpotqa-plHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCO-PLBeIR-PL/msmarco-plMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
NFCorpus-PLBeIR-PL/nfcorpus-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQ-PLBeIR-PL/nq-plNatural Questions: A Benchmark for Question Answering ResearchRetrievals2p100268492000492.7
Quora-PLBeIR-PL/quora-plQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCS-PLBeIR-PL/scidocs-plSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFact-PLBeIR-PL/scifact-plSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
SweFAQAI-Sweden/SuperLimFrequently asked questions from Swedish authorities' websitesRetrievals2p10051300390.57
BIOSSESmteb/biosses-stsBiomedical Semantic Similarity Estimation.STSs2s10020000156.6
SICK-Rmteb/sickr-stsSemantic Textual Similarity SICK-R dataset as described here:STSs2s100198540046.1
STS12mteb/sts12-stsSemEval STS 2012 dataset.STSs2s1446806216100.7064.7
STS13mteb/sts13-stsSemEval STS 2013 dataset.STSs2s10030000054.0
STS14mteb/sts14-stsSemEval STS 2014 dataset. Currently only the English datasetSTSs2s10075000054.3
STS15mteb/sts15-stsSemEval STS 2015 datasetSTSs2s10060000057.7
STS16mteb/sts16-stsSemEval STS 2016 datasetSTSs2s10023720065.3
STS17mteb/sts17-crosslingual-stsSTS 2017 datasetSTSs2s11005000043.3
STS22mteb/sts22-crosslingual-stsSemEval 2022 Task 8: Multilingual News Article SimilaritySTSs2s18008060001992.8
STSBenchmarkmteb/stsbenchmark-stsSemantic Textual Similarity Benchmark (STSbenchmark) dataset.STSs2s1114983000275857.664.053.6
SICK-R-PLPL-MTEB/sickr-pl-stsPolish version of SICK dataset for textual relatedness.STSs2s18878990981242.944.042.8
CDSC-RPL-MTEB/cdscr-stsCompositional Distributional Semantics Corpus for textual relatedness.STSs2s1160002000200072.173.275.0
SummEvalmteb/summevalNews Article Summary Semantic Similarity Estimation.Summarizations2s100280000359.8

For Chinese tasks, you can refer to C_MTEB.

Citation

If you find MTEB useful, feel free to cite our publication MTEB: Massive Text Embedding Benchmark:

@article{muennighoff2022mteb,
doi = {10.48550/ARXIV.2210.07316},
url = {https://arxiv.org/abs/2210.07316},
author = {Muennighoff, Niklas and Tazi, Nouamane and Magne, Lo{\"\i}c and Reimers, Nils},
title = {MTEB: Massive Text Embedding Benchmark},
publisher = {arXiv},
journal={arXiv preprint arXiv:2210.07316}, year = {2022}
}

About

MTEB: Massive Text Embedding Benchmark

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - Clibrain/MSTEB: MTEB: Massive Text Embedding Benchmark · GitHub
Skip to content

Repository files navigation

Massive Text Embedding Benchmark

GitHub releaseGitHub releaseBuildLicenseDownloads

Installation

pip install mteb

Usage

frommtebimportMTEBfromsentence_transformersimportSentenceTransformer# Define the sentence-transformers model namemodel_name="average_word_embeddings_komninos"model=SentenceTransformer(model_name)
evaluation=MTEB(tasks=["Banking77Classification"])
results=evaluation.run(model, output_folder=f"results/{model_name}")
  • Using CLI
mteb --available_tasks
mteb -m average_word_embeddings_komninos \
-t Banking77Classification \
--output_folder results/average_word_embeddings_komninos \
--verbosity 3
  • Using multiple GPUs in parallel can be done by just having a custom encode function that distributes the inputs to multiple GPUs like e.g. here. For retrieval tasks you can also use the below (see scripts/retrieval.slurm for multi-node slurm script example):
pipinstallgit+https://github.com/NouamaneTazi/beir@nouamane/better-multi-gpu# Run on 2 gpustorchrun--nproc_per_node=2scripts/retrieval_multigpu.py

Advanced usage

Dataset selection

Datasets can be selected by providing the list of datasets, but also

  • by their task (e.g. "Clustering" or "Classification")
evaluation=MTEB(task_types=['Clustering', 'Retrieval']) # Only select clustering and retrieval tasks
  • by their categories e.g. "S2S" (sentence to sentence) or "P2P" (paragraph to paragraph)
evaluation=MTEB(task_categories=['S2S']) # Only select sentence2sentence datasets
  • by their languages
evaluation=MTEB(task_langs=["en", "de"]) # Only select datasets which are "en", "de" or "en-de"

You can also specify which languages to load for multilingual/crosslingual tasks like below:

frommteb.tasksimportAmazonReviewsClassification, BUCCBitextMiningevaluation=MTEB(tasks=[
AmazonReviewsClassification(langs=["en", "fr"]) # Only load "en" and "fr" subsets of Amazon ReviewsBUCCBitextMining(langs=["de-en"]), # Only load "de-en" subset of BUCC
])

Evaluation split

You can evaluate only on test splits of all tasks by doing the following:

evaluation.run(model, eval_splits=["test"])

Note that the public leaderboard uses the test splits for all datasets except MSMARCO, where the "dev" split is used.

Using a custom model

Models should implement the following interface, implementing an encode function taking as inputs a list of sentences, and returning a list of embeddings (embeddings can be np.array, torch.tensor, etc.). For inspiration, you can look at the mteb/mtebscripts repo used for running diverse models via SLURM scripts for the paper.

classMyModel():
defencode(self, sentences, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: sentences (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passmodel=MyModel()
evaluation=MTEB(tasks=["Banking77Classification"])
evaluation.run(model)

If you'd like to use different encoding functions for query and corpus when evaluating on Retrieval or Reranking tasks, you can add separate methods for encode_queries and encode_corpus. If these methods exist, they will be automatically used for those tasks. You can refer to the DRESModel at mteb/mteb/abstasks/AbsTaskRetrieval.py for an example of these functions.

classMyModel():
defencode_queries(self, queries, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: queries (`List[str]`): List of sentences to encode batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """passdefencode_corpus(self, corpus, batch_size=32, **kwargs):
""" Returns a list of embeddings for the given sentences. Args: corpus (`List[str]` or `List[Dict[str, str]]`): List of sentences to encode or list of dictionaries with keys "title" and "text" batch_size (`int`): Batch size for the encoding Returns: `List[np.ndarray]` or `List[tensor]`: List of embeddings for the given sentences """pass

Evaluating on a custom task

To add a new task, you need to implement a new class that inherits from the AbsTask associated with the task type (e.g. AbsTaskReranking for reranking tasks). You can find the supported task types in here.

frommtebimportMTEBfrommteb.abstasks.AbsTaskRerankingimportAbsTaskRerankingfromsentence_transformersimportSentenceTransformerclassMindSmallReranking(AbsTaskReranking):
@propertydefdescription(self):
return {
"name": "MindSmallReranking",
"hf_hub_name": "mteb/mind_small",
"description": "Microsoft News Dataset: A Large-Scale English Dataset for News Recommendation Research",
"reference": "https://www.microsoft.com/en-us/research/uploads/prod/2019/03/nl4se18LinkSO.pdf",
"type": "Reranking",
"category": "s2s",
"eval_splits": ["validation"],
"eval_langs": ["en"],
"main_score": "map",
}
model=SentenceTransformer("average_word_embeddings_komninos")
evaluation=MTEB(tasks=[MindSmallReranking()])
evaluation.run(model)

Note: for multilingual tasks, make sure your class also inherits from the MultilingualTask class like in this example.

Leaderboard

The MTEB Leaderboard is available here. To submit:

  1. Run on MTEB: You can reference scripts/run_mteb_english.py for all MTEB English datasets used in the main ranking, or scripts/run_mteb_chinese.py for the Chinese ones. Advanced scripts with different models are available in the mteb/mtebscripts repo.
  2. Format the json files into metadata using the script at scripts/mteb_meta.py. For example python scripts/mteb_meta.py path_to_results_folder, which will create a mteb_metadata.md file. If you ran CQADupstack retrieval, make sure to merge the results first with python scripts/merge_cqadupstack.py path_to_results_folder.
  3. Copy the content of the mteb_metadata.md file to the top of a README.md file of your model on the Hub. See here for an example.
  4. Hit the Refresh button at the bottom of the leaderboard and you should see your scores 🥇
  5. To have the scores appear without refreshing, you can open an issue on the Community Tab of the LB and someone will restart the space to cache your average scores. The cache is updated anyways ~1x/week.

Available tasks

NameHub URLDescriptionTypeCategory#LanguagesTrain #SamplesDev #SamplesTest #SamplesAvg. chars / trainAvg. chars / devAvg. chars / test
BUCCmteb/bucc-bitext-miningBUCC bitext mining datasetBitextMinings2s40064168400101.3
Tatoebamteb/tatoeba-bitext-mining1,000 English-aligned sentence pairs for each language based on the Tatoeba corpusBitextMinings2s1120020000039.4
Bornholm parallelstrombergnlp/bornholmsk_parallelDanish Bornholmsk Parallel Corpus.BitextMinings2s210010010064.686.289.7
AmazonCounterfactualClassificationmteb/amazon_counterfactualA collection of Amazon customer reviews annotated for counterfactual detection pair classification.Classifications2s44018335670107.3109.2106.1
AmazonPolarityClassificationmteb/amazon_polarityAmazon Polarity Classification Dataset.Classifications2s136000000400000431.60431.4
AmazonReviewsClassificationmteb/amazon_reviews_multiA collection of Amazon reviews specifically designed to aid research in multilingual text classification.Classifications2s612000003000030000160.5159.2160.4
Banking77Classificationmteb/banking77Dataset composed of online banking queries annotated with their corresponding intents.Classifications2s1100030308059.5054.2
EmotionClassificationmteb/emotionEmotion is a dataset of English Twitter messages with six basic emotions: anger, fear, joy, love, sadness, and surprise. For more detailed information please refer to the paper.Classifications2s1160002000200096.895.396.6
ImdbClassificationmteb/imdbLarge Movie Review DatasetClassificationp2p1250000250001325.101293.8
MassiveIntentClassificationmteb/amazon_massive_intentMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MassiveScenarioClassificationmteb/amazon_massive_scenarioMASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse LanguagesClassifications2s51115142033297435.034.834.6
MTOPDomainClassificationmteb/mtop_domainMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
MTOPIntentClassificationmteb/mtop_intentMTOP: Multilingual Task-Oriented Semantic ParsingClassifications2s6156672235438636.636.536.8
ToxicConversationsClassificationmteb/toxic_conversations_50kCollection of comments from the Civil Comments platform together with annotations if the comment is toxic or not.Classifications2s150000050000298.80296.6
TweetSentimentExtractionClassificationmteb/tweet_sentiment_extractionClassifications2s1274810353468.3067.8
AngryTweetsClassificationmteb/DDSC/angry-tweetsA sentiment dataset with 3 classes (positiv, negativ, neutral) for Danish tweetsClassifications2s1241001050153.00156.1
DKHateClassificationDDSC/dkhateDanish Tweets annotated for Hate SpeechClassifications2s12960032988.20104.0
DalajClassificationAI-Sweden/SuperLimA Swedish dataset for linguistic accebtablity. Available as a part of SuperlimClassifications2s13840445444243.7242.5243.8
DanishPoliticalCommentsClassificationdanish_political_commentsA dataset of Danish political comments rated for sentimentClassifications2s190100069.900
LccClassificationDDSC/lccThe leipzig corpora collection, annotated for sentimentClassifications2s13490150113.50118.7
NoRecClassificationScandEval/norec-miniA Norwegian dataset for sentiment classification on reviewClassifications2s11020256205086.989.682.0
NordicLangClassificationstrombergnlp/nordic_langidA dataset for Nordic language identification.Classifications2s6570000300078.4078.2
NorwegianParliamentClassificationNbAiLab/norwegian_parliamentNorwegian parliament speeches annotated for sentimentClassifications2s13600120012001773.61911.01884.0
ScalaDaClassificationScandEval/scala-daA modified version of DDT modified for linguistic acceptability classificationClassifications2s110242562048107.6100.8109.4
ScalaNbClassificationScandEval/scala-nbA Norwegian dataset for linguistic acceptability classification for BokmålClassifications2s11024256204895.594.898.4
ScalaNnClassificationScandEval/scala-nnA Norwegian dataset for linguistic acceptability classification for NynorskClassifications2s110242562048105.3103.5104.8
ScalaSvClassificationScandEval/scala-svA Swedish dataset for linguistic acceptability classificationClassifications2s110242562048102.6113.098.3
SweRecClassificitionScandEval/swerec-miniA Swedish dataset for sentiment classification on reviewsClassifications2s110242562048317.7293.4318.8
CBDPL-MTEB/cbdPolish Tweets annotated for cyberbullying detection.Classifications2s1100410100093.6093.2
PolEmo2.0-INPL-MTEB/polemo2_inA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-IN task is to predict the sentiment of in-domain (medicine and hotels) reviews.Classifications2s15783723722780.6769.4756.2
PolEmo2.0-OUTPL-MTEB/polemo2_outA collection of Polish online reviews from four domains: medicine, hotels, products and school. The PolEmo2.0-OUT task is to predict the sentiment of out-of-domain (products and school) reviews using models train on reviews from medicine and hotels domains.Classifications2s15783494494780.6589.3587.0
AllegroReviewsPL-MTEB/allegro-reviewsA Polish dataset for sentiment classification on reviews from e-commerce marketplace Allegro.Classifications2s1957710021006477.9480.9477.2
PAClaugustyniak/abusive-clauses-plPolish Abusive Clauses DatasetClassifications2s1428415193453185.3256.8185.3
ArxivClusteringP2Pmteb/arxiv-clustering-p2pClustering of titles+abstract from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusteringp2p100732723001009.9
ArxivClusteringS2Smteb/arxiv-clustering-s2sClustering of titles from arxiv. Clustering of 30 sets, either on the main or secondary categoryClusterings2s1007327230074.0
BiorxivClusteringP2Pmteb/biorxiv-clustering-p2pClustering of titles+abstract from biorxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10075000001666.2
BiorxivClusteringS2Smteb/biorxiv-clustering-s2sClustering of titles from biorxiv. Clustering of 10 sets, based on the main category.Clusterings2s1007500000101.6
BlurbsClusteringP2Pslvnwhrl/blurbs-clustering-p2pClustering of book titles+blurbs. Clustering of 28 sets, either on the main or secondary genreClusteringp2p10017463700664.09
BlurbsClusteringS2Sslvnwhrl/blurbs-clustering-s2sClustering of book titles. Clustering of 28 sets, either on the main or secondary genre.Clusterings2s1001746370023.02
MedrxivClusteringP2Pmteb/medrxiv-clustering-p2pClustering of titles+abstract from medrxiv. Clustering of 10 sets, based on the main category.Clusteringp2p10037500001981.2
MedrxivClusteringS2Smteb/medrxiv-clustering-s2sClustering of titles from medrxiv. Clustering of 10 sets, based on the main category.Clusterings2s1003750000114.7
RedditClusteringmteb/reddit-clusteringClustering of titles from 199 subreddits. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s1004204640064.7
RedditClusteringP2Pmteb/reddit-clustering-p2pClustering of title+posts from reddit. Clustering of 10 sets of 50k paragraphs and 40 sets of 10k paragraphs.Clusteringp2p10045939900727.7
StackExchangeClusteringmteb/stackexchange-clusteringClustering of titles from 121 stackexchanges. Clustering of 25 sets, each with 10-50 classes, and each class with 100 - 1000 sentences.Clusterings2s10417060373850056.857.0
StackExchangeClusteringP2Pmteb/stackexchange-clustering-p2pClustering of title+body from stackexchange. Clustering of 5 sets of 10k paragraphs and 5 sets of 5k paragraphs.Clusteringp2p10075000001090.7
TenKGnadClusteringP2Pslvnwhrl/tenkgnad-clustering-p2pClustering of news article titles+subheadings+texts. Clustering of 10 splits on the news article category.Clusteringp2p10045914002641.03
TenKGnadClusteringS2Sslvnwhrl/tenkgnad-clustering-s2sClustering of news article titles. Clustering of 10 splits on the news article category.Clusterings2s100459140050.96
TwentyNewsgroupsClusteringmteb/twentynewsgroups-clusteringClustering of the 20 Newsgroups dataset (subject only).Clusterings2s100595450032.0
8TagsClusteringPL-MTEB/8tags-clusteringClustering of headlines from social media posts in Polish belonging to 8 categories: film, history, food, medicine, motorization, work, sport and technology.Clusterings2s1400015000437278.277.679.2
SprintDuplicateQuestionsmteb/sprintduplicatequestions-pairclassificationDuplicate questions from the Sprint community.PairClassifications2s10101000101000065.267.9
TwitterSemEval2015mteb/twittersemeval2015-pairclassificationParaphrase-Pairs of Tweets from the SemEval 2015 workshop.PairClassifications2s100167770038.3
TwitterURLCorpusmteb/twitterurlcorpus-pairclassificationParaphrase-Pairs of Tweets.PairClassifications2s100515340079.5
PPCPL-MTEB/ppc-pairclassificationPolish Paraphrase CorpusPairClassifications2s150001000100041.041.040.2
PSCPL-MTEB/psc-pairclassificationPolish Summaries CorpusPairClassifications2s1430201078537.10549.3
SICK-E-PLPL-MTEB/sicke-pl-pairclassificationPolish version of SICK dataset for textual entailment.PairClassifications2s14439495490643.444.743.2
CDSC-EPL-MTEB/cdsce-pairclassificationCompositional Distributional Semantics Corpus for textual entailment.PairClassifications2s180001000100071.973.575.2
AskUbuntuDupQuestionsmteb/askubuntudupquestions-rerankingAskUbuntu Question Dataset - Questions from AskUbuntu with manual annotations marking pairs of questions as similar or non-similarRerankings2s10022550052.5
MindSmallRerankingmteb/mind_smallMicrosoft News Dataset: A Large-Scale English Dataset for News Recommendation ResearchRerankings2s1231530010796869.0070.9
SciDocsRRmteb/scidocs-rerankingRanking of related scientific papers based on their title.Rerankings2s101959419599069.469.0
StackOverflowDupQuestionsmteb/stackoverflowdupquestions-rerankingStack Overflow Duplicate Questions Task for questions with the tags Java, JavaScript and PythonRerankings2s1230180346749.6049.8
ArguAnaBeIR/arguanaNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
ClimateFEVERBeIR/climate-feverCLIMATE-FEVER is a dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change.Retrievals2p100541812800539.1
CQADupstackAndroidRetrievalBeIR/cqadupstack/androidCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1002369700578.7
CQADupstackEnglishRetrievalBeIR/cqadupstack/englishCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004179100467.1
CQADupstackGamingRetrievalBeIR/cqadupstack/gamingCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004689600474.7
CQADupstackGisRetrievalBeIR/cqadupstack/gisCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003852200991.1
CQADupstackMathematicaRetrievalBeIR/cqadupstack/mathematicaCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10017509001103.7
CQADupstackPhysicsRetrievalBeIR/cqadupstack/physicsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1003935500799.4
CQADupstackProgrammersRetrievalBeIR/cqadupstack/programmersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10033052001030.2
CQADupstackStatsRetrievalBeIR/cqadupstack/statsCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10042921001041.0
CQADupstackTexRetrievalBeIR/cqadupstack/texCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10071090001246.9
CQADupstackUnixRetrievalBeIR/cqadupstack/unixCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1004845400984.7
CQADupstackWebmastersRetrievalBeIR/cqadupstack/webmastersCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p1001791100689.8
CQADupstackWordpressRetrievalBeIR/cqadupstack/wordpressCQADupStack: A Benchmark Data Set for Community Question-Answering ResearchRetrievals2p10049146001111.9
DBPediaBeIR/dbpedia-entityDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FEVERBeIR/feverFEVER (Fact Extraction and VERification) consists of 185,445 claims generated by altering sentences extracted from Wikipedia and subsequently verified without knowledge of the sentence they were derived from.Retrievals2p100542323400538.6
FiQA2018BeIR/fiqaFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQABeIR/hotpotqaHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCOBeIR/msmarcoMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
MSMARCOv2BeIR/msmarco-v2MS MARCO is a collection of datasets focused on deep learning in searchRetrievals2p11386413421383681010341.4342.00
NFCorpusBeIR/nfcorpusNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQBeIR/nqNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p100268492000492.7
QuoraRetrievalBeIR/quoraQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCSBeIR/scidocsSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFactBeIR/scifactSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
Touche2020BeIR/webis-touche2020Touché Task 1: Argument Retrieval for Controversial QuestionsRetrievals2p100382594001720.1
TRECCOVIDBeIR/trec-covidTRECCOVID is an ad-hoc search challenge based on the CORD-19 dataset containing scientific articles related to the COVID-19 pandemicRetrievals2p100171382001117.4
ArguAna-PLBeIR-PL/arguana-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievalp2p10010080001052.9
DBPedia-PLBeIR-PL/dbpedia-plDBpedia-Entity is a standard test collection for entity search over the DBpedia knowledge baseRetrievals2p10463598946363220310.2310.1
FiQA-PLBeIR-PL/fiqa-plFinancial Opinion Mining and Question AnsweringRetrievals2p1005828600760.4
HotpotQA-PLBeIR-PL/hotpotqa-plHotpotQA is a question answering dataset featuring natural, multi-hop questions, with strong supervision for supporting facts to enable more explainable question answering systems.Retrievals2p100524073400288.6
MSMARCO-PLBeIR-PL/msmarco-plMS MARCO is a collection of datasets focused on deep learning in search. Note that the dev set is used for the leaderboard.Retrievals2p10884880388418660336.6336.8
NFCorpus-PLBeIR-PL/nfcorpus-plNFCorpus: A Full-Text Learning to Rank Dataset for Medical Information RetrievalRetrievals2p1003956001462.7
NQ-PLBeIR-PL/nq-plNatural Questions: A Benchmark for Question Answering ResearchRetrievals2p100268492000492.7
Quora-PLBeIR-PL/quora-plQuoraRetrieval is based on questions that are marked as duplicates on the Quora platform. Given a question, find other (duplicate) questions.Retrievals2s1005329310062.9
SCIDOCS-PLBeIR-PL/scidocs-plSciDocs, a new evaluation benchmark consisting of seven document-level tasks ranging from citation prediction, to document classification and recommendation.Retrievals2p10026657001161.9
SciFact-PLBeIR-PL/scifact-plSciFact verifies scientific claims using evidence from the research literature containing scientific paper abstracts.Retrievals2p1005483001422.3
SweFAQAI-Sweden/SuperLimFrequently asked questions from Swedish authorities' websitesRetrievals2p10051300390.57
BIOSSESmteb/biosses-stsBiomedical Semantic Similarity Estimation.STSs2s10020000156.6
SICK-Rmteb/sickr-stsSemantic Textual Similarity SICK-R dataset as described here:STSs2s100198540046.1
STS12mteb/sts12-stsSemEval STS 2012 dataset.STSs2s1446806216100.7064.7
STS13mteb/sts13-stsSemEval STS 2013 dataset.STSs2s10030000054.0
STS14mteb/sts14-stsSemEval STS 2014 dataset. Currently only the English datasetSTSs2s10075000054.3
STS15mteb/sts15-stsSemEval STS 2015 datasetSTSs2s10060000057.7
STS16mteb/sts16-stsSemEval STS 2016 datasetSTSs2s10023720065.3
STS17mteb/sts17-crosslingual-stsSTS 2017 datasetSTSs2s11005000043.3
STS22mteb/sts22-crosslingual-stsSemEval 2022 Task 8: Multilingual News Article SimilaritySTSs2s18008060001992.8
STSBenchmarkmteb/stsbenchmark-stsSemantic Textual Similarity Benchmark (STSbenchmark) dataset.STSs2s1114983000275857.664.053.6
SICK-R-PLPL-MTEB/sickr-pl-stsPolish version of SICK dataset for textual relatedness.STSs2s18878990981242.944.042.8
CDSC-RPL-MTEB/cdscr-stsCompositional Distributional Semantics Corpus for textual relatedness.STSs2s1160002000200072.173.275.0
SummEvalmteb/summevalNews Article Summary Semantic Similarity Estimation.Summarizations2s100280000359.8

For Chinese tasks, you can refer to C_MTEB.

Citation

If you find MTEB useful, feel free to cite our publication MTEB: Massive Text Embedding Benchmark:

@article{muennighoff2022mteb,
doi = {10.48550/ARXIV.2210.07316},
url = {https://arxiv.org/abs/2210.07316},
author = {Muennighoff, Niklas and Tazi, Nouamane and Magne, Lo{\"\i}c and Reimers, Nils},
title = {MTEB: Massive Text Embedding Benchmark},
publisher = {arXiv},
journal={arXiv preprint arXiv:2210.07316}, year = {2022}
}

About

MTEB: Massive Text Embedding Benchmark

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages