features can be activated using a comma- or blank-separated list

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1485 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
nicolabertoldi 2007-10-23 16:55:02 +00:00
parent 9e70b5ffd8
commit 8710cc9bc9
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ echo " perform cmert on a subset of the feature scores"
echo " the ratios among not activated weights are not modified" echo " the ratios among not activated weights are not modified"
echo " Parameters (*=optional):" echo " Parameters (*=optional):"
echo " -d: the number of original features" echo " -d: the number of original features"
echo " -activate (*): comma-separated list of the indexes of active features" echo " -activate (*): comma-separated (or blank-separated) list of the indexes of active features"
echo " if not set, all features are optimized" echo " if not set, all features are optimized"
echo " -debug(*): debug information" echo " -debug(*): debug information"
echo " -help(*): print his help" echo " -help(*): print his help"

View File

@ -143,7 +143,7 @@ my $obo_scorenbest = undef; # set to pathname to a Ondrej Bojar's scorer (not in
# in scripts distribution) # in scripts distribution)
my $efficient_scorenbest_flag = undef; # set to 1 to activate a time-efficient scoring of nbest lists my $efficient_scorenbest_flag = undef; # set to 1 to activate a time-efficient scoring of nbest lists
# (this method is more memory-consumptive) # (this method is more memory-consumptive)
my $___ACTIVATE_FEATURES = undef; # comma-separated list of features to work on my $___ACTIVATE_FEATURES = undef; # comma-separated (or blank-separated) list of features to work on
# if undef work on all features # if undef work on all features
# (others are fixed to the starting values) # (others are fixed to the starting values)
@ -182,7 +182,7 @@ GetOptions(
"obo-scorenbest=s" => \$obo_scorenbest, # see above "obo-scorenbest=s" => \$obo_scorenbest, # see above
"efficient_scorenbest_flag" => \$efficient_scorenbest_flag, # activate a time-efficient scoring of nbest lists "efficient_scorenbest_flag" => \$efficient_scorenbest_flag, # activate a time-efficient scoring of nbest lists
"async=i" => \$___ASYNC, #whether script to be used with async decoder "async=i" => \$___ASYNC, #whether script to be used with async decoder
"activate-features=s" => \$___ACTIVATE_FEATURES, #comma-separated list of features to work on (others are fixed to the starting values) "activate-features=s" => \$___ACTIVATE_FEATURES, #comma-separated (or blank-separated) list of features to work on (others are fixed to the starting values)
) or exit(1); ) or exit(1);
# the 4 required parameters can be supplied on the command line directly # the 4 required parameters can be supplied on the command line directly
@ -297,7 +297,7 @@ if (defined $obo_scorenbest) {
if $___AVERAGE; if $___AVERAGE;
} }
if ($___ACTIVATE_FEATURES){ $cmertcmd.=" -activate $___ACTIVATE_FEATURES"; } if ($___ACTIVATE_FEATURES){ $cmertcmd.=" -activate \"$___ACTIVATE_FEATURES\""; }
my $input_abs = ensure_full_path($___DEV_F); my $input_abs = ensure_full_path($___DEV_F);
die "File not found: $___DEV_F (interpreted as $input_abs)." die "File not found: $___DEV_F (interpreted as $input_abs)."