Newer
Older
#include "BaseConfig.hpp"
#include "SubConfig.hpp"
Franck Dary
committed
#include "ReadingMachine.hpp"
fmt::print(stderr, "needs 4 arguments.\n");
exit(1);
}
std::string mcdFile = argv[2];
std::string tsvFile = argv[3];
//std::string rawFile = argv[4];
std::string rawFile = "";
std::filesystem::path modelPath(model);
auto machinePath = modelPath / "machine.rm";
ReadingMachine machine(machinePath.string());
BaseConfig goldConfig(mcdFile, tsvFile, rawFile);
SubConfig config(goldConfig);
Trainer trainer(machine);
trainer.createDataset(config);
auto devConfig = goldConfig;
decoder.decode(devConfig, 1);
decoder.evaluate(devConfig, modelPath, tsvFile);
fmt::print(stderr, "\r{:80}\rEpoch {}/{} loss = {} dev = {}\n", " ", i+1, nbEpoch, loss, decoder.getF1Score("UPOS"));