SwiRL: The Semantic Role Labeler


  1. I am using SwiRL on Ubunty Jaunty Jackalope with the prebuilt binaries of WordNet 3.0 and I cannot replicate the results reported in NEWS. My F1 scores are about 10 points lower. Furthermore, the scoring script reports some strange errors, for example:

    WARNING : sentence 2 : props do not match : expecting choose at position 69, found chose at position 69! Counting all gold arguments as missed!
    WARNING : sentence 2 : props do not match : expecting choose at position 77, found chose at position 77! Counting all gold arguments as missed!
    WARNING : sentence 3 : props do not match : expecting keep at position 16, found kept at position 16! Counting all gold arguments as missed!
    WARNING : sentence 5 : props do not match : expecting have at position 15, found had at position 15! Counting all gold arguments as missed!
    WARNING : sentence 6 : props do not match : expecting wear at position 1, found wore at position 1! Counting all gold arguments as missed!
    ...

    The problem in this case is not with SwiRL but actually with the WordNet distributed with Ubuntu. Many thanks to MunThye Mak for finding the bug. Here are his comments on this issue:

    "I found that there's a long-standing bug of Wordnet and morphstr() in the compilation of Wordnet on Ubuntu. Turns out that the wnPos that was used for morphstr() had a non-zero probability of being off by one. I added a further check past line 158 of src/lib/Wn.cc (else for when ret != NULL) to try morphstr() with wnPos - 1 if wnPos > 0, and return that answer if there's a reply, else fallback to the item stored in buffer. Seems to work well -- test_brown and test_wsj are back to the published F1 levels as in NEWS."

  2. SwiRL fails to compile with the errors below. What is the problem?
    Wn.cc: In static member function `static bool srl::WordNet::initialize()':
    Wn.cc:33: `wninit' undeclared (first use this function)
    Wn.cc:39: `morphinit' undeclared (first use this function)
    ...

    The problem is that you do not have WordNet installed and/or the environment variable $WNHOME is not set. To fix this, download and install WordNet from http://wordnet.princeton.edu/ and set $WNHOME to point to the directory where WordNet is locally installed.

  3. I get this error at linking time: "cannot find -lwn". What gives?

    This happens because some WordNet installations name the WordNet library libwn.a, whereas others (probably your case) name it libWN.a. The solution is simple: change directory to the directory where your WordNet library is installed ($WNHOME/lib) and create a symbolic link from libWN.a to libwn.a: ln -s libWN.a libwn.a

  4. I get this error at linking time: "/main/public/wordnet-2.0/lib/libwn.a(morph.o)(.text+0xa2b): In function `morphprep': undefined reference to `__ctype_b'". What is going on?

    There is a mismatch between your WN installation and the system library (libc). The solution is simple: (a) remove the old library (rm $WNHOME/lib/libwn.a), and (b) recompile WN on the same machine where you are compiling SwiRL with "make SrcWorld"

  5. Please remember that all quotes in the text must be prefixed with a backslash! For example, the text: he said " this is a quote should be passed to Swirl as: he said \" this is a quote.

  6. Why doesn't SwiRL compile on OS X?
    This is a known problem and a patch is coming (thanks to Dustin Smith for the bug report).
    Meanwhile, here is how you can fix it:
    1. OS X is case insensitive, so the two files Assert.h and Wn.h (from src/lib) occlude their lowercase counterparts from being included. Solution: rename the two SwiRL files to something else and change the corresponding includes.
    2. OS X gcc does not have the file 'values.h' to specify data type boundaries. Instead, references to 'values.h' need to be replaced with:
      #include <limits.h>
      #include <float.h>
    3. MINDOUBLE needs to be replaced with DBL_MIN in OS X (defined in limits.h, instead of values.h).