-
Notifications
You must be signed in to change notification settings - Fork 644
Add NanoBEIR Datasets #1588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add NanoBEIR Datasets #1588
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
540a8fd
add NanoClimateFeverRetrieval task, still requires some debugging
KGupta10 80e1139
move task to correct place in init file
KGupta10 775676d
add all Nano datasets and results
KGupta10 f471ec6
format code
KGupta10 f42d7bf
Update mteb/tasks/Retrieval/eng/tempCodeRunnerFile.py
KGupta10 d3d394b
pin revision to commit and add datasets to benchmark.py
KGupta10 1f0c009
create new benchmark for NanoBEIR
KGupta10 7fb48c1
add revision when loading datasets
KGupta10 2631a4d
lint
isaac-chung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from datasets import load_dataset | ||
|
|
||
| from mteb.abstasks.AbsTaskRetrieval import AbsTaskRetrieval | ||
| from mteb.abstasks.TaskMetadata import TaskMetadata | ||
|
|
||
|
|
||
| class NanoArguAnaRetrieval(AbsTaskRetrieval): | ||
| metadata = TaskMetadata( | ||
| name="NanoArguAnaRetrieval", | ||
| description="NanoArguAna is a smaller subset of ArguAna, a dataset for argument retrieval in debate contexts.", | ||
| reference="http://argumentation.bplaced.net/arguana/data", | ||
| dataset={ | ||
| "path": "zeta-alpha-ai/NanoArguAna", | ||
| "revision": "8f4a982d470a32c45817738b9d29042ca55d75ad", | ||
| }, | ||
| type="Retrieval", | ||
| category="s2p", | ||
| modalities=["text"], | ||
| eval_splits=["train"], | ||
| eval_langs=["eng-Latn"], | ||
| main_score="ndcg_at_10", | ||
| date=["2020-01-01", "2020-12-31"], | ||
| domains=["Medical", "Written"], | ||
| task_subtypes=["Discourse coherence"], | ||
| license="cc-by-4.0", | ||
| annotations_creators="expert-annotated", | ||
| dialect=[], | ||
| sample_creation="found", | ||
| bibtex_citation="""@inproceedings{boteva2016, | ||
| author = {Boteva, Vera and Gholipour, Demian and Sokolov, Artem and Riezler, Stefan}, | ||
| title = {A Full-Text Learning to Rank Dataset for Medical Information Retrieval}, | ||
| journal = {Proceedings of the 38th European Conference on Information Retrieval}, | ||
| journal-abbrev = {ECIR}, | ||
| year = {2016}, | ||
| city = {Padova}, | ||
| country = {Italy}, | ||
| url = {http://www.cl.uni-heidelberg.de/~riezler/publications/papers/ECIR2016.pdf} | ||
| }""", | ||
| prompt={"query": "Given a claim, find documents that refute the claim"}, | ||
| ) | ||
|
|
||
| def load_data(self, **kwargs): | ||
| if self.data_loaded: | ||
| return | ||
|
|
||
| self.corpus = load_dataset("zeta-alpha-ai/NanoArguAna", "corpus") | ||
| self.queries = load_dataset("zeta-alpha-ai/NanoArguAna", "queries") | ||
| self.relevant_docs = load_dataset("zeta-alpha-ai/NanoArguAna", "qrels") | ||
|
|
||
| self.corpus = { | ||
| split: { | ||
| sample["_id"]: {"_id": sample["_id"], "text": sample["text"]} | ||
| for sample in self.corpus[split] | ||
| } | ||
| for split in self.corpus | ||
| } | ||
|
|
||
| self.queries = { | ||
| split: {sample["_id"]: sample["text"] for sample in self.queries[split]} | ||
| for split in self.queries | ||
| } | ||
|
|
||
| self.relevant_docs = { | ||
| split: { | ||
| sample["query-id"]: {sample["corpus-id"]: 1} | ||
| for sample in self.relevant_docs[split] | ||
| } | ||
| for split in self.relevant_docs | ||
| } | ||
|
|
||
| self.data_loaded = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from datasets import load_dataset | ||
|
|
||
| from mteb.abstasks.AbsTaskRetrieval import AbsTaskRetrieval | ||
| from mteb.abstasks.TaskMetadata import TaskMetadata | ||
|
|
||
|
|
||
| class NanoClimateFeverRetrieval(AbsTaskRetrieval): | ||
| metadata = TaskMetadata( | ||
| name="NanoClimateFeverRetrieval", | ||
| description="NanoClimateFever is a small version of the BEIR dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change.", | ||
| reference="https://arxiv.org/abs/2012.00614", | ||
| dataset={ | ||
| "path": "zeta-alpha-ai/NanoClimateFEVER", | ||
| "revision": "96741bfa30b9f56db8c9eb7d08e775ed6474f206", | ||
| }, | ||
| type="Retrieval", | ||
| category="s2p", | ||
| modalities=["text"], | ||
| eval_splits=["train"], | ||
| eval_langs=["eng-Latn"], | ||
| main_score="ndcg_at_10", | ||
| date=["2020-01-01", "2020-12-31"], | ||
| domains=["Non-fiction", "Academic", "News"], | ||
| task_subtypes=["Claim verification"], | ||
| license="cc-by-4.0", | ||
| annotations_creators="expert-annotated", | ||
| dialect=[], | ||
| sample_creation="found", | ||
| bibtex_citation="""@misc{diggelmann2021climatefever, | ||
| title={CLIMATE-FEVER: A Dataset for Verification of Real-World Climate Claims}, | ||
| author={Thomas Diggelmann and Jordan Boyd-Graber and Jannis Bulian and Massimiliano Ciaramita and Markus Leippold}, | ||
| year={2021}, | ||
| eprint={2012.00614}, | ||
| archivePrefix={arXiv}, | ||
| primaryClass={cs.CL} | ||
| }""", | ||
| prompt={ | ||
| "query": "Given a claim about climate change, retrieve documents that support or refute the claim" | ||
| }, | ||
| ) | ||
|
|
||
| def load_data(self, **kwargs): | ||
| if self.data_loaded: | ||
| return | ||
|
|
||
| self.corpus = load_dataset("zeta-alpha-ai/NanoClimateFEVER", "corpus") | ||
| self.queries = load_dataset("zeta-alpha-ai/NanoClimateFEVER", "queries") | ||
| self.relevant_docs = load_dataset("zeta-alpha-ai/NanoClimateFEVER", "qrels") | ||
|
Samoed marked this conversation as resolved.
Outdated
|
||
|
|
||
| self.corpus = { | ||
| split: { | ||
| sample["_id"]: {"_id": sample["_id"], "text": sample["text"]} | ||
| for sample in self.corpus[split] | ||
| } | ||
| for split in self.corpus | ||
| } | ||
|
|
||
| self.queries = { | ||
| split: {sample["_id"]: sample["text"] for sample in self.queries[split]} | ||
| for split in self.queries | ||
| } | ||
|
|
||
| self.relevant_docs = { | ||
| split: { | ||
| sample["query-id"]: {sample["corpus-id"]: 1} | ||
| for sample in self.relevant_docs[split] | ||
| } | ||
| for split in self.relevant_docs | ||
| } | ||
|
|
||
| self.data_loaded = True | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from datasets import load_dataset | ||
|
|
||
| from mteb.abstasks.AbsTaskRetrieval import AbsTaskRetrieval | ||
| from mteb.abstasks.TaskMetadata import TaskMetadata | ||
|
|
||
|
|
||
| class NanoDBPediaRetrieval(AbsTaskRetrieval): | ||
| metadata = TaskMetadata( | ||
| name="NanoDBPediaRetrieval", | ||
| description="NanoDBPediaRetrieval is a small version of the standard test collection for entity search over the DBpedia knowledge base.", | ||
| reference="https://huggingface.co/datasets/zeta-alpha-ai/NanoDBPedia", | ||
| dataset={ | ||
| "path": "zeta-alpha-ai/NanoDBPedia", | ||
| "revision": "438f1c25129f05db6238699b5afdc9c6b58d2096", | ||
| }, | ||
| type="Retrieval", | ||
| category="s2p", | ||
| modalities=["text"], | ||
| eval_splits=["train"], | ||
| eval_langs=["eng-Latn"], | ||
| main_score="ndcg_at_10", | ||
| date=["2015-01-01", "2015-12-31"], | ||
| domains=["Encyclopaedic"], | ||
| task_subtypes=["Topic classification"], | ||
| license="cc-by-4.0", | ||
| annotations_creators="expert-annotated", | ||
| dialect=[], | ||
| sample_creation="found", | ||
| bibtex_citation="""@article{lehmann2015dbpedia, title={DBpedia: A large-scale, multilingual knowledge base extracted from Wikipedia}, author={Lehmann, Jens and et al.}, journal={Semantic Web}, year={2015}}""", | ||
| ) | ||
|
|
||
| def load_data(self, **kwargs): | ||
| if self.data_loaded: | ||
| return | ||
|
|
||
| self.corpus = load_dataset("zeta-alpha-ai/NanoDBPedia", "corpus") | ||
| self.queries = load_dataset("zeta-alpha-ai/NanoDBPedia", "queries") | ||
| self.relevant_docs = load_dataset("zeta-alpha-ai/NanoDBPedia", "qrels") | ||
|
|
||
| self.corpus = { | ||
| split: { | ||
| sample["_id"]: {"_id": sample["_id"], "text": sample["text"]} | ||
| for sample in self.corpus[split] | ||
| } | ||
| for split in self.corpus | ||
| } | ||
|
|
||
| self.queries = { | ||
| split: {sample["_id"]: sample["text"] for sample in self.queries[split]} | ||
| for split in self.queries | ||
| } | ||
|
|
||
| self.relevant_docs = { | ||
| split: { | ||
| sample["query-id"]: {sample["corpus-id"]: 1} | ||
| for sample in self.relevant_docs[split] | ||
| } | ||
| for split in self.relevant_docs | ||
| } | ||
|
|
||
| self.data_loaded = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from datasets import load_dataset | ||
|
|
||
| from mteb.abstasks.AbsTaskRetrieval import AbsTaskRetrieval | ||
| from mteb.abstasks.TaskMetadata import TaskMetadata | ||
|
|
||
|
|
||
| class NanoFEVERRetrieval(AbsTaskRetrieval): | ||
| metadata = TaskMetadata( | ||
| name="NanoFEVERRetrieval", | ||
| description="NanoFEVER is a smaller version of " | ||
| + "FEVER (Fact Extraction and VERification), which consists of 185,445 claims generated by altering sentences" | ||
| + " extracted from Wikipedia and subsequently verified without knowledge of the sentence they were" | ||
| + " derived from.", | ||
| reference="https://fever.ai/", | ||
| dataset={ | ||
| "path": "zeta-alpha-ai/NanoFEVER", | ||
| "revision": "a8bfdf1bf15181167a7e22e69cf8754bdea9b4c8", | ||
| }, | ||
| type="Retrieval", | ||
| category="s2p", | ||
| modalities=["text"], | ||
| eval_splits=["train"], | ||
| eval_langs=["eng-Latn"], | ||
| main_score="ndcg_at_10", | ||
| date=["2018-01-01", "2018-12-31"], | ||
| domains=["Academic", "Encyclopaedic"], | ||
| task_subtypes=["Claim verification"], | ||
| license="cc-by-4.0", | ||
| annotations_creators="expert-annotated", | ||
| dialect=[], | ||
| sample_creation="found", | ||
| bibtex_citation="""@inproceedings{thorne-etal-2018-fever, | ||
| title = "{FEVER}: a Large-scale Dataset for Fact Extraction and {VER}ification", | ||
| author = "Thorne, James and | ||
| Vlachos, Andreas and | ||
| Christodoulopoulos, Christos and | ||
| Mittal, Arpit", | ||
| editor = "Walker, Marilyn and | ||
| Ji, Heng and | ||
| Stent, Amanda", | ||
| booktitle = "Proceedings of the 2018 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers)", | ||
| month = jun, | ||
| year = "2018", | ||
| address = "New Orleans, Louisiana", | ||
| publisher = "Association for Computational Linguistics", | ||
| url = "https://aclanthology.org/N18-1074", | ||
| doi = "10.18653/v1/N18-1074", | ||
| pages = "809--819", | ||
| abstract = "In this paper we introduce a new publicly available dataset for verification against textual sources, FEVER: Fact Extraction and VERification. It consists of 185,445 claims generated by altering sentences extracted from Wikipedia and subsequently verified without knowledge of the sentence they were derived from. The claims are classified as Supported, Refuted or NotEnoughInfo by annotators achieving 0.6841 in Fleiss kappa. For the first two classes, the annotators also recorded the sentence(s) forming the necessary evidence for their judgment. To characterize the challenge of the dataset presented, we develop a pipeline approach and compare it to suitably designed oracles. The best accuracy we achieve on labeling a claim accompanied by the correct evidence is 31.87{\%}, while if we ignore the evidence we achieve 50.91{\%}. Thus we believe that FEVER is a challenging testbed that will help stimulate progress on claim verification against textual sources.", | ||
| }""", | ||
| prompt={ | ||
| "query": "Given a claim, retrieve documents that support or refute the claim" | ||
| }, | ||
| ) | ||
|
|
||
| def load_data(self, **kwargs): | ||
| if self.data_loaded: | ||
| return | ||
|
|
||
| self.corpus = load_dataset("zeta-alpha-ai/NanoFEVER", "corpus") | ||
| self.queries = load_dataset("zeta-alpha-ai/NanoFEVER", "queries") | ||
| self.relevant_docs = load_dataset("zeta-alpha-ai/NanoFEVER", "qrels") | ||
|
|
||
| self.corpus = { | ||
| split: { | ||
| sample["_id"]: {"_id": sample["_id"], "text": sample["text"]} | ||
| for sample in self.corpus[split] | ||
| } | ||
| for split in self.corpus | ||
| } | ||
|
|
||
| self.queries = { | ||
| split: {sample["_id"]: sample["text"] for sample in self.queries[split]} | ||
| for split in self.queries | ||
| } | ||
|
|
||
| self.relevant_docs = { | ||
| split: { | ||
| sample["query-id"]: {sample["corpus-id"]: 1} | ||
| for sample in self.relevant_docs[split] | ||
| } | ||
| for split in self.relevant_docs | ||
| } | ||
|
|
||
| self.data_loaded = True |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.