[英]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:首先,我有几个创建链的脚本:
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!如果有人有兴趣,我设法通过“聚合引擎类型”实现了这一点——它让你可以将其他描述符导入其中并将变量传播到其中......史诗!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.