Installing Brown Coherence Toolkit for entity grid on Ubuntu Linux 14.04

Brown Coherence Toolkit extracts a feature called Entity Grid [1]. I need to use it for a project lately.

Here are the steps:
  1. Clone Brown Coherence Toolkit (BCT) from https://bitbucket.org/melsner/browncoherence/overview

    Note to use Mercurial instead of Git, i.e., instead of doing git clone, do hg clone.
  2. Install WordNet (WN) and GNU Scientific Library (GSL).
    sudo apt-get install wordnet-dev libgsl0-dev 
  3. Extract Brown Coherence Toolkit.
  4. Edit Makefile. In this section of code below,

    ifeq (${ARCH}, 64)
    WNDIR = /usr
    WNINCLUDE = -idirafter$(WNDIR)/include -DUSE_WORDNET
    WNLIBS = -L$(WNDIR)/lib -lwordnet # -lWN
    else
    WNDIR = /path/to/wordnet-3.0-32
    WNINCLUDE = -idirafter$(WNDIR)/include -DUSE_WORDNET
    WNLIBS = -L$(WNDIR)/lib -lWN
    endif
    

    Change WNDIR to /usr In my case, since my computer is 64-bit, I only edited out the part for 64-bit.

    Then, add -fpermissive flag to CFLAGS. That is
    CFLAGS = $(WARNINGS) -Iinclude $(WNINCLUDE) $(TAO_PETSC_INCLUDE) $(GSLINCLUDE)  -fpermissive

    The reason of -fpermissive is explained here: http://gcc.gnu.org/gcc-4.7/porting_to.html (See the section Name Lookup Changes). Otherwise, the order of template function definitions in BCT will cause trouble.

  5. Create two directories. In my case (64-bit),
    mkdir bin64 lib64
  6. Run
    make everything

References:
[1] Micha Elsner and Eugene Charniak. Extending the Entity Grid with Entity-specific Features. Proceedings of the Association for Computational Linguistics (ACL 2011), Portland, Oregon. [PDF] [Slides (PDF)

No comments: