How to shutdown Stanford CoreNLP Redwood logging?

故事扮演 提交于 2019-12-03 12:04:20

You can also find the Redwood Tutorial PDF on GitHub in the Redwood project.

The url is in this page: https://github.com/gangeli/redwood/blob/master/doc/tutorial.pdf

(Obviously, I can't tell you if the documents are the same, 'cos I don't know the username / password either :-) )


Taking this a bit further, the Tutorial PDF I linked to really just a slide show. If you want documentation of the properties file, the best I could find was the javadocs for the RedwoodConfiguration.parse method. And in fact, the rest of that classes javadoc is probably the best doc that you will find ... short of reading the source code.

Warning ... there are indications that the free-standing Redwood code on GitHub may be different to the version in the NLP codebase.

StanfordNLP uses Redwood as logging framework for logging. You have to disable it before initializing StanfordNLP pipeline.

import edu.stanford.nlp.util.logging.RedwoodConfiguration;
RedwoodConfiguration.current().clear().apply();
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);

It works for me. It does not show lengthy INFO message in every line, while running program.

Hope it helps!

This can be resolved by setting blank Output Stream to System error stream.

Please see my answer in similar thread https://stackoverflow.com/a/48743963/1303210

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