Menu

Problem using kenlm for realization

Help
Amy Isard
2015-03-25
2015-03-27
  • Amy Isard

    Amy Isard - 2015-03-25

    Hi,

    I've got the wide coverage grammar working on a linux machine, and have succesfully parsed and realized the novel sentences using the Treebank-trained trigram model. But when I installed the kenlm gigagword model, following the instructions in the README:
    $ mv gigaword4.5g.kenlm.bin $OPENCCG_HOME/ccgbank/models/realizer/.
    and tried to realize, this error appeared in the log file:

    Buildfile: /afs/inf.ed.ac.uk/group/ltg/users/amyi/openccg/openccg-0.9.5/ccgbank/build-rz.xml

    init:

    load-prefs-test:
    [echo] Loading rz-test.prefs
    [java] Importing preferences from prefsfile: ./models/realizer/rz-test.prefs

    test-realizer-novel:
    [echo] Realizing ./data/novel/two-sents.dir/tb.xml to ./data/novel/two-sents.dir/realize.nbest
    [java] java.lang.UnsatisfiedLinkError: no ken in java.library.path
    [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:194)
    [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
    [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
    [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
    [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
    [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

    Do I have to set another path somewhere?

    Thanks!

    Amy

     
  • Michael White

    Michael White - 2015-03-25

    Hi Amy

    Yes, you do need to modify your LD_LIBRARY_PATH, per the main README:

    Finally, if you are going to use KenLM with very large language models for realization with CCGbank-extracted grammars on linux, you'll also need to set the library load path:

    > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OPENCCG_HOME/lib
    

    Also be sure to check that you've got libken.so in $OPENCCG_HOME/lib; this comes with the release tarball (and thus is not in the github repo).

    Mike

     
  • Amy Isard

    Amy Isard - 2015-03-26

    Hi,

    Thanks! I had forgotten to set the LD_LIBRARY_PATH - I followed the instructions in the main README ages ago, and wasn't thinking about using the ccgbank then, so I obviously ignored that instruction! Could you put a reminder about the LD_LIBRARY_PATH in the ccgbank-README?

    It's all working nicely now :)

    Amy

     
  • Michael White

    Michael White - 2015-03-27

    That's great. I've updated the ccgbank-README on github, good idea.

    Mike

     

Log in to post a comment.