Note that there are some explanatory texts on larger screens.

plurals
  1. PODo I need to rewrite my entire java project if I want to use a single UIMA-dependent library?
    primarykey
    data
    text
    <p>I want to use <a href="https://code.google.com/p/heideltime/" rel="nofollow noreferrer">https://code.google.com/p/heideltime/</a> in a java project. That code "fits into the UIMA pipeline", which is something I don't understand at all. UIMA looks like it's designed to solve a ton of problems that I don't have, so I'd just like to get the minimal amount of UIMA needed to run that code.</p> <p>Is there a simple example out there of how I can run a simple UIMA program?</p> <p>I've added </p> <pre><code> &lt;dependency&gt; &lt;groupId&gt;org.uimafit&lt;/groupId&gt; &lt;artifactId&gt;uimafit&lt;/artifactId&gt; &lt;version&gt;1.4.0&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.uima&lt;/groupId&gt; &lt;artifactId&gt;uimaj-core&lt;/artifactId&gt; &lt;version&gt;2.4.0&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.uima&lt;/groupId&gt; &lt;artifactId&gt;uimaj-tools&lt;/artifactId&gt; &lt;version&gt;2.4.0&lt;/version&gt; &lt;/dependency&gt; </code></pre> <p>to my pom.xml but for some reason maven still won't compile this:</p> <pre><code>import org.apache.uima.jcas.JCas; import org.apache.uima.util.Level; import org.uimafit.component.JCasAnnotator_ImplBase; import org.uimafit.descriptor.ConfigurationParameter; import org.uimafit.descriptor.TypeCapability; import org.uimafit.examples.tutorial.type.RoomNumber; public class RoomNumberAnnotatorPipeline { public static void main(String[] args) throws Exception { String text = "The meeting was moved from Yorktown 01-144 to Hawthorne 1S-W33."; TypeSystemDescription tsd = createTypeSystemDescription( "org.uimafit.examples.tutorial.type.RoomNumber"); JCas jCas = createJCas(tsd); // jCas.setDocumentText(text); // AnalysisEngine analysisEngine = createPrimitive(RoomNumberAnnotator.class, tsd); // analysisEngine.process(jCas); // // for (RoomNumber roomNumber : select(jCas, RoomNumber.class)) { // System.out.println(roomNumber.getCoveredText() + "\tbuilding = " // + roomNumber.getBuilding()); // } } } [ERROR] symbol : class TypeSystemDescription [ERROR] location: class com.stackoverflow.RoomNumberAnnotatorPipeline </code></pre> <p><img src="https://i.stack.imgur.com/PhzZP.png" alt="enter image description here"></p> <p>Are UIMA dependencies somehow more substantial than a typical java library? Is it not enough to just pull UIMA from Maven Central and start using their classes in my existing code?</p> <p>ok, I somehow got this example working (I have no idea what it is, and am still confused why it was not working before) I am still not able to use heideltime:</p> <pre><code>package org.ryan; import static org.uimafit.factory.AnalysisEngineFactory.createPrimitive; import static org.uimafit.factory.JCasFactory.createJCas; import static org.uimafit.factory.TypeSystemDescriptionFactory.createTypeSystemDescription; import static org.uimafit.util.JCasUtil.select; import org.apache.uima.UIMAException; import org.apache.uima.analysis_engine.AnalysisEngine; import org.apache.uima.jcas.JCas; import org.apache.uima.resource.metadata.TypeSystemDescription; import org.uimafit.examples.tutorial.ex1.RoomNumberAnnotator; import org.uimafit.examples.tutorial.type.RoomNumber; /** * Hello world! * */ public class UIMAWTF { public static void main( String[] args ) throws UIMAException { String text = "The meeting was moved from Yorktown 01-144 to Hawthorne 1S-W33. Today is May 5, 2013."; TypeSystemDescription tsd = createTypeSystemDescription("org.uimafit.examples.tutorial.type.RoomNumber"); JCas jCas = createJCas(tsd); jCas.setDocumentText(text); AnalysisEngine analysisEngine = createPrimitive(RoomNumberAnnotator.class, tsd); analysisEngine.process(jCas); for (RoomNumber roomNumber : select(jCas, RoomNumber.class)) { System.out.println(roomNumber.getCoveredText() + "\tbuilding = " + roomNumber.getBuilding()); } } } </code></pre> <p><strong>edit</strong> Now trying:</p> <pre><code>HeidelTimeStandalone hts_sci = new HeidelTimeStandalone(Language.ENGLISH, DocumentType.NEWS, OutputType.TIMEML);//, configPath); dates = hts_sci.process("19-Nov-2013", new Date(2012,01,05), new TimeMLResultFormatter()); System.out.println(dates); </code></pre> <p>Getting:</p> <pre><code>Jul 3, 2013 2:02:41 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize INFO: HeidelTimeStandalone initialized with language english Jul 3, 2013 2:02:41 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone readConfigFile INFO: trying to read in file config.props java.lang.NullPointerException at java.io.Reader.&lt;init&gt;(Reader.java:61) at java.io.InputStreamReader.&lt;init&gt;(InputStreamReader.java:55) at de.unihd.dbs.uima.annotator.heideltime.resources.GenericResourceManager.readResourcesFromDirectory(GenericResourceManager.java:45) at de.unihd.dbs.uima.annotator.heideltime.resources.NormalizationManager.&lt;init&gt;(NormalizationManager.java:58) at de.unihd.dbs.uima.annotator.heideltime.resources.NormalizationManager.getInstance(NormalizationManager.java:73) at de.unihd.dbs.uima.annotator.heideltime.HeidelTime.initialize(HeidelTime.java:143) at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.initialize(HeidelTimeStandalone.java:153) at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.&lt;init&gt;(HeidelTimeStandalone.java:128) at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.&lt;init&gt;(HeidelTimeStandalone.java:112) at com.hrl.issl.osi.date.LocalHeidelTime.main(LocalHeidelTime.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297) at java.lang.Thread.run(Thread.java:662) Jul 3, 2013 2:02:41 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize WARNING: HeidelTime could not be initialized java.lang.NullPointerException at org.apache.uima.util.XMLInputSource.&lt;init&gt;(XMLInputSource.java:118) at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.initialize(HeidelTimeStandalone.java:163) at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.&lt;init&gt;(HeidelTimeStandalone.java:128) at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.&lt;init&gt;(HeidelTimeStandalone.java:112) at com.hrl.issl.osi.date.LocalHeidelTime.main(LocalHeidelTime.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297) at java.lang.Thread.run(Thread.java:662) Jul 3, 2013 2:02:41 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize WARNING: JCas factory could not be initialized </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload