[英]How to get lemmas from sentences in DKPro/UIMA?
我正在尝试建立一个管道,该管道生成残化的句子。 我知道如何获得所有句子或所有引理,但是我不知道如何获得引理除以句子结尾的集合。 这是一个缺少参数的代码片段,用??????
标记 :
AnalysisEngine pipeline = createEngine(createEngineDescription(
createEngineDescription(BreakIteratorSegmenter.class),
createEngineDescription(StanfordLemmatizer.class),
createEngineDescription(StopWordRemover.class, StopWordRemover.PARAM_MODEL_LOCATION,
new String[]{"stopwords.txt"})));
JCas jcas = JCasFactory.createJCas();
jcas.setDocumentText ("Almost all energy on Earth comes from the Sun. Plants make food energy from sunlight.");
jcas.setDocumentLanguage("en");
pipeline.process (jcas);
for (Sentence s : select(jcas, Sentence.class)) {
out.println("");
for (Lemma l : select(??????, Lemma.class))
out.print(l.getValue() + " ");
}
我需要在此代码中进行哪些更改,以便它在两行中从两个输入语句中打印出引理。
干得好:
for (Lemma l : JCasUtil.selectCovered(Lemma.class, s))
out.print(l.getValue() + " ");
披露:我正在研究Apache UIMA项目
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.