parser = argparse.ArgumentParser()
parser.add_argument("system", type=str, help="Path to system output.")
parser.add_argument("gold", type=str, help="Path to gold data.")
args = parser.parse_args()
with open(args.system, "r", encoding="utf-8") as system_file:
system = [line.rstrip("\n") for line in system_file]
After Change
if __name__ == "__main__":
// Parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("predictions", type=str, help="Path to predicted output.")
parser.add_argument("dataset", type=str, help="Which dataset to evaluate ("dev", "test").")
args = parser.parse_args([] if "__file__" not in globals() else None)
gold = getattr(TimitMFCC(), args.dataset).data["letters"]
with open(args.predictions, "r", encoding="utf-8") as predictions_file:
predictions = [line.rstrip("\n") for line in predictions_file]