Datasets:
Modalities:
Text
Formats:
parquet
Languages:
English
Size:
10K - 100K
Tags:
biomedical-information-retrieval
citation-prediction-retrieval
passage-retrieval
news-retrieval
argument-retrieval
zero-shot-information-retrieval
License:
Convert scidocs dataset to Parquet
#3
by nthakur - opened
Files changed (4)
- README.md+100-196
- corpus.jsonl.gz → corpus/corpus-00000-of-00001.parquetRenamed+2-2
- queries.jsonl.gz → queries/queries-00000-of-00001.parquetRenamed+2-2
- scidocs.pyDeleted-58
1234562 unmodified lines91011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001015 unmodified lines1071081091101111121131141151161171181191201211221231241 unmodified line12612712812913013113213313413513613713813914014114214314420 unmodified lines1651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742753 unmodified lines279280281282283284285---annotations_creators: []language_creators: []language:- enlicense:2 unmodified lines- monolingualpaperswithcode_id: beirpretty_name: BEIR Benchmarksize_categories:msmarco:- 1M<n<10Mtrec-covid:- 100k<n<1Mnfcorpus:- 1K<n<10Knq:- 1M<n<10Mhotpotqa:- 1M<n<10Mfiqa:- 10K<n<100Karguana:- 1K<n<10Ktouche-2020:- 100K<n<1Mcqadupstack:- 100K<n<1Mquora:- 100K<n<1Mdbpedia:- 1M<n<10Mscidocs:- 10K<n<100Kfever:- 1M<n<10Mclimate-fever:- 1M<n<10Mscifact:- 1K<n<10Ksource_datasets: []task_categories:- text-retrieval- zero-shot-retrieval- information-retrieval- zero-shot-information-retrievaltask_ids:- passage-retrieval- entity-linking-retrieval- fact-checking-retrieval- tweet-retrieval- citation-prediction-retrieval- duplication-question-retrieval- argument-retrieval- news-retrieval- biomedical-information-retrieval- question-answering-retrieval---# Dataset Card for BEIR Benchmark## Table of Contents- [Dataset Description](#dataset-description)- [Dataset Summary](#dataset-summary)- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)- [Languages](#languages)- [Dataset Structure](#dataset-structure)- [Data Instances](#data-instances)- [Data Fields](#data-fields)- [Data Splits](#data-splits)- [Dataset Creation](#dataset-creation)- [Curation Rationale](#curation-rationale)- [Source Data](#source-data)- [Annotations](#annotations)- [Personal and Sensitive Information](#personal-and-sensitive-information)- [Considerations for Using the Data](#considerations-for-using-the-data)- [Social Impact of Dataset](#social-impact-of-dataset)- [Discussion of Biases](#discussion-of-biases)- [Other Known Limitations](#other-known-limitations)- [Additional Information](#additional-information)- [Dataset Curators](#dataset-curators)- [Licensing Information](#licensing-information)- [Citation Information](#citation-information)- [Contributions](#contributions)## Dataset Description- **Homepage:** https://github.com/UKPLab/beir- **Repository:** https://github.com/UKPLab/beir- **Paper:** https://openreview.net/forum?id=wCu6T5xFjeJ- **Leaderboard:** https://docs.google.com/spreadsheets/d/1L8aACyPaXrL8iEelJLGqlMqXKPX2oSP_R10pZoy77Ns- **Point of Contact:** nandan.thakur@uwaterloo.ca### Dataset SummaryBEIR is a heterogeneous benchmark that has been built from 18 diverse datasets representing 9 information retrieval tasks:- Fact-checking: [FEVER](http://fever.ai), [Climate-FEVER](http://climatefever.ai), [SciFact](https://github.com/allenai/scifact)- Question-Answering: [NQ](https://ai.google.com/research/NaturalQuestions), [HotpotQA](https://hotpotqa.github.io), [FiQA-2018](https://sites.google.com/view/fiqa/)5 unmodified lines- Tweet Retrieval: [Signal-1M](https://research.signal-ai.com/datasets/signal1m-tweetir.html)- Entity Retrieval: [DBPedia](https://github.com/iai-group/DBpedia-Entity/)All these datasets have been preprocessed and can be used for your experiments.```python```### Supported Tasks and LeaderboardsThe dataset supports a leaderboard that evaluates models against task-specific metrics such as F1 or EM, as well as their ability to retrieve supporting information from Wikipedia.The current best performing models can be found [here](https://eval.ai/web/challenges/challenge-page/689/leaderboard/).### Languages1 unmodified line## Dataset StructureAll BEIR datasets must contain a corpus, queries and qrels (relevance judgments file). They must be in the following format:- `corpus` file: a `.jsonl` file (jsonlines) that contains a list of dictionaries, each with three fields `_id` with unique document identifier, `title` with document title (optional) and `text` with document paragraph or passage. For example: `{"_id": "doc1", "title": "Albert Einstein", "text": "Albert Einstein was a German-born...."}`- `queries` file: a `.jsonl` file (jsonlines) that contains a list of dictionaries, each with two fields `_id` with unique query identifier and `text` with query text. For example: `{"_id": "q1", "text": "Who developed the mass-energy equivalence formula?"}`- `qrels` file: a `.tsv` file (tab-seperated) that contains three columns, i.e. the `query-id`, `corpus-id` and `score` in this order. Keep 1st row as header. For example: `q1 doc1 1`### Data InstancesA high level example of any beir dataset:```pythoncorpus = {"doc1" : {"title": "Albert Einstein","text": "Albert Einstein was a German-born theoretical physicist. who developed the theory of relativity, \one of the two pillars of modern physics (alongside quantum mechanics). His work is also known for \its influence on the philosophy of science. He is best known to the general public for his mass–energy \20 unmodified lines}```### Data FieldsExamples from all configurations have the following features:### Corpus- `corpus`: a `dict` feature representing the document title and passage text, made up of:- `_id`: a `string` feature representing the unique document id- `title`: a `string` feature, denoting the title of the document.- `text`: a `string` feature, denoting the text of the document.### Queries- `queries`: a `dict` feature representing the query, made up of:- `_id`: a `string` feature representing the unique query id- `text`: a `string` feature, denoting the text of the query.### Qrels- `qrels`: a `dict` feature representing the query document relevance judgements, made up of:- `_id`: a `string` feature representing the query id- `_id`: a `string` feature, denoting the document id.- `score`: a `int32` feature, denoting the relevance judgement between query and document.### Data Splits| Dataset | Website| BEIR-Name | Type | Queries | Corpus | Rel D/Q | Down-load | md5 || -------- | -----| ---------| --------- | ----------- | ---------| ---------| :----------: | :------:|| MSMARCO | [Homepage](https://microsoft.github.io/msmarco/)| ``msmarco`` | ``train``<br>``dev``<br>``test``| 6,980 | 8.84M | 1.1 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/msmarco.zip) | ``444067daf65d982533ea17ebd59501e4`` || TREC-COVID | [Homepage](https://ir.nist.gov/covidSubmit/index.html)| ``trec-covid``| ``test``| 50| 171K| 493.5 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/trec-covid.zip) | ``ce62140cb23feb9becf6270d0d1fe6d1`` || NFCorpus | [Homepage](https://www.cl.uni-heidelberg.de/statnlpgroup/nfcorpus/) | ``nfcorpus`` | ``train``<br>``dev``<br>``test``| 323 | 3.6K | 38.2 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/nfcorpus.zip) | ``a89dba18a62ef92f7d323ec890a0d38d`` || BioASQ | [Homepage](http://bioasq.org) | ``bioasq``| ``train``<br>``test`` | 500 | 14.91M | 8.05 | No | [How to Reproduce?](https://github.com/UKPLab/beir/blob/main/examples/dataset#2-bioasq) || NQ | [Homepage](https://ai.google.com/research/NaturalQuestions) | ``nq``| ``train``<br>``test``| 3,452 | 2.68M | 1.2 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/nq.zip) | ``d4d3d2e48787a744b6f6e691ff534307`` || HotpotQA | [Homepage](https://hotpotqa.github.io) | ``hotpotqa``| ``train``<br>``dev``<br>``test``| 7,405 | 5.23M | 2.0 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/hotpotqa.zip) | ``f412724f78b0d91183a0e86805e16114`` || FiQA-2018 | [Homepage](https://sites.google.com/view/fiqa/) | ``fiqa`` | ``train``<br>``dev``<br>``test``| 648 | 57K | 2.6 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/fiqa.zip) | ``17918ed23cd04fb15047f73e6c3bd9d9`` || Signal-1M(RT) | [Homepage](https://research.signal-ai.com/datasets/signal1m-tweetir.html)| ``signal1m`` | ``test``| 97 | 2.86M | 19.6 | No | [How to Reproduce?](https://github.com/UKPLab/beir/blob/main/examples/dataset#4-signal-1m) || TREC-NEWS | [Homepage](https://trec.nist.gov/data/news2019.html) | ``trec-news`` | ``test``| 57 | 595K | 19.6 | No | [How to Reproduce?](https://github.com/UKPLab/beir/blob/main/examples/dataset#1-trec-news) || ArguAna | [Homepage](http://argumentation.bplaced.net/arguana/data) | ``arguana``| ``test`` | 1,406 | 8.67K | 1.0 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/arguana.zip) | ``8ad3e3c2a5867cdced806d6503f29b99`` || Touche-2020| [Homepage](https://webis.de/events/touche-20/shared-task-1.html) | ``webis-touche2020``| ``test``| 49 | 382K | 19.0 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/webis-touche2020.zip) | ``46f650ba5a527fc69e0a6521c5a23563`` || CQADupstack| [Homepage](http://nlp.cis.unimelb.edu.au/resources/cqadupstack/) | ``cqadupstack``| ``test``| 13,145 | 457K | 1.4 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/cqadupstack.zip) | ``4e41456d7df8ee7760a7f866133bda78`` || Quora| [Homepage](https://www.quora.com/q/quoradata/First-Quora-Dataset-Release-Question-Pairs) | ``quora``| ``dev``<br>``test``| 10,000 | 523K | 1.6 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/quora.zip) | ``18fb154900ba42a600f84b839c173167`` || DBPedia | [Homepage](https://github.com/iai-group/DBpedia-Entity/) | ``dbpedia-entity``| ``dev``<br>``test``| 400 | 4.63M | 38.2 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/dbpedia-entity.zip) | ``c2a39eb420a3164af735795df012ac2c`` || SCIDOCS| [Homepage](https://allenai.org/data/scidocs) | ``scidocs``| ``test``| 1,000 | 25K | 4.9 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/scidocs.zip) | ``38121350fc3a4d2f48850f6aff52e4a9`` || FEVER | [Homepage](http://fever.ai) | ``fever``| ``train``<br>``dev``<br>``test``| 6,666 | 5.42M | 1.2| [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/fever.zip) | ``5a818580227bfb4b35bb6fa46d9b6c03`` || Climate-FEVER| [Homepage](http://climatefever.ai) | ``climate-fever``|``test``| 1,535 | 5.42M | 3.0 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/climate-fever.zip) | ``8b66f0a9126c521bae2bde127b4dc99d`` || SciFact| [Homepage](https://github.com/allenai/scifact) | ``scifact``| ``train``<br>``test``| 300 | 5K | 1.1 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/scifact.zip) | ``5f7d1de60b170fc8027bb7898e2efca1`` || Robust04 | [Homepage](https://trec.nist.gov/data/robust/04.guidelines.html) | ``robust04``| ``test``| 249 | 528K | 69.9 | No | [How to Reproduce?](https://github.com/UKPLab/beir/blob/main/examples/dataset#3-robust04) |## Dataset Creation### Curation Rationale[Needs More Information]### Source Data#### Initial Data Collection and Normalization[Needs More Information]#### Who are the source language producers?[Needs More Information]### Annotations#### Annotation process[Needs More Information]#### Who are the annotators?[Needs More Information]### Personal and Sensitive Information[Needs More Information]## Considerations for Using the Data### Social Impact of Dataset[Needs More Information]### Discussion of Biases[Needs More Information]### Other Known Limitations[Needs More Information]## Additional Information### Dataset Curators[Needs More Information]### Licensing Information[Needs More Information]### Citation InformationCite as:```@inproceedings{thakur2021beir,title={{BEIR}: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval Models},3 unmodified linesurl={https://openreview.net/forum?id=wCu6T5xFjeJ}}```### ContributionsThanks to [@Nthakur20](https://github.com/Nthakur20) for adding this dataset.12342 unmodified lines78910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182835 unmodified lines899091929394951 unmodified line97989910010110210310410510610710810911011111211311411511611711811912012120 unmodified lines1421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821833 unmodified lines187188189---language:- enlicense:2 unmodified lines- monolingualpaperswithcode_id: beirpretty_name: BEIR Benchmarktask_categories:- zero-shot-classification- text-retrievaltask_ids:- document-retrieval- entity-linking-retrieval- fact-checking-retrievaltags:- biomedical-information-retrieval- citation-prediction-retrieval- passage-retrieval- news-retrieval- argument-retrieval- zero-shot-information-retrieval- tweet-retrieval- question-answering-retrieval- duplication-question-retrieval- zero-shot-retrievalconfigs:- config_name: corpusdata_files:- split: corpuspath: corpus/corpus-*- config_name: queriesdata_files:- split: queriespath: queries/queries-*dataset_info:- config_name: corpusfeatures:- name: _iddtype: string- name: titledtype: string- name: textdtype: stringsplits:- name: corpusnum_bytes: 18673258num_examples: 25657download_size: 18673258dataset_size: 18673258- config_name: queriesfeatures:- name: _iddtype: string- name: titledtype: string- name: textdtype: stringsplits:- name: queriesnum_bytes: 92568num_examples: 1000download_size: 92568dataset_size: 92568---# Dataset Card for BEIR Benchmark## Dataset Description- **Homepage:** https://beir.ai- **Repository:** https://beir.ai- **Paper:** https://openreview.net/forum?id=wCu6T5xFjeJ- **Leaderboard:** https://docs.google.com/spreadsheets/d/1L8aACyPaXrL8iEelJLGqlMqXKPX2oSP_R10pZoy77Ns- **Point of Contact:** nandan.thakur@uwaterloo.ca### Dataset SummaryBEIR is a heterogeneous benchmark built from 18 diverse datasets representing 9 information retrieval tasks.- Fact-checking: [FEVER](http://fever.ai), [Climate-FEVER](http://climatefever.ai), [SciFact](https://github.com/allenai/scifact)- Question-Answering: [NQ](https://ai.google.com/research/NaturalQuestions), [HotpotQA](https://hotpotqa.github.io), [FiQA-2018](https://sites.google.com/view/fiqa/)5 unmodified lines- Tweet Retrieval: [Signal-1M](https://research.signal-ai.com/datasets/signal1m-tweetir.html)- Entity Retrieval: [DBPedia](https://github.com/iai-group/DBpedia-Entity/)> **This `scidocs` subset is the Argument Retrieval task within BEIR.**### Languages1 unmodified line## Dataset StructureThis dataset uses the standard BEIR retrieval layout and includes:- `corpus`: one row per document with `_id`, `title`, `text`- `queries`: one row per query with `_id`, `title`, `text`### Data Fields- `_id` (`string`): unique identifier- `title` (`string`): title (empty string when unavailable)- `text` (`string`): document/query text### Data InstancesA high level example of any BEIR dataset:```pythoncorpus = {"doc1" : {"title": "Albert Einstein","text": "Albert Einstein was a German-born theoretical physicist. who developed the theory of relativity, \one of the two pillars of modern physics (alongside quantum mechanics). His work is also known for \its influence on the philosophy of science. He is best known to the general public for his mass–energy \20 unmodified lines}```### SCIDOCS Data Splits| Subset | Split | Rows || --- | --- | ---: || corpus | corpus | 25,657 || queries | queries | 1,000 |### BEIR Direct DownloadYou can also download BEIR datasets directly (without loading through Hugging Face datasets) using the links below.| Dataset | Website | BEIR-Name | Type | Queries | Corpus | Rel D/Q | Down-load | md5 || --- | --- | --- | --- | ---: | ---: | ---: | --- | --- || MSMARCO | [Homepage](https://microsoft.github.io/msmarco/) | `msmarco` | `train` `dev` `test` | 6,980 | 8.84M | 1.1 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/msmarco.zip) | `444067daf65d982533ea17ebd59501e4` || TREC-COVID | [Homepage](https://ir.nist.gov/covidSubmit/index.html) | `trec-covid` | `test` | 50 | 171K | 493.5 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/trec-covid.zip) | `ce62140cb23feb9becf6270d0d1fe6d1` || NFCorpus | [Homepage](https://www.cl.uni-heidelberg.de/statnlpgroup/nfcorpus/) | `nfcorpus` | `train` `dev` `test` | 323 | 3.6K | 38.2 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/nfcorpus.zip) | `a89dba18a62ef92f7d323ec890a0d38d` || BioASQ | [Homepage](http://bioasq.org) | `bioasq` | `train` `test` | 500 | 14.91M | 8.05 | No | [How to Reproduce?](https://github.com/UKPLab/beir/blob/main/examples/dataset#2-bioasq) || NQ | [Homepage](https://ai.google.com/research/NaturalQuestions) | `nq` | `train` `test` | 3,452 | 2.68M | 1.2 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/nq.zip) | `d4d3d2e48787a744b6f6e691ff534307` || HotpotQA | [Homepage](https://hotpotqa.github.io) | `hotpotqa` | `train` `dev` `test` | 7,405 | 5.23M | 2.0 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/hotpotqa.zip) | `f412724f78b0d91183a0e86805e16114` || FiQA-2018 | [Homepage](https://sites.google.com/view/fiqa/) | `fiqa` | `train` `dev` `test` | 648 | 57K | 2.6 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/fiqa.zip) | `17918ed23cd04fb15047f73e6c3bd9d9` || Signal-1M(RT) | [Homepage](https://research.signal-ai.com/datasets/signal1m-tweetir.html) | `signal1m` | `test` | 97 | 2.86M | 19.6 | No | [How to Reproduce?](https://github.com/UKPLab/beir/blob/main/examples/dataset#4-signal-1m) || TREC-NEWS | [Homepage](https://trec.nist.gov/data/news2019.html) | `trec-news` | `test` | 57 | 595K | 19.6 | No | [How to Reproduce?](https://github.com/UKPLab/beir/blob/main/examples/dataset#1-trec-news) || ArguAna | [Homepage](http://argumentation.bplaced.net/arguana/data) | `arguana` | `test` | 1,406 | 8.67K | 1.0 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/arguana.zip) | `8ad3e3c2a5867cdced806d6503f29b99` || Touche-2020 | [Homepage](https://webis.de/events/touche-20/shared-task-1.html) | `webis-touche2020` | `test` | 49 | 382K | 19.0 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/webis-touche2020.zip) | `46f650ba5a527fc69e0a6521c5a23563` || CQADupstack | [Homepage](http://nlp.cis.unimelb.edu.au/resources/cqadupstack/) | `cqadupstack` | `test` | 13,145 | 457K | 1.4 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/cqadupstack.zip) | `4e41456d7df8ee7760a7f866133bda78` || Quora | [Homepage](https://www.quora.com/q/quoradata/First-Quora-Dataset-Release-Question-Pairs) | `quora` | `dev` `test` | 10,000 | 523K | 1.6 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/quora.zip) | `18fb154900ba42a600f84b839c173167` || DBPedia | [Homepage](https://github.com/iai-group/DBpedia-Entity/) | `dbpedia-entity` | `dev` `test` | 400 | 4.63M | 38.2 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/dbpedia-entity.zip) | `c2a39eb420a3164af735795df012ac2c` || SCIDOCS | [Homepage](https://allenai.org/data/scidocs) | `scidocs` | `test` | 1,000 | 25K | 4.9 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/scidocs.zip) | `38121350fc3a4d2f48850f6aff52e4a9` || FEVER | [Homepage](http://fever.ai) | `fever` | `train` `dev` `test` | 6,666 | 5.42M | 1.2 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/fever.zip) | `5a818580227bfb4b35bb6fa46d9b6c03` || Climate-FEVER | [Homepage](http://climatefever.ai) | `climate-fever` | `test` | 1,535 | 5.42M | 3.0 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/climate-fever.zip) | `8b66f0a9126c521bae2bde127b4dc99d` || SciFact | [Homepage](https://github.com/allenai/scifact) | `scifact` | `train` `test` | 300 | 5K | 1.1 | [Link](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/scifact.zip) | `5f7d1de60b170fc8027bb7898e2efca1` || Robust04 | [Homepage](https://trec.nist.gov/data/robust/04.guidelines.html) | `robust04` | `test` | 249 | 528K | 69.9 | No | [How to Reproduce?](https://github.com/UKPLab/beir/blob/main/examples/dataset#3-robust04) |## Citation Information```bibtex@inproceedings{thakur2021beir,title={{BEIR}: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval Models},3 unmodified linesurl={https://openreview.net/forum?id=wCu6T5xFjeJ}}```
123version https://git-lfs.github.com/spec/v1oid sha256:20ba373b781374b6221af5eb6bcedd9264b38f638558af8f169c41a3e8dedef8size 139911896123version https://git-lfs.github.com/spec/v1oid sha256:e1855cbf47a19e4ff1fc870674c3c441bc5a32a76ecc151851d4452a9aa43a28size 18673258
123version https://git-lfs.github.com/spec/v1oid sha256:da305b5b0b778b0abf7500d544c6f702ac2206ea34e87e36ff0cf427af9743adsize 1743686123version https://git-lfs.github.com/spec/v1oid sha256:f9ad7adff7d396e652789de371f69b5a3adfa8f39e1f37fff728c231e7db3202size 92568
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758import jsonimport csvimport osimport datasets
logger = datasets.logging.get_logger(__name__)
_DESCRIPTION = "FIQA Dataset"_SPLITS = ["corpus", "queries"]
URL = ""_URLs = {subset: URL + f"{subset}.jsonl.gz" for subset in _SPLITS}
class BEIR(datasets.GeneratorBasedBuilder): """BEIR BenchmarkDataset."""
BUILDER_CONFIGS = [ datasets.BuilderConfig( name=name, description=f"This is the {name} in the FiQA dataset.", ) for name in _SPLITS ] def _info(self):
return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features({ "_id": datasets.Value("string"), "title": datasets.Value("string"), "text": datasets.Value("string"), }), supervised_keys=None, )
def _split_generators(self, dl_manager): """Returns SplitGenerators."""
my_urls = _URLs[self.config.name] data_dir = dl_manager.download_and_extract(my_urls)
return [ datasets.SplitGenerator( name=self.config.name, # These kwargs will be passed to _generate_examples gen_kwargs={"filepath": data_dir}, ), ]
def _generate_examples(self, filepath): """Yields examples.""" with open(filepath, encoding="utf-8") as f: texts = f.readlines() for i, text in enumerate(texts): text = json.loads(text) if 'metadata' in text: del text['metadata'] if "title" not in text: text["title"] = "" yield i, textREADME.md+100-196
corpus.jsonl.gz → corpus/corpus-00000-of-00001.parquetRenamed+2-2
queries.jsonl.gz → queries/queries-00000-of-00001.parquetRenamed+2-2
scidocs.pyDeleted-58