官术网_书友最值得收藏!

The Program class

In the Program class, we added a third option to extract features and create the sample data .tsv file:

  1. To begin, we modify the help text to indicate the new extract option that takes a path to the training folder:
if (args.Length != 2)
{
Console.WriteLine($"Invalid arguments passed in, exiting.{Environment.NewLine}{Environment.NewLine}Usage:{Environment.NewLine}" +
$"predict <path to input file>{Environment.NewLine}" +
$"or {Environment.NewLine}" +
$"train <path to training data file>{Environment.NewLine}" +
$"or {Environment.NewLine}" +
$"extract <path to folder>{Environment.NewLine}");

return;
}
  1. In addition, we also need to modify the main switch/case to support the extract argument:
switch (args[0])
{
case "extract":
new FeatureExtractor().Extract(args[1]);
break;
case "predict":
new Predictor().Predict(args[1]);
break;
case "train":
new Trainer().Train(args[1]);
break;
default:
Console.WriteLine($"{args[0]} is an invalid option");
break;
}
主站蜘蛛池模板: 十堰市| 化隆| 龙游县| 日喀则市| 耒阳市| 衡水市| 美姑县| 香港 | 西城区| 门头沟区| 敦化市| 石柱| 绥棱县| 武陟县| 韶关市| 甘泉县| 阿克苏市| 富民县| 历史| 吕梁市| 扎鲁特旗| 南城县| 浦县| 海原县| 渭南市| 雅江县| 隆安县| 昭觉县| 张家界市| 阳西县| 宜城市| 定陶县| 保亭| 保山市| 鄂州市| 建平县| 焉耆| 会昌县| 桦甸市| 沙田区| 岑巩县|