forked from hse-aml/natural-language-processing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_google_colab.py
65 lines (46 loc) · 1.89 KB
/
setup_google_colab.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
def download_github_code(path):
filename = path.rsplit("/")[-1]
os.system("wget https://raw.githubusercontent.com/hse-aml/natural-language-processing/master/{} -O {}".format(path, filename))
def setup_common():
download_github_code("common/requirements_colab.txt")
download_github_code("common/download_utils.py")
download_github_code("common/tqdm_utils.py")
download_github_code("common/__init__.py")
os.system("mkdir common")
os.system("mv download_utils.py tqdm_utils.py __init__.py common/")
os.system("mv requirements_colab.txt common/")
os.system("pip install -r common/requirements_colab.txt --force-reinstall")
def setup_starspace():
if not os.path.exists("/usr/local/bin/starspace"):
os.system("wget https://dl.bintray.com/boostorg/release/1.63.0/source/boost_1_63_0.zip")
os.system("unzip boost_1_63_0.zip && mv boost_1_63_0 /usr/local/bin")
os.system("git clone https://github.com/facebookresearch/Starspace.git")
os.system("cd Starspace && make && cp -Rf starspace /usr/local/bin")
def setup_week1():
setup_common()
download_github_code("week1/grader.py")
download_github_code("week1/metrics.py")
def setup_week2():
setup_common()
download_github_code("week2/evaluation.py")
def setup_week3():
setup_common()
download_github_code("week3/grader.py")
download_github_code("week3/util.py")
setup_starspace()
def setup_week4():
setup_common()
def setup_project():
setup_common()
download_github_code("week5/dialogue_manager.py")
download_github_code("week5/utils.py")
setup_starspace()
def setup_honor():
setup_common()
download_github_code("honor/datasets.py")
download_github_code("honor/example.py")
download_github_code("honor/download_cornell.sh")
download_github_code("honor/download_opensubs.sh")