這是關於這個問題。UIMA RUTA - 沙發貼圖-in Aggregate Pipeline
UIMA RUTA - how to do find & replace using regular expression and groups
我試圖設置沙發映射的建議。我有一個AE AE和幾個AE,並試圖在這個管道中加入2個RUTA AE /腳本。兩個RUTA AE(以及相關的腳本)都負責REGEXP查找並使用修飾符進行替換。第二個AE取決於第一個AE的輸出。我不得不配置第二AE的修改器的outputView,否則我得到'沙發數據已設置'異常。
實質上,我無法編織一個輸出作爲另一個AE的輸入。
的設置我有類似於下面,
_initialview --Input> (Normalizer1 RUTA AE) --Output> norm_1_out
norm_1_out --Input> (Normalizer2 RUTA AE) --Output> norm_2_out
norm_2_out --Input> (Other AE)
下面是總結AE代碼
<?xml version="1.0" encoding="UTF-8"?>
<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
<frameworkImplementation>org.apache.uima.java</frameworkImplementation>
<primitive>false</primitive>
<delegateAnalysisEngineSpecifiers>
<delegateAnalysisEngine key="NormalizerPrepStep1">
<import location="../../../ruta-annotators/desc/NormalizeNumbersEngine.xml"/>
</delegateAnalysisEngine>
<delegateAnalysisEngine key="NormalizerPrepStep2">
<import location="../../../ruta-annotators/desc/NormalizeRangesEngine.xml"/>
</delegateAnalysisEngine>
<delegateAnalysisEngine key="Normalizer">
<import location="../../../ruta-annotators/desc/NormalizerEngine.xml"/>
</delegateAnalysisEngine>
<delegateAnalysisEngine key="SimpleAnnotator">
<import location="../../../textanalyzer/desc/analysis_engine/SimpleAnnotator.xml"/>
</delegateAnalysisEngine>
</delegateAnalysisEngineSpecifiers>
<analysisEngineMetaData>
<name>RUTAAggregatePlaintextProcessor</name>
<description>Runs the complete pipeline for annotating documents in plain text format.</description>
<version/>
<vendor/>
<configurationParameters searchStrategy="language_fallback">
<configurationParameter>
<name>SegmentID</name>
<description/>
<type>String</type>
<multiValued>false</multiValued>
<mandatory>false</mandatory>
<overrides>
<parameter>SimpleAnnotator/SegmentID</parameter>
</overrides>
</configurationParameter>
</configurationParameters>
<configurationParameterSettings/>
<flowConstraints>
<fixedFlow>
<node>NormalizerPrepStep1</node>
<node>NormalizerPrepStep2</node>
<node>Normalizer</node>
<node>SimpleAnnotator</node>
</fixedFlow>
</flowConstraints>
<typePriorities>
<name>Ordering</name>
<description>For subiterator</description>
<version>1.0</version>
<priorityList>
</priorityList>
</typePriorities>
<fsIndexCollection/>
<capabilities>
<capability>
<inputs/>
<outputs/>
<inputSofas>
<sofaName>norm_1_out</sofaName>
<sofaName>norm_2_out</sofaName>
<sofaName>normalized</sofaName>
</inputSofas>
<languagesSupported/>
</capability>
</capabilities>
<operationalProperties>
<modifiesCas>true</modifiesCas>
<multipleDeploymentAllowed>true</multipleDeploymentAllowed>
<outputsNewCASes>false</outputsNewCASes>
</operationalProperties>
</analysisEngineMetaData>
<resourceManagerConfiguration/>
<sofaMappings>
<sofaMapping>
<componentKey>SimpleAnnotator</componentKey>
<aggregateSofaName>normalized</aggregateSofaName>
</sofaMapping>
<sofaMapping>
<componentKey>NormalizerPrepStep2</componentKey>
<aggregateSofaName>norm_1_out</aggregateSofaName>
</sofaMapping>
<sofaMapping>
<componentKey>Normalizer</componentKey>
<aggregateSofaName>norm_2_out</aggregateSofaName>
</sofaMapping>
</sofaMappings>
</analysisEngineDescription>
幾件事情要注意,
- 所有三個RUTA AES(步驟1, step2,normalizer)使用RUTA修飾符
- 上面的設置會引發一個錯誤n「沒有發現名爲norm_2_out 的sofaFS。」 - 這發生在步驟2之後。
- 我試圖將'norm_2_out'切換爲'modified'作爲輸入沙發 標準化程序,這似乎將處理移至管道中的下一個步驟(標準化程序),但是會拋出沙發功能 setLocalSofaData()的數據已被設置爲例外「。在 org.apache.uima.ruta.engine.RutaModifier.process(RutaModifier.java:107)
- 我試圖與RUTA 2.2.0(快照)具有相同的結果
正如我對於UIMA和RUTA來說都是比較新的,不知道我是否做錯了什麼,或者我遇到了什麼限制。
順便說一句,我使用的是RUTA 2.1.0
感謝
您能否提供您的聚合分析引擎的實際/完整沙發映射(代碼)? –
我已經用完整的AggregateAE代碼更新了這個問題 – user3449698
對此有何想法?我在做SOFA映射時出錯了嗎? – user3449698