简体   繁体   English

如何在 UIMA RUTA 中设置变量

[英]How to set Variables in UIMA RUTA

Hi (most probably Peter), I am having troubles to figure out how to make parametrization of my RUTA project.嗨(很可能是彼得),我很难弄清楚如何对我的 RUTA 项目进行参数化。

First of all I have several scripts that make kind of chain:首先,我有几个创建链的脚本:

  1. Project Adjectives.ruta项目形容词.ruta
  2. Project Anatomy.ruta (contains "SCRIPT Adjectives;" and "Document{->CALL(Adjectives)};") Project Anatomy.ruta(包含“SCRIPT Adjectives;”和“Document{->CALL(Adjectives)};”)
  3. Project Anamnesis.ruta (contains "SCRIPT Anatomy;" and "Document{->CALL(Anatomy)};") Project Anamnesis.ruta(包含“SCRIPT Anatomy;”和“Document{->CALL(Anatomy)};”)

For the result I am calling this:对于结果,我称之为:

File specFile = new File("C:/.../.../pipelines/AnamnesisEngine.xml");
String path = new File(specFile.toURI()).getParentFile().getAbsolutePath();     
        
                
    AnalysisEngineDescription desc = null;
        
    String[] VarNames = {"Name1", "Name2"};
    String[] VarValues = {"Value1", "Value2"};
        
    try {
        desc = AnalysisEngineFactory.createEngineDescriptionFromPath(
        specFile.getAbsolutePath(), RutaEngine.PARAM_SCRIPT_PATHS, path+"/script",
        RutaEngine.PARAM_DESCRIPTOR_PATHS, path+"/descriptor", 
        RutaEngine.PARAM_RESOURCE_PATHS,path+"/resources", 
        RutaEngine.PARAM_VAR_NAMES, VarNames, 
        RutaEngine.PARAM_VAR_VALUES, VarValues); ..... End so on (Those parameters (VarNames and VarValues) are filled from query, but that is not so important right now)

Everything works fine and I am getting nice JSON output.一切正常,我越来越好 JSON output。 But now I am having troubles with those parameters (VarNames, VarValues) and I can't figure this out.但是现在我遇到了这些参数(VarNames,VarValues)的问题,我无法弄清楚。

When I make something like this in script Anamnesis.ruta当我在脚本 Anamnesis.ruta 中做这样的事情时

STRING Name1;
Anamnesis{->SETFEATURE("Lemma",Name1)};  

Everything works perfectly and I can see in my output that lemma for Anamnesis annotation is set to Value1... However I also need to work with those variables in projects Adjectives.ruta and Anatomy.ruta.一切都很完美,我可以在我的 output 中看到 Anamnesis 注释的引理设置为 Value1 ......但是我还需要在项目 Adjectives.ruta 和 Anatomy.ruta 中使用这些变量。 I suspect that those projects are controlled by their own descriptors (AdjectivesEngine.xml and AnatomyEngine.xml).我怀疑这些项目是由它们自己的描述符(AdjectivesEngine.xml 和 AnatomyEngine.xml)控制的。 Is there way to set the parameters for those projects and use them while creating ae from AnamnesisEngine.xml?有没有办法为这些项目设置参数并在从 AnamnesisEngine.xml 创建 ae 时使用它们?

When I try to add this to Anatomy.ruta (And again call AnamnesisEngine.xml)当我尝试将此添加到 Anatomy.ruta 时(并再次调用 AnamnesisEngine.xml)

STRING Name1;
Anatomy{->SETFEATURE("Lemma",Name1)};  

There is no Lemma at all in the output. output 中根本没有引理。 Which kind of makes sense but I was hoping that maybe that whole chain can be controlled by AnamnesisEngine.xml and those first two projects would be able to "find", assign and work with those variables... Well I was wrong...哪种是有道理的,但我希望整个链条可以由 AnamnesisEngine.xml 控制,而前两个项目将能够“找到”、分配和使用这些变量……嗯,我错了……

Please what would be the best way to achieve this?请问实现这一目标的最佳方法是什么?

If somebody is ever interested, I managed to achieve this with "Aggregate Engine Type" - which let's you import other descriptors into it and propagates variables into them... Epic!如果有人有兴趣,我设法通过“聚合引擎类型”实现了这一点——它让你可以将其他描述符导入其中并将变量传播到其中......史诗!

UIMA RUTA 在“ <!--”</div--><div id="text_translate"><p> 我正在使用 UIMA RUTA 来注释各种文档。 它们来自不同的来源,有时会出现字符 &lt;. 出现在文档的中间。 &lt;! 被注释为 MARKUP 并被其他注释忽略。</p><p> 有没有办法改变这种行为? 即使我关闭 MARKUP 注释,&lt; 之后的文本。 没有被任何其他注释注释。</p><p> 我找到了负责创建大部分 MARKUP 注释的代码部分(org.apache.uima.ruta.seed 包中的 DefaultSeeder),但我无法找到代码的哪一部分负责以 &lt; 开头的 MARKUP 注释!</p><p> 感谢您的任何建议!</p></div> - UIMA RUTA is not annotating text after “<!”

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 UIMA RUTA - 如何以特定顺序处理单词? - UIMA RUTA - How To Process Words In A Particular Order? 如何从uima-ruta脚本创建AnalysisEngineDescriptor以在SimplePipeline中使用 - How to create an AnalysisEngineDescriptor from an uima-ruta script to use in a SimplePipeline 如何从服务器返回UIMA Ruta的输出? - How to return UIMA Ruta's output from a server? 如何将输出xmi / cas传递给UIMA Ruta引擎? - How to pass an output xmi/cas to UIMA Ruta engine? UIMA RUTA中的数组IndexOutOfBound异常 - Array IndexOutOfBound exception in UIMA RUTA UIMA RUTA 在“ <!--”</div--><div id="text_translate"><p> 我正在使用 UIMA RUTA 来注释各种文档。 它们来自不同的来源,有时会出现字符 &lt;. 出现在文档的中间。 &lt;! 被注释为 MARKUP 并被其他注释忽略。</p><p> 有没有办法改变这种行为? 即使我关闭 MARKUP 注释,&lt; 之后的文本。 没有被任何其他注释注释。</p><p> 我找到了负责创建大部分 MARKUP 注释的代码部分(org.apache.uima.ruta.seed 包中的 DefaultSeeder),但我无法找到代码的哪一部分负责以 &lt; 开头的 MARKUP 注释!</p><p> 感谢您的任何建议!</p></div> - UIMA RUTA is not annotating text after “<!” 如何将整个文件夹及其后代作为资源提供给 UIMA(Ruta、Uimafit)? - How can I make an entire folder and its descendants available to UIMA (Ruta, Uimafit) as resources? 使用Java访问组合的UIMA Ruta批注 - Accessing combined UIMA Ruta Annotations in Java 使用UIMA Ruta时出现内存问题 - Memory problems, while using UIMA Ruta UIMA ruta - 使用来自不同视图的注释 - UIMA ruta - Using annotations from different views
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM