コード例 #1
0
        public FastTextLanguageDetector(int version) : base(Language.Any, version, nameof(FastTextLanguageDetector), compress: false)
        {
            Model           = new FastText(Language.Any, version, "language-detector");
            Model.Data.Type = FastText.ModelType.Supervised;
            Model.Data.MaximumWordNgrams  = 0;
            Model.Data.MinimumNgrams      = 2;
            Model.Data.MaximumNgrams      = 5;
            Model.Data.VectorQuantization = QuantizationType.None;
            Model.Data.LearningRate       = 0.1f;
            Model.Data.Epoch        = 50;
            Model.Data.Dimensions   = 16;
            Model.Data.IgnoreCase   = false;
            Model.Data.Loss         = FastText.LossType.NegativeSampling;
            Model.Data.MinimumCount = 5;

            Tokenizer = new SpaceTokenizer();
        }