Skip to content
Snippets Groups Projects
Commit 4ce19f6f authored by Franck Dary's avatar Franck Dary
Browse files

added an option for error analysis

parent 20aef337
Branches
No related tags found
No related merge requests found
...@@ -56,6 +56,7 @@ po::options_description getOptionsDescription() ...@@ -56,6 +56,7 @@ po::options_description getOptionsDescription()
analysis.add_options() analysis.add_options()
("errorAnalysis", "Print an analysis of errors") ("errorAnalysis", "Print an analysis of errors")
("meanEntropy", "Print the mean entropy for error types") ("meanEntropy", "Print the mean entropy for error types")
("onlyPrefixes", "Only uses the prefixes of error categories")
("classifier", po::value<std::string>()->default_value(""), ("classifier", po::value<std::string>()->default_value(""),
"Name of the monitored classifier, if not specified monitor everyone"); "Name of the monitored classifier, if not specified monitor everyone");
...@@ -120,6 +121,7 @@ int main(int argc, char * argv[]) ...@@ -120,6 +121,7 @@ int main(int argc, char * argv[])
ProgramParameters::debug = vm.count("debug") == 0 ? false : true; ProgramParameters::debug = vm.count("debug") == 0 ? false : true;
ProgramParameters::errorAnalysis = vm.count("errorAnalysis") == 0 ? false : true; ProgramParameters::errorAnalysis = vm.count("errorAnalysis") == 0 ? false : true;
ProgramParameters::meanEntropy = vm.count("meanEntropy") == 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::dicts = vm["dicts"].as<std::string>();
ProgramParameters::printEntropy = vm.count("printEntropy") == 0 ? false : true; ProgramParameters::printEntropy = vm.count("printEntropy") == 0 ? false : true;
ProgramParameters::lang = vm["lang"].as<std::string>(); ProgramParameters::lang = vm["lang"].as<std::string>();
......
...@@ -4,6 +4,8 @@ Error::Error(std::string & prediction, std::string & gold, Classifier::WeightedA ...@@ -4,6 +4,8 @@ Error::Error(std::string & prediction, std::string & gold, Classifier::WeightedA
prediction(prediction), gold(gold), weightedActions(weightedActions) prediction(prediction), gold(gold), weightedActions(weightedActions)
{ {
type = prediction + "->" + gold; type = prediction + "->" + gold;
if (ProgramParameters::onlyPrefixes)
type = split(prediction,' ')[0] + "->" + split(gold,' ')[0];
indexOfPrediction = -1; indexOfPrediction = -1;
indexOfGold = -1; indexOfGold = -1;
distanceWithGold = 0; distanceWithGold = 0;
......
...@@ -57,6 +57,7 @@ struct ProgramParameters ...@@ -57,6 +57,7 @@ struct ProgramParameters
static std::string dicts; static std::string dicts;
static bool errorAnalysis; static bool errorAnalysis;
static bool meanEntropy; static bool meanEntropy;
static bool onlyPrefixes;
static std::map<std::string,std::string> featureModelByClassifier; static std::map<std::string,std::string> featureModelByClassifier;
private : private :
......
...@@ -44,6 +44,7 @@ bool ProgramParameters::printEntropy; ...@@ -44,6 +44,7 @@ bool ProgramParameters::printEntropy;
bool ProgramParameters::printTime; bool ProgramParameters::printTime;
bool ProgramParameters::errorAnalysis; bool ProgramParameters::errorAnalysis;
bool ProgramParameters::meanEntropy; bool ProgramParameters::meanEntropy;
bool ProgramParameters::onlyPrefixes;
int ProgramParameters::iterationSize; int ProgramParameters::iterationSize;
int ProgramParameters::nbTrain; int ProgramParameters::nbTrain;
std::string ProgramParameters::sequenceDelimiterTape; std::string ProgramParameters::sequenceDelimiterTape;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment