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

Added an option to show dev gold accuracy

parent abee1198
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,7 @@ struct ProgramParameters ...@@ -71,6 +71,7 @@ struct ProgramParameters
static std::string tapeToMask; static std::string tapeToMask;
static float maskRate; static float maskRate;
static bool featureExtraction; static bool featureExtraction;
static bool devEvalOnGold;
private : private :
......
...@@ -65,4 +65,5 @@ int ProgramParameters::dictCapacity; ...@@ -65,4 +65,5 @@ int ProgramParameters::dictCapacity;
std::string ProgramParameters::tapeToMask; std::string ProgramParameters::tapeToMask;
float ProgramParameters::maskRate; float ProgramParameters::maskRate;
bool ProgramParameters::featureExtraction; bool ProgramParameters::featureExtraction;
bool ProgramParameters::devEvalOnGold;
...@@ -79,7 +79,16 @@ void Trainer::computeScoreOnDev() ...@@ -79,7 +79,16 @@ void Trainer::computeScoreOnDev()
if (pActionIsZeroCost) if (pActionIsZeroCost)
TI.addDevSuccess(tm.getCurrentClassifier()->name); TI.addDevSuccess(tm.getCurrentClassifier()->name);
std::string actionName = pAction; std::string actionName;
if (ProgramParameters::devEvalOnGold)
{
int neededActionIndex = tm.getCurrentClassifier()->getOracleActionIndex(*devConfig);
actionName = tm.getCurrentClassifier()->getActionName(neededActionIndex);
}
else
{
actionName = pAction;
}
Action * action = tm.getCurrentClassifier()->getAction(actionName); Action * action = tm.getCurrentClassifier()->getAction(actionName);
if (ProgramParameters::debug) if (ProgramParameters::debug)
......
...@@ -87,6 +87,7 @@ po::options_description getOptionsDescription() ...@@ -87,6 +87,7 @@ po::options_description getOptionsDescription()
"The rate of elements of the Tape that will be masked.") "The rate of elements of the Tape that will be masked.")
("printTime", "Print time on stderr.") ("printTime", "Print time on stderr.")
("featureExtraction", "Use macaon only a feature extractor, print corpus to stdout.") ("featureExtraction", "Use macaon only a feature extractor, print corpus to stdout.")
("devEvalOnGold", "If true, dev accuracy will be computed on gold configurations.")
("shuffle", po::value<bool>()->default_value(true), ("shuffle", po::value<bool>()->default_value(true),
"Shuffle examples after each iteration"); "Shuffle examples after each iteration");
...@@ -270,6 +271,7 @@ int main(int argc, char * argv[]) ...@@ -270,6 +271,7 @@ int main(int argc, char * argv[])
ProgramParameters::printEntropy = vm.count("printEntropy") == 0 ? false : true; ProgramParameters::printEntropy = vm.count("printEntropy") == 0 ? false : true;
ProgramParameters::printTime = vm.count("printTime") == 0 ? false : true; ProgramParameters::printTime = vm.count("printTime") == 0 ? false : true;
ProgramParameters::featureExtraction = vm.count("featureExtraction") == 0 ? false : true; ProgramParameters::featureExtraction = vm.count("featureExtraction") == 0 ? false : true;
ProgramParameters::devEvalOnGold = vm.count("devEvalOnGold") == 0 ? false : true;
ProgramParameters::trainName = vm["train"].as<std::string>(); ProgramParameters::trainName = vm["train"].as<std::string>();
ProgramParameters::devName = vm["dev"].as<std::string>(); ProgramParameters::devName = vm["dev"].as<std::string>();
ProgramParameters::lang = vm["lang"].as<std::string>(); ProgramParameters::lang = vm["lang"].as<std::string>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment