ClearTK / cleartk

Machine learning components for Apache UIMA
http://cleartk.github.io/cleartk/
Other
129 stars 58 forks source link

Instructions to run TimeMLAnnotate #430

Closed koustuvsinha closed 7 years ago

koustuvsinha commented 7 years ago

From the docs on the website TimeMLAnnotator class can be run standalone, but I am unable to do so. First I installed the dependencies using mvn clean install, then I am trying to run the compiled file from cleartk-timeml directory like this :

cleartk/cleartk-timeml/target/classes$ java org.cleartk.timeml.TimeMlAnnotate

But I get this following exception :

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/uima/fit/factory/UimaContextFactory
    at org.cleartk.timeml.TimeMlAnnotate.error(TimeMlAnnotate.java:72)
    at org.cleartk.timeml.TimeMlAnnotate.main(TimeMlAnnotate.java:85)
Caused by: java.lang.ClassNotFoundException: org.apache.uima.fit.factory.UimaContextFactory
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 2 more

My java knowledge is a bit rusty, so I might be doing something pretty basic thing wrong. Can anyone please point me out how to just run the TimeMLAnnotate from command line?

koustuvsinha commented 7 years ago

Ok I was able to run it as follows :

mvn exec:java -Dexec.mainClass="org.cleartk.timeml.TimeMlAnnotate" -Dexec.args="file.txt"

closing this issue now but hopefully it helps someone in future!