Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LaTeX Formula Bucket Indices (Train/Test Split)
|
| 2 |
+
|
| 3 |
+
## Overview
|
| 4 |
+
|
| 5 |
+
This dataset contains bucket indices for the LaTeX formulas dataset, split into train and test sets.
|
| 6 |
+
|
| 7 |
+
**Source Dataset:** OleehyO/latex-formulas
|
| 8 |
+
**Total Samples:** 552,340
|
| 9 |
+
**Split Ratio:** 80% train / 20% test
|
| 10 |
+
**Random Seed:** 42
|
| 11 |
+
|
| 12 |
+
## Split Statistics
|
| 13 |
+
|
| 14 |
+
- **Train Set:** 441,869 samples (80.0%)
|
| 15 |
+
- **Test Set:** 110,471 samples (20.0%)
|
| 16 |
+
|
| 17 |
+
## Bucket Distribution
|
| 18 |
+
|
| 19 |
+
### Train Set
|
| 20 |
+
- 2line: 73,316 samples
|
| 21 |
+
- long: 31,543 samples
|
| 22 |
+
- long_2line: 23,364 samples
|
| 23 |
+
- long_matrix: 652 samples
|
| 24 |
+
- long_single_line: 7,527 samples
|
| 25 |
+
- matrix: 6,126 samples
|
| 26 |
+
- medium: 264,458 samples
|
| 27 |
+
- medium_2line: 47,114 samples
|
| 28 |
+
- medium_matrix: 4,437 samples
|
| 29 |
+
- medium_single_line: 212,907 samples
|
| 30 |
+
- short: 145,868 samples
|
| 31 |
+
- short_2line: 2,838 samples
|
| 32 |
+
- short_matrix: 1,037 samples
|
| 33 |
+
- short_single_line: 141,993 samples
|
| 34 |
+
- single_line: 362,427 samples
|
| 35 |
+
|
| 36 |
+
### Test Set
|
| 37 |
+
- 2line: 18,330 samples
|
| 38 |
+
- long: 7,886 samples
|
| 39 |
+
- long_2line: 5,841 samples
|
| 40 |
+
- long_matrix: 163 samples
|
| 41 |
+
- long_single_line: 1,882 samples
|
| 42 |
+
- matrix: 1,533 samples
|
| 43 |
+
- medium: 66,116 samples
|
| 44 |
+
- medium_2line: 11,779 samples
|
| 45 |
+
- medium_matrix: 1,110 samples
|
| 46 |
+
- medium_single_line: 53,227 samples
|
| 47 |
+
- short: 36,469 samples
|
| 48 |
+
- short_2line: 710 samples
|
| 49 |
+
- short_matrix: 260 samples
|
| 50 |
+
- short_single_line: 35,499 samples
|
| 51 |
+
- single_line: 90,608 samples
|
| 52 |
+
|
| 53 |
+
## Files
|
| 54 |
+
|
| 55 |
+
- `indices/indices_*_train.json` - Training set indices per bucket
|
| 56 |
+
- `indices/indices_*_test.json` - Test set indices per bucket
|
| 57 |
+
- `indices/split_mapping.json` - Complete train/test split mapping
|
| 58 |
+
|
| 59 |
+
## Usage
|
| 60 |
+
|
| 61 |
+
```python
|
| 62 |
+
import json
|
| 63 |
+
from huggingface_hub import hf_hub_download
|
| 64 |
+
|
| 65 |
+
# Download specific bucket
|
| 66 |
+
filepath = hf_hub_download(
|
| 67 |
+
repo_id="wulanbhai/subset",
|
| 68 |
+
filename="indices/indices_short_train.json",
|
| 69 |
+
repo_type="dataset"
|
| 70 |
+
)
|
| 71 |
+
|
| 72 |
+
with open(filepath, 'r') as f:
|
| 73 |
+
indices = json.load(f)
|
| 74 |
+
|
| 75 |
+
print(f"Loaded {len(indices):,} training indices for 'short' bucket")
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
## Bucket Definitions
|
| 79 |
+
|
| 80 |
+
- **Length buckets:**
|
| 81 |
+
- short: ≤50 tokens
|
| 82 |
+
- medium: 51-150 tokens
|
| 83 |
+
- long: >150 tokens
|
| 84 |
+
|
| 85 |
+
- **Structure buckets:**
|
| 86 |
+
- single_line: Single-line formulas
|
| 87 |
+
- 2line: Multi-line formulas (using `\\`)
|
| 88 |
+
- matrix: Matrix structures
|
| 89 |
+
|
| 90 |
+
- **Combined buckets:** Intersection of length × structure (e.g., `short_single_line`)
|
| 91 |
+
|
| 92 |
+
## Important Notes
|
| 93 |
+
|
| 94 |
+
⚠️ **For Fair Comparison:**
|
| 95 |
+
- Use **train set** for model training/fine-tuning
|
| 96 |
+
- Use **test set** for evaluation ONLY
|
| 97 |
+
- Never train on test set!
|
| 98 |
+
- Never test on train set!
|
| 99 |
+
|
| 100 |
+
✅ **Stratified Split:**
|
| 101 |
+
- Each bucket maintains 80%/20% ratio
|
| 102 |
+
- Distribution preserved across all buckets
|
| 103 |
+
|
| 104 |
+
## Citation
|
| 105 |
+
|
| 106 |
+
If you use these indices, please cite the original dataset:
|
| 107 |
+
```
|
| 108 |
+
@dataset{latex_formulas,
|
| 109 |
+
author = {OleehyO},
|
| 110 |
+
title = {LaTeX Formulas Dataset},
|
| 111 |
+
year = {2024},
|
| 112 |
+
url = {https://huggingface.co/datasets/OleehyO/latex-formulas}
|
| 113 |
+
}
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
## License
|
| 117 |
+
|
| 118 |
+
Indices only (no original data redistributed).
|