File size: 1,945 Bytes
27cf2a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language:
- en
license: mit
tags:
- two-tower
- semantic-search
- document-retrieval
- information-retrieval
- dual-encoder
---

# mlx7-two-tower-data

This repository contains datasets used for training Two-Tower (Dual Encoder) models for document retrieval.

## Dataset Description

The datasets provided here are structured for training dual encoder models with various sampling strategies:

- **classic_triplets**: 48.2 MB
- **intra_query_neg**: 47.6 MB
- **multi_pos_multi_neg**: 126.5 MB

### Dataset Details

- **classic_triplets.parquet**: Standard triplet format with (query, positive_document, negative_document)
- **intra_query_neg.parquet**: Negative examples selected from within the same query batch
- **multi_pos_multi_neg.parquet**: Multiple positive and negative examples per query

## Usage

```python
import pandas as pd

# Load a dataset
df = pd.read_parquet("classic_triplets.parquet")

# View the schema
print(df.columns)

# Example of working with the data
queries = df["q_text"].tolist()
positive_docs = df["d_pos_text"].tolist()
negative_docs = df["d_neg_text"].tolist()
```

## Data Source and Preparation

These datasets are derived from the MS MARCO passage retrieval dataset, processed to create effective training examples for two-tower models.

## Dataset Structure

The datasets follow a common schema with the following fields:
- `q_text`: Query text
- `d_pos_text`: Positive (relevant) document text
- `d_neg_text`: Negative (non-relevant) document text

Additional fields may be present in specific datasets.

## Citation

If you use this dataset in your research, please cite the original MS MARCO dataset:

```
@article{msmarco,
  title={MS MARCO: A Human Generated MAchine Reading COmprehension Dataset},
  author={Nguyen, Tri and Rosenberg, Matthew and Song, Xia and Gao, Jianfeng and Tiwary, Saurabh and Majumder, Rangan and Deng, Li},
  journal={arXiv preprint arXiv:1611.09268},
  year={2016}
}
```