Tuesday, August 05, 2014

Setup Conceptnet 5 Server

Tested on

  1. Server 64GB of Ram
  2. Debian 7

 

Install dependencies

>>> sudo apt-get install java-7-openjdk python-pip curl git libatlas-base-dev gfortran vim
>>> sudo pip install virtualenv

 

Install cnet5-solr (Apache Solr)

>>> wget http://conceptnet5.media.mit.edu/downloads/20120501/conceptnet5-solr-config.tar.gz
>>> wget http://conceptnet5.media.mit.edu/downloads/current/conceptnet5_solr_json_20140415.tar.bz2
>>> tar -xvzf conceptnet5-solr-config.tar.gz
>>> tar -jxvf conceptnet5_solr_json_20140415.tar.bz2
>>> cd cnet5-solr
>>> java -jar start.jar
>>> ./import-solr-json.sh ../conceptnet5_solr_json/*.json


Install conceptnet5 API server (Python)

>>> git clone https://github.com/commonsense/conceptnet5.git
>>> virtualenv conceptnet-env
>>> source conceptnet-env/bin/activate
>>> cd conceptnet5
>>> python setup.py develop
>>> pip install numpy scipy gunicorn
>>> cd data (conceptnet5/data)
>>> wget http://conceptnet5.media.mit.edu/downloads/current/conceptnet5_vector_space_20140415.tar.bz2
>>> tar -jxvf conceptnet5_vector_space_20140415.tar.bz2
>>> mkdir -p assoc/space
>>> mv conceptnet5_vector_space_20140415/* assoc/space/
>>> cd ../
>>> vim conceptnet5/api.py (conceptnet5/conceptnet5/api.py)
 

Line 132: change sharded = True to sharded = False
Line 167: change SOLR_BASE = 'http://salmon.media.mit.edu:8983/solr/select?' to SOLR_BASE = 'http://localhost:8983/solr/select?'


>>> vim gunicorn.sh
 

Line 1 and Line 2 edit path to match your setup path

>>> ./gunicorn.sh

Friday, July 04, 2014

Compile source from SVN

$ apt-get install libtool automake
$ libtoolize --force
$ aclocal
$ autoheader
$ automake --force-missing --add-missing
$ autoconf