File size: 2,846 Bytes
bdaf2bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eb49f3e
 
bdaf2bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eb49f3e
 
 
 
 
 
bdaf2bf
 
 
eb49f3e
bdaf2bf
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
language:
  - en
license: apache-2.0
tags:
  - text
pretty_name: MTEB/BEIR eval hard negatives
size_categories:
  - "100K<n<1M"
source_datasets:
  - "BeIR"
task_categories:
  - sentence-similarity
dataset_info:
  config_name: default
  features:
  - name: query
    dtype: string
  - name: positive
    sequence: string
  - name: negative
    sequence: string
  splits:
    - name: test
      num_bytes: 226515502
      num_examples: 3679
train-eval-index:
  - config: default
    task: sentence-similarity
    splits:
      eval_split: test
configs:
- config_name: default
  data_files:
  - split: test
    path: "data/test/*"
---

# BEIR/MTEB hard negatives dataset

A dataset for quick evaluation of embedding models during their training.

The problem: running a full MTEB evaluation on a single GPU may take 10-20 hours. Most of this time is spent on embedding all 30M docs in all 10+ corpora. This dataset solves this problem by unwrapping a "retrieval" style benchmark into the "reranking" style:

* We compute embeddings for all documents in the corpora with the [intfloat/e5-base-v2](todo) model.
* For each corpus in BEIR/MTEB benchmark we build a Lucene index with text documents and their embeddings.
* For each eval query we do a hybrid [RRF](todo)-based retrieval for top-32 negatives

As BEIR testset is size-unbalanced (TREC-COVID is 42 queries, and MS MARCO is ~4000) we sample top-300 random queries from each dataset.

It takes around 30-60 seconds to perform eval using Nixietune on a single RTX 4090.

A dataset in a [nixietune](https://github.com/nixiesearch/nixietune) compatible format:

```json
{
  "query": ")what was the immediate impact of the success of the manhattan project?",
  "pos": [
    "The presence of communication amid scientific minds was equally important to the success of the Manhattan Project as scientific intellect was. The only cloud hanging over the impressive achievement of the atomic researchers and engineers is what their success truly meant; hundreds of thousands of innocent lives obliterated."
  ],
  "neg": [
    "Abstract. The pivotal engineering and scientific success of the Twentieth century was the Manhattan Project. The Manhattan Project assimilated concepts and leaders from all scientific fields and engineering disciplines to construct the first two atomic bombs.",
    "The pivotal engineering and scientific success of the Twentieth century was the Manhattan Project. The Manhattan Project assimilated concepts and leaders from all scientific fields and engineering disciplines to construct the first two atomic bombs."
  ]
}
```

## Usage

To use with HF datasets:

```bash
pip install datasets zstandard
```

```python
from datasets import load_dataset

data = load_dataset('nixiesearch/beir-eval-hard-negatives')
print(data["test"].features)
```

## License

Apache 2.0