top of page

Google Colab (GC)

Updated: Mar 9

Firstly, Colaboratory (Colab) is a Google research project created to help disseminate machine learning education and research. It is a Jupyter Notebook (Python base) environment that requires no setup to use and runs entirely in the cloud-based.

Graphical User Interface for Google Colab
Graphical User Interface for Google Colab

The reasons why I switched to Google Colab at this stage instead of Jupyter Notebook as previously.


1. My system: MacOS version 10.13.2, Processor 1.8GHz Intel Core i5, Memory 8Gb 1600MHz DDR3 not enough to run the programming NER-WNUT. Mac is also not supporrun for some libraries, much better if you use the Ubuntu system.

2. Google Colab is stronger than my system ~ 10 times. It is connected to your Google Drive and running in the cloud. This means that GC runs on another head fuzzy machine, not directly on your computer. However, the fuzzy system only exists in 12 hours! After that time, if you would like to continue, you need to start again. The disadvantage is that it takes a lot of time and is not continuous.

Here are some codes to connect GC with Google Drive:

Bloc1:

!apt-get install -y -qq software-properties-common python-software-properties module-init-tools 2>&1 > /dev/null

!add-apt-repository -y ppa:alessandro-strada/google-drive-ocamlfuse-beta 2>&1 > /dev/null

!sed -i 's/artful/xenial/g' /etc/apt/sources.list.d/alessandro-strada-ubuntu-google-drive-ocamlfuse-beta-artful.list

!apt-get update -qq 2>&1 > /dev/null

!apt-get -y install -qq google-drive-ocamlfuse fuse 2>&1 > /dev/null

!sed -i 's/xenial/artful/g' /etc/apt/sources.list.d/alessandro-strada-ubuntu-google-drive-ocamlfuse-beta-artful.list

!apt-get update -qq 2>&1 > /dev/null

from google.colab import auth

auth.authenticate_user()

from oauth2client.client import GoogleCredentials

creds = GoogleCredentials.get_application_default()

import getpass

!google-drive-ocamlfuse -headless -label myDrive -id {creds.client_id} -secret {creds.client_secret} < /dev/null 2>&1 | grep URL

vcode = getpass.getpass()

!echo {vcode} | google-drive-ocamlfuse -headless -label myDrive -id {creds.client_id} -secret {creds.client_secret}

!mkdir -p GDrive

!google-drive-ocamlfuse -label myDrive GDrive 

!pip install python-crfsuite gensim 2>&1 > /dev/null

Bloc2:

cd ~/GDrive/NER-WNUT/

Recent Posts

See All

Comments


Warm Regards from Giang Nguyen

bottom of page