Running ASReview Simulation Mode in Google Colab #595
jteijema
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
This is super interesting. Never thought about using Colab for simulations. Maybe with a prefab notebook, we can make simulating the ASReview performance super easy for everyone. We can host them on our page and you can load them from Colab directly. Feel free to share your notebook (on the ASReview Github) with the public. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As using your personal processing power seems very 2019, I wanted to see if running simulation mode works with google colab.
TL:DR, yes.
Setting up
Before starting I set the runtime to GPU as this works well with the CUDA drivers for tensorflow. Keep in mind that there are some restrictions using the TPU and GPU.
EDIT: Setting to GPU is only useful for certain models! there seems to be no difference in simulation time for the NB model
Installing
Installing ASReview and analysis packages is done with the following code:
Running
Running commands in colab is done using the ! prefix.
!asreview simulate benchmark:van_de_Schoot_2017
After having attached a google drive, this location can be used to store the h5 file for later use, without having to download this (probably big) file.
Pointing to the drive can be done like this:
--state_file drive/MyDrive/outputfile.h5
The end result seems to be a lot quicker than doing it on my own machine.
Plotting
Plotting is a small issue, as colab won't display matlibplot objects the right way. Luckily, the good people at ASReview created an API. Plotting a statefile would like like this:
from asreviewcontrib.visualization.plot import Plot
Beta Was this translation helpful? Give feedback.
All reactions