In [0]:
"""
We use following lines because we are running on Google Colab
If you are running notebook on a local computer, you don't need these
"""
from google.colab import drive
drive.mount('/content/gdrive')
import os
os.chdir('/content/gdrive/My Drive/finch/tensorflow2/knowledge_graph_completion/wn18/data')
In [0]:
!pip install wget
Collecting wget
  Downloading https://files.pythonhosted.org/packages/47/6a/62e288da7bcda82b935ff0c6cfe542970f04e29c756b0e147251b2fb251f/wget-3.2.zip
Building wheels for collected packages: wget
  Building wheel for wget (setup.py) ... done
  Stored in directory: /root/.cache/pip/wheels/40/15/30/7d8f7cea2902b4db79e3fea550d7d7b85ecb27ef992b618f3f
Successfully built wget
Installing collected packages: wget
Successfully installed wget-3.2
In [0]:
import os
import zipfile
import wget
In [0]:
f_path='../data/wn18.zip'
wget.download('https://github.com/ttrouill/complex/raw/master/datasets/wn18.zip',
              out = f_path)
z = zipfile.ZipFile(f_path, 'r')
z.extractall(os.path.dirname(f_path))
z = z.close()
os.remove(f_path)
In [0]:
"""
Show the downloaded files
"""
os.chdir('/content/gdrive/My Drive/finch/tensorflow2/knowledge_graph_completion/wn18/data/wn18')
!ls
README	test.txt  train.txt  valid.txt	Wordnet3.0-LICENSE