updtae README.md: add instructions to add more data using pipeline.
Browse files
README.md
CHANGED
|
@@ -7,7 +7,7 @@ pretty_name: Olympiads Reference Dataset
|
|
| 7 |
This dataset contains a structured collection of Olympiad problems and their solutions,
|
| 8 |
organized by competition. Contains high quality data, prioritizing "official" solutions to problems.
|
| 9 |
|
| 10 |
-
##
|
| 11 |
|
| 12 |
```
|
| 13 |
<competition name>/ # Problems and solutions from the International Mathematical Olympiad
|
|
@@ -25,15 +25,17 @@ organized by competition. Contains high quality data, prioritizing "official" so
|
|
| 25 |
└── file3.jsonl
|
| 26 |
```
|
| 27 |
|
|
|
|
| 28 |
Each `json` in `jsonl` file follows this structure:
|
|
|
|
| 29 |
```json
|
| 30 |
{
|
| 31 |
"problem": "string", // Mandatory: The problem statement in latex or markdown
|
| 32 |
"solution": "string", // Mandatory: The solution for the problem
|
| 33 |
"year": "int", // Optional: Year when the problem was presented
|
| 34 |
"problem_type": "string", // Optional: The mathematical domain of the problem. Here are the supported types:
|
| 35 |
-
//['Algebra', 'Geometry', 'Number Theory', 'Combinatorics', 'Calculus',
|
| 36 |
-
//'Logic and Puzzles', 'Other']
|
| 37 |
"question_type": "string", // Optional: The form or style of the mathematical problem.
|
| 38 |
// The supported classes are: ['MCQ', 'proof' or 'math-word-problem'].
|
| 39 |
// 'math-word-problem' is a problem with output.
|
|
@@ -41,5 +43,59 @@ Each `json` in `jsonl` file follows this structure:
|
|
| 41 |
"source": "string", // Optional: TODO:describe
|
| 42 |
"exam": "string", // Optional: TODO:describe
|
| 43 |
"difficulty": "int", // Optional: TODO:describe
|
| 44 |
-
"other": "..."
|
| 45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
This dataset contains a structured collection of Olympiad problems and their solutions,
|
| 8 |
organized by competition. Contains high quality data, prioritizing "official" solutions to problems.
|
| 9 |
|
| 10 |
+
## Structure
|
| 11 |
|
| 12 |
```
|
| 13 |
<competition name>/ # Problems and solutions from the International Mathematical Olympiad
|
|
|
|
| 25 |
└── file3.jsonl
|
| 26 |
```
|
| 27 |
|
| 28 |
+
|
| 29 |
Each `json` in `jsonl` file follows this structure:
|
| 30 |
+
|
| 31 |
```json
|
| 32 |
{
|
| 33 |
"problem": "string", // Mandatory: The problem statement in latex or markdown
|
| 34 |
"solution": "string", // Mandatory: The solution for the problem
|
| 35 |
"year": "int", // Optional: Year when the problem was presented
|
| 36 |
"problem_type": "string", // Optional: The mathematical domain of the problem. Here are the supported types:
|
| 37 |
+
//['Algebra', 'Geometry', 'Number Theory', 'Combinatorics', 'Calculus',
|
| 38 |
+
//'Inequalities', 'Logic and Puzzles', 'Other']
|
| 39 |
"question_type": "string", // Optional: The form or style of the mathematical problem.
|
| 40 |
// The supported classes are: ['MCQ', 'proof' or 'math-word-problem'].
|
| 41 |
// 'math-word-problem' is a problem with output.
|
|
|
|
| 43 |
"source": "string", // Optional: TODO:describe
|
| 44 |
"exam": "string", // Optional: TODO:describe
|
| 45 |
"difficulty": "int", // Optional: TODO:describe
|
| 46 |
+
"other": "...", // Optional: You can add other fields with metadata
|
| 47 |
+
}
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
## Steps to collect data for formalization
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
### 1. Assign yourself a task
|
| 55 |
+
Check the [tracker](https://docs.google.com/spreadsheets/d/1PiK-lUjcZ8VKwjtyzYWbd_bLQXnlbIPl-jmm5ebZplw/edit?gid=0#gid=0) and assign yourself one line by updating columns:
|
| 56 |
+
* status: IN PROGRESS
|
| 57 |
+
* assignee: your name
|
| 58 |
+
|
| 59 |
+
### 2. Setup
|
| 60 |
+
Download data locally.
|
| 61 |
+
```bash
|
| 62 |
+
git lfs install
|
| 63 |
+
git clone git@hf.co:datasets/AI-MO/olympiads-ref
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
### 3. Find `.pdf` ressources.
|
| 67 |
+
First check if there are already available `.pdf` in https://huggingface.co/AI-MO/olympiads-0.1
|
| 68 |
+
* if yes upload them in `AI-MO/olympiads-ref/<competition>/raw/` and continue to step 4.
|
| 69 |
+
* if no, find sources in internet (preferably with official solution), download and upload in `AI-MO/olympiads-ref/<competition>/raw/`
|
| 70 |
+
|
| 71 |
+
### 4. Find `.md` ressources.
|
| 72 |
+
First check if there are already available `.pdf` in https://huggingface.co/AI-MO/olympiads-0.1
|
| 73 |
+
* if yes upload in `AI-MO/olympiads-ref/<competition>/md/` and continue to step 6.
|
| 74 |
+
* if no, find sources in internet (preferably with official solution), download and upload in `AI-MO/olympiads-ref/<competition>/md/`
|
| 75 |
+
|
| 76 |
+
### 5. Convert `.pdf` to `.md` using Mathpix
|
| 77 |
+
Use [new_pipeline](https://github.com/project-numina/numina-math/tree/yufan/new_pipeline).
|
| 78 |
+
Example:
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
python -m new_pipeline convert_to_md --method=pdf_to_md --input_dir="/home/marvin/workspace/olympiads-ref/IMO/raw" --output_dir="/home/marvin/workspace/olympiads-ref/IMO/md"
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
### 6. Segment the `.md` files into `.jsonl`
|
| 85 |
+
|
| 86 |
+
Write a `segment.py` that can be applied to your data (please do sanity checks!). Examples are [this](https://huggingface.co/datasets/AI-MO/olympiads-ref/blob/main/IMO/segment_script/segment.py) or [that](https://huggingface.co/datasets/AI-MO/olympiads-ref/blob/main/IMO/segment_script/segment_compendium.py). Once you are fine with your segmentation upload the `.jsonl` in `AI-MO/olympiads-ref/<competition>/segmented/` and the `segment.py` in `AI-MO/olympiads-ref/<competition>/segment_script/`.
|
| 87 |
+
|
| 88 |
+
Ask for a review.
|
| 89 |
+
|
| 90 |
+
### 7. Update the status in the tracker
|
| 91 |
+
|
| 92 |
+
Update the [tracker](https://docs.google.com/spreadsheets/d/1PiK-lUjcZ8VKwjtyzYWbd_bLQXnlbIPl-jmm5ebZplw/edit?gid=0#gid=0) with columns:
|
| 93 |
+
* status: DONE + a link to your generated data in hf
|
| 94 |
+
* problem_count: count of problems in data
|
| 95 |
+
* solution_count: count of solutions in data (different than problem_count since a problem can have several solutions)
|
| 96 |
+
* years: range of competition years covered in your data (so we can easily track if many years are missing)
|
| 97 |
+
* assignee: your name
|
| 98 |
+
|
| 99 |
+
### 8. Integrate the data in a base dataset
|
| 100 |
+
|
| 101 |
+
Create a ticket in git
|