diff --git a/decoder/src/macaon_decode.cpp b/decoder/src/macaon_decode.cpp index d0e1e365a717f5ef60135e68c72d81be4dcf6ba2..4dd69599a67161fbef28d67a1fd1f8a935292f2c 100644 --- a/decoder/src/macaon_decode.cpp +++ b/decoder/src/macaon_decode.cpp @@ -56,6 +56,7 @@ po::options_description getOptionsDescription() analysis.add_options() ("errorAnalysis", "Print an analysis of errors") ("meanEntropy", "Print the mean entropy for error types") + ("onlyPrefixes", "Only uses the prefixes of error categories") ("classifier", po::value<std::string>()->default_value(""), "Name of the monitored classifier, if not specified monitor everyone"); @@ -120,6 +121,7 @@ int main(int argc, char * argv[]) ProgramParameters::debug = vm.count("debug") == 0 ? false : true; ProgramParameters::errorAnalysis = vm.count("errorAnalysis") == 0 ? false : true; ProgramParameters::meanEntropy = vm.count("meanEntropy") == 0 ? false : true; + ProgramParameters::onlyPrefixes = vm.count("onlyPrefixes") == 0 ? false : true; ProgramParameters::dicts = vm["dicts"].as<std::string>(); ProgramParameters::printEntropy = vm.count("printEntropy") == 0 ? false : true; ProgramParameters::lang = vm["lang"].as<std::string>(); diff --git a/error_correction/src/Error.cpp b/error_correction/src/Error.cpp index c2f94ccdb457b4baef4782e888edddb41a139c1e..93fabe99260712dcb5b8705ee3b2b8da4dcb7e04 100644 --- a/error_correction/src/Error.cpp +++ b/error_correction/src/Error.cpp @@ -4,6 +4,8 @@ Error::Error(std::string & prediction, std::string & gold, Classifier::WeightedA prediction(prediction), gold(gold), weightedActions(weightedActions) { type = prediction + "->" + gold; + if (ProgramParameters::onlyPrefixes) + type = split(prediction,' ')[0] + "->" + split(gold,' ')[0]; indexOfPrediction = -1; indexOfGold = -1; distanceWithGold = 0; diff --git a/maca_common/include/ProgramParameters.hpp b/maca_common/include/ProgramParameters.hpp index ddd9dfa28daf8ba2c28bd8153c1137965f24a208..ce26f3a79aa2b3446b2716d178f07ad1efa0d507 100644 --- a/maca_common/include/ProgramParameters.hpp +++ b/maca_common/include/ProgramParameters.hpp @@ -57,6 +57,7 @@ struct ProgramParameters static std::string dicts; static bool errorAnalysis; static bool meanEntropy; + static bool onlyPrefixes; static std::map<std::string,std::string> featureModelByClassifier; private : diff --git a/maca_common/src/ProgramParameters.cpp b/maca_common/src/ProgramParameters.cpp index eb32e682dccfa1ec89143706857fe487d12f9548..c5fe5eaa9592cc2c78a9777dbfdab53c2af3e2e8 100644 --- a/maca_common/src/ProgramParameters.cpp +++ b/maca_common/src/ProgramParameters.cpp @@ -44,6 +44,7 @@ bool ProgramParameters::printEntropy; bool ProgramParameters::printTime; bool ProgramParameters::errorAnalysis; bool ProgramParameters::meanEntropy; +bool ProgramParameters::onlyPrefixes; int ProgramParameters::iterationSize; int ProgramParameters::nbTrain; std::string ProgramParameters::sequenceDelimiterTape;