private static void TrainLowLevel() { using (var fastText = new FastTextWrapper()) { fastText.Train(@"D:\__Models\cooking.train.txt", @"D:\__Models\cooking", new FastTextArgs { }); } }
public void CanTrainModelWithOldApi() { var fastText = new FastTextWrapper(loggerFactory: _loggerFactory); string outPath = Path.Combine(_tempDir, "cooking"); fastText.Train("cooking.train.txt", outPath, FastTextArgs.SupervisedDefaults()); CheckLabels(fastText.GetLabels()); File.Exists(outPath + ".bin").Should().BeTrue(); File.Exists(outPath + ".vec").Should().BeTrue(); }
private static void TrainSupervised(FastTextWrapper fastText, string trainFile, string modelFile) { fastText.Train(trainFile, modelFile, SupervisedArgs.SupervisedDefaults( x => { x.Epochs = 25; x.LearningRate = 1.0; x.WordNGrams = 3; x.Verbose = 2; x.LabelPrefix = "__label__"; })); }
private static void TrainSupervised() { using (var fastText = new FastTextWrapper()) { fastText.Train(@"D:\__Models\cooking.train.txt", @"D:\__Models\cooking", SupervisedArgs.SupervisedDefaults(x => { x.Epochs = 25; x.LearningRate = 1.0; x.WordNGrams = 3; x.Verbose = 2; x.LabelPrefix = "__label__"; })); } }
static void Main(string[] args) { var fastText = new FastTextWrapper(); fastText.Train(@"C:\_Models\cooking.train.txt", @"C:\_Models\cooking", TrainingArgs.SupervisedDefaults(x => { x.Epochs = 25; x.LearningRate = 1.0; x.WordNGrams = 3; x.Verbose = 2; x.MinCharNGrams = 3; x.MaxCharNGrams = 6; })); //fastText.LoadModel(@"C:\_Models\fasttext.bin"); var prediction = fastText.PredictSingle("what is the difference between a new york strip and a bone-in new york cut sirloin ?"); }
private static void TrainLowLevel(FastTextWrapper fastText, string trainFile, string modelFile) { fastText.Train(trainFile, modelFile, new FastTextArgs { }); }