gpt4 book ai didi

stanford-nlp - stanfordcorenlp 中的词干选项

转载 作者:行者123 更新时间:2023-12-04 05:28:32 31 4
gpt4 key购买 nike

问题:是否可以选择使用 stanford-core-nlp 来词干? ?
我找不到一个!我正在使用 stanford-corenlp-3.5.2.jar。

代码:

public class StanfordNLPTester {

public static void main (String args[]){

String paragraph = "A long paragraph here";

Properties properties = new Properties();
properties.put("annotators","tokenize,ssplit,pos,lemma,ner,depparse");
StanfordCoreNLP pipeline = new StanfordCoreNLP(properties);
Annotation annotation = new Annotation (paragraph);
pipeline.annotate(annotation);
pipeline.prettyPrint(annotation,System.out);
}
}

最佳答案

您需要从 GitHub 获取此信息:https://github.com/stanfordnlp/CoreNLP

本类(class)将提供您想要的:

https://github.com/stanfordnlp/CoreNLP/blob/master/src/edu/stanford/nlp/process/Stemmer.java

该类的 main() 方法显示了词干分析器的示例用法。

您可以继续使用 stanford-corenlp-3.5.2.jar 并只包含一个额外的类,因为该类所依赖的所有内容都在 jar 中。

关于stanford-nlp - stanfordcorenlp 中的词干选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33050169/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com