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

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;
}
主站蜘蛛池模板: 故城县| 买车| 洛浦县| 华蓥市| 澎湖县| 天台县| 龙海市| 博白县| 德州市| 项城市| 龙山县| 大余县| 金坛市| 仪征市| 肇源县| 平乡县| 吴旗县| 平度市| 奈曼旗| 米泉市| 武隆县| 无锡市| 读书| 英德市| 固始县| 安溪县| 大姚县| 牡丹江市| 乌拉特中旗| 英山县| 灵石县| 海南省| 寻乌县| 博乐市| 安远县| 文山县| 昭苏县| 佳木斯市| 丹寨县| 商水县| 陆川县|