trubin / mate-tools

Automatically exported from code.google.com/p/mate-tools
0 stars 0 forks source link

debug and output of morphtagger go on the same stream if -out is set to /dev/stdout #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Input (see attached file):
1   Michael Michael Michael NE  NE  _   _   _   _   _   _   _   _   _
2   war sein    sein    VAFIN   VAFIN   _   _   _   _   _   _   _   _   _
3   ein eine    eine    ART ART _   _   _   _   _   _   _   _   _
4   guter   gut gut ADJA    ADJA    _   _   _   _   _   _   _   _   _
5   Junge   Junge   Junge   NN  NN  _   _   _   _   _   _   _   _   _
6   .   .   .   $.  $.  _   _   _   _   _   _   _   _   _

2. Command for testing:
java -Xmx2G -cp anna-3.3.jar is2.mtag.Tagger -model 
tiger-complete.anna-3-1.morphtagger.model -test /dev/stdin -out /dev/stdout 

3. Current output (see attached file):
45.20.675  is2.data.ParametersFloat 121:read ->        read parameters 
134217727 not zero 4044229
45.20.677  is2.data.Cluster 113:<init> ->              Read cluster with 0 
words 
45.20.678  is2.mtag.Tagger 148:readModel ->            Loading data finished. 
45.20.679  is2.mtag.Tagger 150:readModel ->            number of parameter 
134217727
45.20.679  is2.mtag.Tagger 151:readModel ->            number of classes   268
Processing Sentence: 
1   Michael Michael Michael NE  NE  _   case=nom|number=sg|gender=masc  -1  -1  _   _   _   _
2   war sein    sein    VAFIN   VAFIN   _   number=sg|person=3|tense=past|mood=ind  -1  -1  _   _   _
    _
3   ein eine    eine    ART ART _   case=nom|number=sg|gender=masc  -1  -1  _   _   _   _
4   guter   gut gut ADJA    ADJA    _   case=nom|number=sg|gender=masc|degree=pos   -1  -1  _   _   
_   _
5   Junge   Junge   Junge   NN  NN  _   case=nom|number=sg|gender=masc  -1  -1  _   _   _   _
6   .   .   .   $.  $.  _   _   -1  -1  _   _   _   _

2 0.0095 seconds/sentnece 
Used time 0.019 seconds 

What is the expected output? What do you see instead?

In the latest change of DB.java, the debug variable was switched on by default. 
But since all debug info gets printed to the same stream as processed strings, 
this output can't later be fed into parser via a pipe. Would it be possible to 
switch the debug off, or, even better, to print the debug info  to System.err, 
so that it could be separated from the rest in cases when -out is set to 
/dev/stdout. It's of course possible to fiddle with file descriptors, but 
nevertheless sending debug to System.err would probably be nicer.

What version of the product are you using? On what operating system?
anna-3.3.jar
tiger-complete.anna-3-1.morphtagger.model

OS: Linux 3.4.47-2.38-desktop x86_64

Please provide any additional information below.

Original issue reported on code.google.com by wlsidore...@gmail.com on 4 Sep 2013 at 7:40

Attachments:

GoogleCodeExporter commented 9 years ago
Never thought on a use like this. Yes, I changed this. The idea was to have 
files only because it takes some time to load the models. 
Thx. 
Bernd

Original comment by boh...@informatik.uni-stuttgart.de on 5 Sep 2013 at 2:59