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

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;
}
主站蜘蛛池模板: 星座| 靖西县| 安岳县| 岳阳市| 鸡西市| 伊宁市| 苍南县| 东安县| 怀柔区| 井研县| 隆尧县| 土默特左旗| 泽库县| 铁岭市| 娄底市| 桐柏县| 通化县| 金山区| 开阳县| 新蔡县| 盘锦市| 松原市| 会宁县| 平塘县| 英超| 龙门县| 尖扎县| 宁津县| 吴川市| 扎赉特旗| 北辰区| 德州市| 柳州市| 彝良县| 依兰县| 舞阳县| 南丰县| 芦溪县| 伊金霍洛旗| 泾阳县| 攀枝花市|