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

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;
}
主站蜘蛛池模板: 九寨沟县| 龙游县| 明溪县| 枣庄市| 临猗县| 仪征市| 邮箱| 阳春市| 康保县| 定边县| 汤原县| 丹寨县| 通山县| 聂荣县| 榆社县| 舞阳县| 广南县| 固原市| 海林市| 浦江县| 米泉市| 博客| 绥芬河市| 鄂伦春自治旗| 边坝县| 苗栗县| 关岭| 涿鹿县| 营口市| 土默特右旗| 来安县| 钟祥市| 揭阳市| 株洲市| 滁州市| 桂平市| 吉隆县| 连州市| 即墨市| 富锦市| 大厂|