问题
I am trying to restrict the max length for a sentence in StanfordCoreNLP. For some reason it does not seem to honor this property. This flag is part of the LexicalizedParser. But I am using StanfordCoreNLP instance in my class. Wondering what is the right way to set this flag.
Properties properties = new Properties();
properties.put("annotators", "tokenize,ssplit,pos,lemma,ner");
properties.put("-maxLength", "100"); // does not work
StanfordCoreNLP nap = new StanfordCoreNLP(properties);
回答1:
At present, CoreNLP has no general maxLength flag. Individual Annotators may have one like parse.maxlen
, but if the sentence is too long, that means simply skipping running that annotator.
来源:https://stackoverflow.com/questions/38159699/setting-max-length-for-sentence-in-stanfordcorenlp