Setting max Length for Sentence in StanfordCoreNLP

我与影子孤独终老i 提交于 2019-12-24 01:23:57

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!