Skip to content
Manas Ranjan Kar edited this page Mar 10, 2016 · 13 revisions

Version info: This page is updated for ConceptNet 5.4.

Docker is a platform for making software reproducible, by reproducing the entire Linux environment it runs in.

These Docker images exist so far:

  • conceptnet: Includes everything you need to work with ConceptNet except the actual data.
  • conceptnet-web: An image that runs the ConceptNet Web server, including the browseable frontend and the API.

Building ConceptNet with Docker

Okay, first you need the data. We used to include this in the Docker image but the multi-gigabyte uploads and downloads were making Docker Hub very sad.

Go to http://conceptnet5.media.mit.edu/downloads/v5.4/ and download conceptnet5_db_5.4.tar.bz2 and conceptnet5_vector_space_5.4.tar.bz2, which together are about 7.6 GB of files to download.

Save them in a directory on some large disk (let's say it's /large-disk/conceptnet5.4) and extract them.

Now set up Docker if you don't have it already. (You may want to tell it to put its image files on the same large disk.)

Once you've got Docker set up, type this:

sudo docker run -v /large-disk/conceptnet5.4/data:/conceptnet_data rspeer/conceptnet-web:5.4

Change the part that says /large-disk/conceptnet5.4 if that's not the actual directory it's in. /conceptnet_data is what the directory will be called inside the container.

Assuming everything worked, you'll be running the ConceptNet 5.4 server on your computer, on port 10054.

Accessing your setup from remote machine

If you want to use your server as an API endpoint like say, to measure how similar cats and dogs are, as show here;

http://conceptnet5.media.mit.edu/data/5.4/assoc/c/en/cat?filter=/c/en/dog/.&limit=1

You can run your docker using this command

sudo docker run -p 0.0.0.0:80:10054 -v /large-disk/conceptnet5.4/data:/conceptnet_data rspeer/conceptnet-web:5.4

The above command binds port 80 (or any other port of your choosing) of the host machine and redirects it to the Docker container port. Read more about it in Expose Docker ports .

You should now be able to access the API here;

http://:80/data/5.4/assoc/c/en/cat?filter=/c/en/dog/.&limit=1

Clone this wiki locally