Upload lucene-inverted/tf/lucene-inverted.bright.20250705.44ae8e.README.md with huggingface_hub
Browse files
lucene-inverted/tf/lucene-inverted.bright.20250705.44ae8e.README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BRIGHT
|
| 2 |
+
|
| 3 |
+
The Lucene inverted indexes for BRIGHT were generated on 2025/07/05 at Anserini commit [`44ae8e`](https://github.com/castorini/anserini/commit/44ae8e487760a2cd21bdcdb11e18735e46606a86) on `orca` with the following commands:
|
| 4 |
+
|
| 5 |
+
```bash
|
| 6 |
+
#!/bin/bash
|
| 7 |
+
|
| 8 |
+
for c in biology earth-science economics psychology robotics stackoverflow sustainable-living pony leetcode aops theoremqa-theorems theoremqa-questions
|
| 9 |
+
do
|
| 10 |
+
|
| 11 |
+
bin/run.sh io.anserini.index.IndexCollection \
|
| 12 |
+
-threads 16 \
|
| 13 |
+
-collection JsonCollection \
|
| 14 |
+
-input collections/bright/${c}/ \
|
| 15 |
+
-generator DefaultLuceneDocumentGenerator \
|
| 16 |
+
-index indexes/bright/lucene-inverted.bright-$c.20250705.44ae8e \
|
| 17 |
+
-storePositions -storeDocvectors -storeRaw -optimize
|
| 18 |
+
|
| 19 |
+
done
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
Documents were generated with the following Python script:
|
| 23 |
+
|
| 24 |
+
```python
|
| 25 |
+
from datasets import load_dataset
|
| 26 |
+
import json
|
| 27 |
+
from tqdm import tqdm
|
| 28 |
+
import os
|
| 29 |
+
|
| 30 |
+
bright_corpus = load_dataset("xlangai/BRIGHT", 'documents')
|
| 31 |
+
splits = list(bright_corpus.keys())
|
| 32 |
+
print(splits)
|
| 33 |
+
|
| 34 |
+
for split in splits:
|
| 35 |
+
exist_docids = set()
|
| 36 |
+
os.makedirs(f'collections/bright/{split}', exist_ok=True)
|
| 37 |
+
corpus = bright_corpus[split]
|
| 38 |
+
print(split)
|
| 39 |
+
with open(f'collections/bright/{split}/{split}.jsonl', 'w') as f:
|
| 40 |
+
for doc in tqdm(corpus):
|
| 41 |
+
id_ = doc['id']
|
| 42 |
+
# replace spaces with underscores
|
| 43 |
+
id_ = id_.replace(' ', '_')
|
| 44 |
+
contents = doc['content']
|
| 45 |
+
if id_ in exist_docids:
|
| 46 |
+
print(f'Duplicate document id found: {id_}')
|
| 47 |
+
continue
|
| 48 |
+
exist_docids.add(id_)
|
| 49 |
+
f.write(json.dumps({'id': id_, 'contents': contents}) + '\n')
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
The processed documents can be found on Hugging Face [here](https://huggingface.co/datasets/castorini/collections-bright).
|