[英]UIMA ruta - Using annotations from different views
我有一个文档,经过几次注释后,我正在使用HTMLConverter将其写入一个新视图
样本输入:
<p class="MsoNormal"><span data-bkmark="para10121"></span><span style="font-family:Arial; font-size:10pt; color:#color: #000000">[1] SJ. Goetsch,BD. Murphy,R. Schmidt,et al. "Physics of rotating gamma systems for stereotactic radiosurgery. "</span> <span style="font-family:Arial; font-size:10pt; color:#color: #000000">International Journal of Radiation Oncologybiologyphysics,</span> vol.<span style="font-family:Arial; font-size:10pt; color:#color: #000000">43, no.3, pp.689-696, 1999.</span><span data-bkmark="para10121"></span></p>
我正在使用htmlconvertor创建一个新视图“plaintextview”
CONFIGURE(HtmlAnnotator, "onlyContent" = false); Document{-> EXEC(HtmlAnnotator)}; Document { -> CONFIGURE(HtmlConverter, "inputView" = "_InitialView","outputView" = "plaintextview"), EXEC(HtmlConverter,{TAG})};
之后我会运行自己的引擎并执行一些手动注释
try { for (AnnotationFS afs : CasUtil.select(cas.getView("plaintextview"), type)) { Feature bookmarkFtr = type.getFeatureByBaseName("RefBookmark"); System.out.println("\\n Ref is " + afs.getCoveredText()); System.out.println("STart is " + afs.getBegin()); System.out.println("End is " + afs.getEnd()); String test = " vol.43, no.3, pp.689-696, 1999."; if (afs.getCoveredText().contains(test)) { int start = afs.getCoveredText().indexOf(test) + afs.getBegin(); int end = start + test.length(); testanno annotation = new testanno(cas.getView("plaintextview").getJCas()); annotation.setBegin(start); annotation.setEnd(end); annotation.addToIndexes(); } } } catch (Exception e) { e.printStackTrace(); }
此代码将在明文 视图中注释特定文本(为什么? - 因为_initialview文档将在文本ex:vol.43,no.3,<some html tags> pp.689-696,1999之间具有html跨度。 )
那么我如何从plaintextview到初始视图获取我的注释,或者使用我在不同视图中的注释(即_initialview和plaintextview)在我的ruta脚本中使用这些注释?
在Ruta中,您无法直接为特定CAS视图编写规则。 (您可以使用EXEC在Ruta脚本中的不同视图上应用分析引擎。)
通过在聚合分析引擎中应用沙发映射或将视图复制到新CAS的_initialView,正常的方法是在框架级别上。
免责声明:我是UIMA Ruta的开发人员
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.