HeidelTime: Language parameter was specified as NULL

55 views Asked by At

I am trying to include HeidelTime into my uimaFIT-Pipeline.

Here is my pipeline:

AggregateBuilder builder = new AggregateBuilder();

CollectionReaderDescription reader = createReaderDescription(TextReader.class,
        TextReader.PARAM_SOURCE_LOCATION, dateTimePath, TextReader.PARAM_LANGUAGE, "en",
        TextReader.PARAM_PATTERNS, "*.txt");

AnalysisEngineDescription treeTagger = createEngineDescription(TreeTaggerWrapper.class,
        TreeTaggerWrapper.PARAM_LANGUAGE, "english",
        TreeTaggerWrapper.PARAM_ANNOTATE_PARTOFSPEECH, true,
        TreeTaggerWrapper.PARAM_ANNOTATE_SENTENCES, true, 
        TreeTaggerWrapper.PARAM_ANNOTATE_TOKENS, true);
builder.add(treeTagger);

AnalysisEngineDescription heidelTime = createEngineDescription(HeidelTime.class);
builder.add(heidelTime);

AnalysisEngineDescription intervalTagger = createEngineDescription(IntervalTagger.class);
builder.add(intervalTagger);

AnalysisEngineDescription xmiWriter = createEngineDescription(XmiWriter.class,
        XmiWriter.PARAM_TARGET_LOCATION, outputPath, 
        XmiWriter.PARAM_OVERWRITE, true);
builder.add(xmiWriter);

SimplePipeline.runPipeline(reader, builder.createAggregateDescription());

But I get the following exception when executing it:

Language parameter was specified as NULL.
org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class "de.unihd.dbs.uima.annotator.heideltime.HeidelTime" failed.  (Descriptor: <unknown>)
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:268)
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:175)
    at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
    at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
    at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
    at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:407)
    at org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:256)
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(AggregateAnalysisEngine_impl.java:435)
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:379)
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:192)
    at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
    at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
    at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
    at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:407)
    at org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:256)
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(AggregateAnalysisEngine_impl.java:435)
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:379)
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:192)
    at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
    at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
    at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
    at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
    at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448)
    at org.apache.uima.fit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:166)
...
Caused by: java.lang.NullPointerException
    at de.unihd.dbs.uima.annotator.heideltime.resources.Language.getLanguageFromString(Language.java:65)
    at de.unihd.dbs.uima.annotator.heideltime.HeidelTime.initialize(HeidelTime.java:141)
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:261)
    ... 80 more

How can I set the language and all other parameters within my pipeline? I have not found a way. When I use the standalone version of HeidelTime I can specify the parameters in the constructor and it works fine.

1

There are 1 answers

0
TheFrisbee On BEST ANSWER

I solved the problem by downloading heideltime-master from GitHub and putting the following folders in my /src/main/resources folder:

desc.annotator
desc.comsumer
desc.reader
desc.type

After that I created the AnalysisEngineDescriptions like so:

AnalysisEngineDescription heidelTime = createEngineDescriptionFromPath(
            "src/main/resources/desc/annotator/HeidelTime.xml");
            builder.add(heidelTime);

AnalysisEngineDescription intervalTagger = createEngineDescriptionFromPath(
            "src/main/resources/desc/annotator/IntervalTagger.xml");
            builder.add(intervalTagger);

With this I finally got my pipeline to work and I can see the Timex3 Annotations in my xmi-file in the Ruta Workbench.