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

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;
}
主站蜘蛛池模板: 伊吾县| 启东市| 亳州市| 安陆市| 科技| 万荣县| 莱阳市| 越西县| 绩溪县| 莲花县| 吉安市| 屏东市| 花莲市| 江北区| 兴宁市| 昭通市| 南江县| 客服| 尚义县| 嘉兴市| 广丰县| 大姚县| 岳阳市| 云林县| 山东省| 安图县| 周至县| 韶关市| 商南县| 龙游县| 高邑县| 仁怀市| 武邑县| 怀宁县| 绥阳县| 马尔康县| 涿鹿县| 安阳市| 板桥市| 金山区| 苏州市|