我在管道中使用了一些 UIMA 注释器。它运行以下任务:
- 分词器
- 分句器
- 公报员
- 我的注释器
问题是我不想将所有注释(令牌、句子、子令牌、时间、myAnnotations 等)写入磁盘,因为文件很快就会变得非常大。
我想删除所有注释并仅保留My Annotator创建的注释。
我正在使用下一个库:
- uimaFIT 2.0.0
- 清除TK 1.4.1
- 马文
我正在使用一个org.apache.uima.fit.pipeline.SimplePipeline
:
SimplePipeline.runPipeline(
UriCollectionReader.getCollectionReaderFromDirectory(filesDirectory), //directory with text files
UriToDocumentTextAnnotator.getDescription(),
StanfordCoreNLPAnnotator.getDescription(),//stanford tokenize, ssplit, pos, lemma, ner, parse, dcoref
AnalysisEngineFactory.createEngineDescription(//
XWriter.class,
XWriter.PARAM_OUTPUT_DIRECTORY_NAME, outputDirectory,
XWriter.PARAM_FILE_NAMER_CLASS_NAME, ViewURIFileNamer.class.getName())
);
我要做的是使用 Standford NLP 注释器(来自 ClearTK)并删除无用的注释。
我该怎么做呢?
据我所知,您可以将removeFromIndexes();
方法 from 与 Annotation 实例一起使用。
我是否需要创建 UIMA 处理器并将其添加到我的管道中?