1

UIMA フィット パイプラインから単純なサンプル Ruta スクリプトを実行しようとしています。

STRING s;
BOOLEAN a;
STRING s2 = "LAuGH";
DECLARE Test;
BLOCK(forEACH) W{}{
    W{->MATCHEDTEXT(s), ASSIGN(a,equals(s,s2))};
    W{->MATCHEDTEXT(s), ASSIGN(a,equalsIgnoreCase(s,s2))};
    W{a ->Test};
}

このスクリプトは、別の RUTA プロジェクトでスタンドアロン スクリプトとして実行し、Test アノテーションを作成すると正常に動作します。ただし、UIMA フィット パイプラインを使用する Java プロジェクトでは、次のエラーが発生します。

Sep 08, 2016 1:49:14 PM de.tudarmstadt.ukp.dkpro.core.api.io.ResourceCollectionReaderBase scan(393)
INFO: Scanning [file:/home/himanshu_shivhare/workspace/annotate_ruta_example-master/src/main/resources/data/]
Sep 08, 2016 1:49:14 PM de.tudarmstadt.ukp.dkpro.core.api.io.ResourceCollectionReaderBase initialize(224)
INFO: Found [1] resources to be read
Exception in thread "main" org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class "org.apache.uima.ruta.engine.RutaEngine" failed.  (Descriptor: <unknown>)
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:271)
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:170)
    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:429)
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:373)
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:186)
    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.factory.AnalysisEngineFactory.createEngine(AnalysisEngineFactory.java:205)
    at org.apache.uima.fit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:82)
    at example.Annotate.main(Annotate.java:49)
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.file_input(RutaParser.java:726)
    at org.apache.uima.ruta.engine.RutaEngine.loadScript(RutaEngine.java:1087)
    at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:756)
    at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:530)
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:266)
    ... 17 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.statements(RutaParser.java:825)
    at org.apache.uima.ruta.parser.RutaParser.file_input(RutaParser.java:712)
    ... 21 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.statement(RutaParser.java:1038)
    at org.apache.uima.ruta.parser.RutaParser.statements(RutaParser.java:804)
    ... 22 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.blockDeclaration(RutaParser.java:2940)
    at org.apache.uima.ruta.parser.RutaParser.statement(RutaParser.java:1010)
    ... 23 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.statements(RutaParser.java:825)
    at org.apache.uima.ruta.parser.RutaParser.blockDeclaration(RutaParser.java:2921)
    ... 24 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.statement(RutaParser.java:1038)
    at org.apache.uima.ruta.parser.RutaParser.statements(RutaParser.java:804)
    ... 25 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.simpleStatement(RutaParser.java:3266)
    at org.apache.uima.ruta.parser.RutaParser.statement(RutaParser.java:1000)
    ... 26 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.ruleElementsRoot(RutaParser.java:3796)
    at org.apache.uima.ruta.parser.RutaParser.simpleStatement(RutaParser.java:3250)
    ... 27 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.ruleElement(RutaParser.java:4156)
    at org.apache.uima.ruta.parser.RutaParser.ruleElementsRoot(RutaParser.java:3739)
    ... 28 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.ruleElementType(RutaParser.java:4722)
    at org.apache.uima.ruta.parser.RutaParser.ruleElement(RutaParser.java:3994)
    ... 29 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.actions(RutaParser.java:5106)
    at org.apache.uima.ruta.parser.RutaParser.ruleElementType(RutaParser.java:4688)
    ... 30 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.action(RutaParser.java:11623)
    at org.apache.uima.ruta.parser.RutaParser.actions(RutaParser.java:5085)
    ... 31 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393)
    at org.apache.uima.ruta.parser.RutaParser.actionAssign(RutaParser.java:14714)
    at org.apache.uima.ruta.parser.RutaParser.action(RutaParser.java:11305)
    ... 32 more
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example,  line 28, "(": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:358)
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:372)
    at org.apache.uima.ruta.parser.RutaParser.booleanExpression(RutaParser.java:19535)
    at org.apache.uima.ruta.parser.RutaParser.actionAssign(RutaParser.java:14631)
    ... 33 more

奇妙なことに、スクリプトは解析に失敗します。Maven リポジトリ (2.4.0) の ruta-core の最新バージョンを使用しています。なぜこれが起こっているのか誰にも分かりますか?ありがとう。

4

1 に答える 1

0

分析エンジンが uimaFIT を使用して手動で作成され、事前構成された記述子を使用せず、RutaEngine.class の実装のみを使用する場合、パラメーターをadditionalExtension自分で構成する必要があります。このパラメーターは、言語拡張ファクトリーをリストします。

Java行を変更する

 ... = AnalysisEngineFactory.createEngine(RutaEngine.class);

 ... = AnalysisEngineFactory.createEngine(RutaEngine.class, RutaEngine.PARAM_ADDITIONAL_EXTENSIONS, new String[]{BooleanOperationsExtension.class.getName(), StringOperationsExtension.class.getName()});

トリックを行う必要があります。

免責事項: 私は UIMA Ruta の開発者です

于 2016-09-08T17:44:36.147 に答える