Re: model file problen in opennlp uima wrapper
Thanks! Indeed either OpenNLP or uima wrapper needs to be compiled with Java 1.6. I will check out the wrappers. I didn't figure out the cvs-root name and project name on the sourcfourge site. I assumed /opennlp and opennlp.uima but the cvs command didn't work. cvs -d:pserver:anonym...@opennlp.cvs.sourcefource:/opennlp checkout opennlp.uima Any ideas? Regards, Toby On Apr 16, 2009, at 9:28 PM, Philip Ogren wrote: It may be worth pointing out that there is a very nice set of uima wrappers for OpenNLP available from their sourceforge cvs repository. See http://opennlp.cvs.sourceforge.net/opennlp/. While this is still a work in progress - it is *much* nicer than the example wrappers that ship with UIMA. Burn Lewis wrote: That probably means the OpenNLP library was compiler with a newer version of Java. Try switching to a higher version number. (The message usually indicates the version number, e.g. 6 for Java 1.6) Burn. No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.287 / Virus Database: 270.11.57/2060 - Release Date: 04/15/09 06:34:00
Re: model file problen in opennlp uima wrapper
I would hope that Java is backward compatible, so you should only need to run with a JDK that is = the one(s) used to compile your code. Burn.
Re: model file problen in opennlp uima wrapper
Tobias Wunner wrote: Thanks! Indeed either OpenNLP or uima wrapper needs to be compiled with Java 1.6. I will check out the wrappers. I didn't figure out the cvs-root name and project name on the sourcfourge site. I assumed /opennlp and opennlp.uima but the cvs command didn't work. cvs -d:pserver:anonym...@opennlp.cvs.sourcefource:/opennlp checkout opennlp.uima Any ideas? The cvs commands to check it out are documented on the sourceforge project page: http://sourceforge.net/scm/?type=cvsgroup_id=3368 Here is my console log for checkout and building it: jo...@karkand:~$ cvs -d:pserver:anonym...@opennlp.cvs.sourceforge.net:/cvsroot/opennlp login Logging in to :pserver:anonym...@opennlp.cvs.sourceforge.net:2401/cvsroot/opennlp CVS password: cvs login: CVS password file /home/joern/.cvspass does not exist - creating a new file jo...@karkand:~$ cvs -z3 -d:pserver:anonym...@opennlp.cvs.sourceforge.net:/cvsroot/opennlp co -P opennlp.uima cvs checkout: Updating opennlp.uima U opennlp.uima/.cvsignore jo...@karkand:~$ cd opennlp.uima/ jo...@karkand:~/opennlp.uima$ mvn package [INFO] Scanning for projects... [INFO] [INFO] Building OpenNLP Uima Annotators [INFO]task-segment: [package] [INFO] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Compiling 40 source files to /home/joern/opennlp.uima/target/classes [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] [INFO] No sources to compile [INFO] [surefire:test] [INFO] No tests to run. [INFO] [jar:jar] [INFO] Building jar: /home/joern/opennlp.uima/target/opennlp-uima-1.4.2.jar [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 6 seconds [INFO] Finished at: Fri Apr 17 15:12:43 CEST 2009 [INFO] Final Memory: 13M/74M [INFO] Now you can use the opennlp-uima-1.4.2.jar in your application. Currently there is no documentation and thats the main reason why it is not released yet, but the parameters for the annotators are documented in the javadoc of the classes. There are also example descriptors at which you can look to see how things work. Any feedback you have is welcome. Jörn
model file problen in opennlp uima wrapper
Hello, I was trying to run the OpenNLP UIMA wrapper OpenNLPAggregate.xml from the UIMA examples (org.apache.uima.examples.opennlp.annotators) and load it in the CAS Visual Debugger. I got the following Java exception: Exception in thread AWT-EventQueue-0 java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:675) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:316) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java: 280) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java: 374) at org .apache .uima .examples .opennlp.annotator.SentenceDetector.initialize(SentenceDetector.java:54) ... at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java: 110) The Java source code of this line is when the Wrapper initializes the OpenNLP Sentence Detector: sentenceDetector = new opennlp.tools.lang.english.SentenceDetector(modelFile); I did the following steps. 1) Create a new Java project with UIMA nature. 2) Add necessary libraries (uima core, opennlp, etc.) and descriptors (Aggregate Engine and it's dependent Annotators) 3) set the ModeFile parameter Configuration Parameters in the Analysis Engine XML files (OpenNLPSentenceDetec, OpenNLPTokenizer, OpenNLPTagger) to the absolute path of the corresponding model file (e.g. /home/workspace/models/model.bin.gz). I also tried relative paths. 4) Open the CAS Visual Debugger and Load the Aggregate Engine 5) Java Error when trying to load the model file: UnsupportedClassVersionError Error Maybe the model file was be loaded successfully. I do get the same error message when the model file in SentenceDetector is empty. For any help I would be grateful. Regards, Toby
Re: model file problen in opennlp uima wrapper
That probably means the OpenNLP library was compiler with a newer version of Java. Try switching to a higher version number. (The message usually indicates the version number, e.g. 6 for Java 1.6) Burn.
Re: model file problen in opennlp uima wrapper
It may be worth pointing out that there is a very nice set of uima wrappers for OpenNLP available from their sourceforge cvs repository. See http://opennlp.cvs.sourceforge.net/opennlp/. While this is still a work in progress - it is *much* nicer than the example wrappers that ship with UIMA. Burn Lewis wrote: That probably means the OpenNLP library was compiler with a newer version of Java. Try switching to a higher version number. (The message usually indicates the version number, e.g. 6 for Java 1.6) Burn. No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.287 / Virus Database: 270.11.57/2060 - Release Date: 04/15/09 06:34:00