-
Notifications
You must be signed in to change notification settings - Fork 1
/
init
executable file
·36 lines (26 loc) · 1.07 KB
/
init
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
#!/usr/bin/env python3
import subprocess
import argparse
import json
import shutil
import os
parser = argparse.ArgumentParser()
parser.add_argument("--json", type=json.loads, required=True, help="the args")
args, unknown = parser.parse_known_args()
subprocess.run("git clone https://github.com/breuert/wcrobust0405-code.git".split())
subprocess.run("cp -r wcrobust0405-code/. .".split())
subprocess.run("pip install --no-cache-dir -r requirements.txt".split())
subprocess.run("python -m nltk.downloader stopwords".split())
runs = ["wcrobust04",
"wcrobust0405"]
run = args.json["opts"]["run"]
if run in runs:
os.mkdir("replicability/run")
if run == runs[0]:
shutil.move("replicability/wcrobust04/rank.py", "replicability/run/rank.py")
shutil.move("replicability/wcrobust04/prepare.py", "replicability/run/prepare.py")
if run == runs[1]:
shutil.move("replicability/wcrobust0405/rank.py", "replicability/run/rank.py")
shutil.move("replicability/wcrobust0405/prepare.py", "replicability/run/prepare.py")
else:
print("Unknown run")