download_prepare.sh 1.61 KB
Newer Older
1
2
#!/bin/bash

Mateusz Pawlik's avatar
Mateusz Pawlik committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# The MIT License (MIT)
# Copyright (c) 2017 Thomas Hütter, Mateusz Pawlik.
# 
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# Download the raw dataset.
25
26
wget http://files.srl.inf.ethz.ch/data/py150.tar.gz

Mateusz Pawlik's avatar
Mateusz Pawlik committed
27
# Extract the dataset.
28
29
tar -xzf py150.tar.gz

Mateusz Pawlik's avatar
Mateusz Pawlik committed
30
31
# Convert the training dataset to bracket notation.
python3 parse_json.py --inputfile python100k_train.json > python.bracket
32

Mateusz Pawlik's avatar
Mateusz Pawlik committed
33
34
# Convert the evaluation dataset to bracket notation and append to training.
python3 parse_json.py --inputfile python50k_eval.json >> python.bracket
35

Mateusz Pawlik's avatar
Mateusz Pawlik committed
36
37
# Sort the trees by size.
./../utilities/sort_dataset.sh python.bracket > python_sorted.bracket