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
Branches
No related tags found
No related merge requests found
......@@ -71,6 +71,7 @@ struct ProgramParameters
static std::string tapeToMask;
static float maskRate;
static bool featureExtraction;
static bool devEvalOnGold;
private :
......
......@@ -65,4 +65,5 @@ int ProgramParameters::dictCapacity;
std::string ProgramParameters::tapeToMask;
float ProgramParameters::maskRate;
bool ProgramParameters::featureExtraction;
bool ProgramParameters::devEvalOnGold;
......@@ -79,7 +79,16 @@ void Trainer::computeScoreOnDev()
if (pActionIsZeroCost)
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);
if (ProgramParameters::debug)
......
......@@ -87,6 +87,7 @@ po::options_description getOptionsDescription()
"The rate of elements of the Tape that will be masked.")
("printTime", "Print time on stderr.")
("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 examples after each iteration");
......@@ -270,6 +271,7 @@ int main(int argc, char * argv[])
ProgramParameters::printEntropy = vm.count("printEntropy") == 0 ? false : true;
ProgramParameters::printTime = vm.count("printTime") == 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::devName = vm["dev"].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