File tree 3 files changed +19
-16
lines changed
3 files changed +19
-16
lines changed Original file line number Diff line number Diff line change
1
+ tqdm
2
+ backports.weakref==1.0.post1
3
+ ChatterBot==0.7.6
4
+ enum34==1.1.6
5
+ funcsigs==1.0.2
6
+ gensim==3.8.0
7
+ jedi==0.11.0
8
+ libarchive==0.4.4
9
+ mock==2.0.0
10
+ parso==0.1.0
11
+ pbr==3.1.1
12
+ regex==2017.11.9
Original file line number Diff line number Diff line change 18
18
19
19
def text_prepare (text ):
20
20
"""Performs tokenization and simple preprocessing."""
21
-
21
+
22
22
replace_by_space_re = re .compile ('[/(){}\[\]\|@,;]' )
23
23
bad_symbols_re = re .compile ('[^0-9a-z #+_]' )
24
24
stopwords_set = set (stopwords .words ('english' ))
@@ -41,7 +41,7 @@ def load_embeddings(embeddings_path):
41
41
embeddings - dict mapping words to vectors;
42
42
embeddings_dim - dimension of the vectors.
43
43
"""
44
-
44
+
45
45
# Hint: you have already implemented a similar routine in the 3rd assignment.
46
46
# Note that here you also need to know the dimension of the loaded embeddings.
47
47
# When you load the embeddings, use numpy.float32 type as dtype
@@ -59,7 +59,7 @@ def load_embeddings(embeddings_path):
59
59
60
60
def question_to_vec (question , embeddings , dim ):
61
61
"""Transforms a string to an embedding by averaging word embeddings."""
62
-
62
+
63
63
# Hint: you have already implemented exactly this function in the 3rd assignment.
64
64
65
65
########################
Original file line number Diff line number Diff line change @@ -9,24 +9,15 @@ def download_github_code(path):
9
9
10
10
11
11
def setup_common ():
12
- os .system ("pip install tqdm" )
13
- os .system ("pip install backports.weakref==1.0.post1" )
14
- os .system ("pip install ChatterBot==0.7.6" )
15
- os .system ("pip install enum34==1.1.6" )
16
- os .system ("pip install funcsigs==1.0.2" )
17
- os .system ("pip install gensim==3.1.0" )
18
- os .system ("pip install jedi==0.11.0" )
19
- os .system ("pip install libarchive==0.4.4" )
20
- os .system ("pip install mock==2.0.0" )
21
- os .system ("pip install parso==0.1.0" )
22
- os .system ("pip install pbr==3.1.1" )
23
- os .system ("pip install regex==2017.11.9" )
24
-
12
+ download_github_code ("common/requirements_colab.txt" )
25
13
download_github_code ("common/download_utils.py" )
26
14
download_github_code ("common/tqdm_utils.py" )
27
15
download_github_code ("common/__init__.py" )
28
16
os .system ("mkdir common" )
29
17
os .system ("mv download_utils.py tqdm_utils.py __init__.py common/" )
18
+ os .system ("mv requirements_colab.txt common/" )
19
+
20
+ os .system ("pip install -r common/requirements_colab.txt --force-reinstall" )
30
21
31
22
32
23
def setup_starspace ():
You can’t perform that action at this time.
0 commit comments