Showing posts with label stanford parser. Show all posts
Showing posts with label stanford parser. Show all posts

Tuesday, June 3, 2008

Kompare to the rescue

If you have been reading this blog for the past week then you already know that I am in NLP Summer School in IIIT-Hyderabad. And while doing a project comparing the results of various dependency parsers we had to read through large text files to find the errors and its a real pain. Well, I strong believe in the motto of letting the computer do the dirty work. I would have preferred to use a editor like Vim or Emacs with multiple spilt windows to compare the files and their diff's output. However I found that the KDE's GUI based Kompare (frontend to diff, comp or cmp) to be better suited for this project since my team mates are linguists and quite new to gnu/Linux. Also almost all the lab machines have it installed KDE as default desktop envirnoment.

The above screenshot shows kompare in side-by-side mode and just by using arrow keys or the mouse we could manipulate both the windows at the same time and tally our results. It did help to finish the job quickly but its still a pain.

Saturday, May 31, 2008

Stanford Parser Gotcha

I have aged 6 years since I last coded in Java. So I wasn't quite sure what to make of this Stanford Parser error in the NLP summer school lab. For a while I was quite sure that I didn't set the Java CLASSPATH properly and thus the parser is spewing blood and gore all over me. But after a hour of mucking around I realised that it wasn't so. The real problem seems to that the parser doesn't seem to run well with gij .

$ gij --version gij (GNU libgcj) version 3.4.6 20060404 (Red Hat 3.4.6-3)

$ ./lexparser.csh Warning: -server not understood. Ignoring. Warning: -mx150m not understood. Ignoring. Exception in thread "main" java.lang.ClassFormatError: edu.stanford.nlp.parser.lexparser.LexicalizedParser (erroneous method access flags) at _Jv_ClassReader.throw_class_format_error(byte) (/usr/lib/libgcj.so.5.0.0) at _Jv_ClassReader.handleMethod(int, int, int, int) (/usr/lib/libgcj.so.5.0.0) at _Jv_ClassReader.read_methods() (/usr/lib/libgcj.so.5.0.0) at _Jv_ClassReader.parse() (/usr/lib/libgcj.so.5.0.0) at _Jv_DefineClass(java.lang.Class, byte[], int, int) (/usr/lib/libgcj.so.5.0.0) at java.lang.VMClassLoader.defineClass(java.lang.ClassLoader, java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0) at java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0) at java.security.SecureClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.CodeSource) (/usr/lib/libgcj.so.5.0.0) at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0) at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0) at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0) at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0) at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0) at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.5.0.0) at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0) at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0) at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0) at __gcj_personality_v0 (/home/iasnlp2008/Desktop/stanford-parser-2007-08-19/java.version=1.4.2) at __libc_start_main (/lib/tls/libc-2.3.4.so) at _Jv_RegisterClasses (/home/iasnlp2008/Desktop/stanford-parser-2007-08-19/java.version=1.4.2)

To test my hunch I changed machines and tried with other version of Java (viz 1.5.x) and it worked without a breaking a sweat. Except for the minor problems like this mistake in script the exparser-gui.csh on line $scriptdir/stanford-parser.jar: everything seems to be alright so far.

$ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Server VM (build 1.5.0_05-b05, mixed mode)

Popular Posts