示例#1
0
        /// <summary>
        /// Trains a new unsupervised model.
        /// </summary>
        /// <param name="model">Type of unsupervised model: Skipgram or Cbow.</param>
        /// <param name="inputPath">Path to a training set.</param>
        /// <param name="outputPath">Path to write the model to (excluding extension).</param>
        /// <param name="args">Low-level training arguments.</param>
        /// <remarks>Trained model will consist of two files: .bin (main model) and .vec (word vectors).</remarks>
        public void Unsupervised(UnsupervisedModel model, string inputPath, string outputPath, UnsupervisedArgs args)
        {
            ValidatePaths(inputPath, outputPath, args.PretrainedVectors);

            args.model = (ModelName)model;

            var argsStruct = _mapper.Map <FastTextArgsStruct>(args);

            CheckForErrors(Train(_fastText, inputPath, outputPath, argsStruct, new AutotuneArgsStruct(), args.LabelPrefix, args.PretrainedVectors, false));
            _maxLabelLen = 0;

            ModelPath = AdjustPath(outputPath, false);
        }
示例#2
0
 /// <summary>
 /// Trains a new unsupervised model.
 /// </summary>
 /// <param name="model">Type of unsupervised model: Skipgram or Cbow.</param>
 /// <param name="inputPath">Path to a training set.</param>
 /// <param name="outputPath">Path to write the model to (excluding extension).</param>
 /// <remarks>Trained model will consist of two files: .bin (main model) and .vec (word vectors).</remarks>
 public void Unsupervised(UnsupervisedModel model, string inputPath, string outputPath)
 {
     Unsupervised(model, inputPath, outputPath, new UnsupervisedArgs());
 }