0

I am making a call to edu.stanford.nlp.classify.ColumnDataClassifier.makeClassifier(), and I need to block the std out that it generates. I tried setting displayedColumn=-1 in the .prop file, but it does not see to me help. The following is the console output makeClassifier() generates that I want to eliminate. Can someone help?

Console output:

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 - 
Frakcool
  • 10,915
  • 9
  • 50
  • 89

1 Answers1

0

Without knowing Stanford NLP in detail (it might be, that they offer some redirect via API... check that in advance!), but what you always can do, is redirect the whole stderr and stdout, by using System.setOut(PrintStream) and/or System.setErr(PrintStream) and providing your own PrintStream.

qqilihq
  • 10,794
  • 7
  • 48
  • 89
  • Thanks for the suggestion. Sorry I must have mentioned before, I tried overriding write() as suggested here but surprisingly the makeClassifier still dumps the output to stdout.[link](http://stackoverflow.com/questions/4799006/in-java-how-can-i-redirect-system-out-to-null-then-back-to-stdout-again) – user3286916 Feb 08 '14 at 14:11