java门API。成功创建管道,如何从处理的文档中获取注释集?
提前为我糟糕的语法感到抱歉。
我已经使用 GATE API 创建了一个管道,我成功运行了它。 我创建了一个像这样的串行分析器控制器: pipeline = (SerialAnalyserController)Factory.createResource("gate.creole.SerialAnalyserController"); ,然后我加载文件语料库(之前填充的)
pipeline.setCorpus(foo) 最后是 pipeline.execute()。
一切都很好,我看到了结果。我的问题是,我无法找到获取语料库中处理的每个文档的 AnnotationSet 的方法。例如,我想找到 AnnotationSet(“句子”)来查找句子在原始文本文件中开始和停止的偏移量。 API 没有告诉我如何从 SerialAnalyserController 获取注释 - 如何在流程管道完成后获取每个 gateway.Document。
提前致谢
sorry in advance for my poor grammar.
I have created a pipeline with GATE API, i run it successfully.
I created a serialanalysercontroller like this: pipeline = (SerialAnalyserController)Factory.createResource("gate.creole.SerialAnalyserController");
, then i load a corpus of files (previously populated)
pipeline.setCorpus(foo)
and last, pipeline.execute().
It all works great and i see the results. My problem is that i cannot find the way to get the AnnotationSet for each document that was processed in the corpus. For example i want to find the AnnotationSet ("sentences") to find in which offsets the sentences start and stop in the original text file. The API does not tell how I will get the annotations from the SerialAnalyserController - how to get each gate.Document after the process pipeline has finished.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,找到了!
我拿回语料库,然后因为语料库是一个列表,使用方法 get(x) 我得到我想要的文档,然后我得到注释集。
谢谢
Ok, found it!
I get the corpus back, then because the Corpus is a list, with method get(x) i get which document I want and then I get the annotationSets.
Thanks