如何抑制斯坦福NLP ColumnDataClassifier.makeClassifier()函数的stdout

时间:2014-02-08 10:49:30

标签: java nlp classification stanford-nlp

我打电话给edu.stanford.nlp.classify.ColumnDataClassifier.makeClassifier(),我需要阻止它生成的标准。我尝试在.prop文件中设置displayedColumn=-1,但它没有向我提供帮助。以下是我想要消除的控制台输出makeClassifier()生成。有人可以帮忙吗?

控制台输出:

QNMinimizer called on double function of 1596 variables, using M = 15.
               An explanation of the output:
Iter           The number of iterations
evals          The number of function evaluations
SCALING        <D> Diagonal scaling was used; <I> Scaled Identity
LINESEARCH     [## M steplength]  Minpack linesearch
                   1-Function value was too high
                   2-Value ok, gradient positive, positive curvature
                   3-Value ok, gradient negative, positive curvature
                   4-Value ok, gradient negative, negative curvature
               [.. B]  Backtracking
VALUE          The current function value
TIME           Total elapsed time
|GNORM|        The current norm of the gradient
{RELNORM}      The ratio of the current to initial gradient norms
AVEIMPROVE     The average improvement / current value
EVALSCORE      The last available eval score

Iter ## evals ## <SCALING> [LINESEARCH] VALUE TIME |GNORM| {RELNORM} AVEIMPROVE EVALSCORE

Iter 1 evals 1 <D> [M 1.000E-1] 6.808E-1 0.00s |3.890E-1| {1.111E-2} 0.000E0 - 

1 个答案:

答案 0 :(得分:0)

不详细了解斯坦福NLP(可能是,他们通过API提供一些重定向...提前检查!),但你总能做的是重定向整个 stderr和stdout,使用System.setOut(PrintStream)和/或System.setErr(PrintStream)并提供您自己的PrintStream