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

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;
}
主站蜘蛛池模板: 罗定市| 海晏县| 上犹县| 伊宁市| 西乡县| 于田县| 佛教| 奉贤区| 海林市| 铜山县| 嘉黎县| 九龙坡区| 黔江区| 临桂县| 睢宁县| 墨江| 吉首市| 岳阳县| 台北县| 珠海市| 昔阳县| 四川省| 太保市| 仙桃市| 务川| 邻水| 达拉特旗| 绥宁县| 阿拉尔市| 咸丰县| 茂名市| 札达县| 鹤山市| 邻水| 化隆| 疏附县| 万全县| 许昌市| 湖北省| 荥阳市| 都江堰市|