我想限制斯坦福核心NLP中句子的最大長度。由於某種原因,它似乎並不尊重這個屬性。這個標誌是LexicalizedParser的一部分。但是我在課堂上使用了StanfordCoreNLP實例。想知道設置這個標誌的正確方法是什麼。設置斯坦福核心句子的最大長度核心
Properties properties = new Properties();
properties.put("annotators", "tokenize,ssplit,pos,lemma,ner");
properties.put("-maxLength", "100"); // does not work
StanfordCoreNLP nap = new StanfordCoreNLP(properties);
進一步挖掘源代碼我發現praser.maxlen和pos.maxlen屬性在斯坦福核心NLP代碼中使用。但是當句子長度超出時,它並沒有拋出我期待的例外。 –