From: <ssc...@us...> - 2003-03-16 01:32:34
|
Update of /cvsroot/popfile/engine In directory sc8-pr-cvs1:/tmp/cvs-serv17259 Modified Files: traintest.pl Log Message: add stopword toggle (-stopwords 0 to test without stopwords) Index: traintest.pl =================================================================== RCS file: /cvsroot/popfile/engine/traintest.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** traintest.pl 16 Mar 2003 00:57:16 -0000 1.2 --- traintest.pl 16 Mar 2003 01:32:31 -0000 1.3 *************** *** 16,19 **** --- 16,20 ---- my $DEFAULT_CSV = 'auto'; my $DEFAULT_TOE = 1; + my $DEFAULT_STOP = 1; my $DEFAULT_WINDOW1 = 100; my $DEFAULT_WINDOW2 = 500; *************** *** 64,67 **** --- 65,69 ---- $config->parameter("csv",$DEFAULT_CSV); $config->parameter("toe",$DEFAULT_TOE); + $config->parameter("stopwords",$DEFAULT_STOP); $config->parameter("window1",$DEFAULT_WINDOW1); $config->parameter("window2",$DEFAULT_WINDOW2); *************** *** 87,90 **** --- 89,101 ---- } + if ( $config->parameter('stopwords') ne $DEFAULT_STOP ) { + $file .= "_"; + if ($config->parameter('stopwords') != 1) { + $file .= "no"; + } + $file .= "stop"; + } + + $file .= ".csv"; } *************** *** 251,254 **** --- 262,271 ---- $b->{unclassified__} = ($c->parameter("bayes_unclassified_probability") || 0.5); + # test with or without stop-words + if ( $c->parameter("stopwords") eq 0 ) { + $b->{parser__}->{mangle__}->{stop__} = {}; + $b->{mangler__}->{stop__} = {}; + } + my $archive = $c->parameter("ui_archive_dir"); *************** *** 398,402 **** print " -archive_dir: Location to seek an archive\n"; print " -csv: Filename to save CSV log to, \"auto\" generates a filename\n"; ! print " -toe: Train Only Errors, defaults to $DEFAULT_TOE"; } --- 415,420 ---- print " -archive_dir: Location to seek an archive\n"; print " -csv: Filename to save CSV log to, \"auto\" generates a filename\n"; ! print " -toe: Train Only Errors, defaults to $DEFAULT_TOE\n"; ! print " -stopwords: Use stop-words, defaults to $DEFAULT_STOP\n"; } |