我已经从http://nlp.stanford.edu/software/corenlp.shtml#Download下载并安装了所需的jar文件.
我已经包含了五个jar文件
Satnford-postagger.jar
斯坦福大学psotagger-3.3.1.jar
斯坦福大学psotagger-3.3.1.jar,javadoc.jar
斯坦福大学psotagger-3.3.1.jar-src.jar
斯坦福大学corenlp-3.3.1.jar
而代码是
public class lemmafirst {
protected StanfordCoreNLP pipeline;
public lemmafirst() {
// Create StanfordCoreNLP object properties, with POS tagging
// (required for lemmatization), and lemmatization
Properties props;
props = new Properties();
props.put("annotators", "tokenize, ssplit, pos, lemma");
/*
* This is a pipeline that takes in a string and returns various analyzed linguistic forms.
* The String is tokenized via a tokenizer (such as PTBTokenizerAnnotator),
* and then other sequence model style …Run Code Online (Sandbox Code Playgroud)