public void SubProcFillEmptyVectDictEn() { using (var dbx = new FastTextProcessDB(DBF_W2V_EN)) { var words = dbx.Dict(DictDbSet.DictKind.Addin).GetWordsWithEmptyVect(); if (words.Any()) { var fmod = DataArcPath("cc.en.300.bin"); AssertFileExists(fmod, "FastText model file"); var fexe = FastTextBin; AssertFileExists(fexe, "FastText executable"); var trans = dbx.BeginTransaction(); try { var dict = dbx.Dict(DictDbSet.DictKind.Addin); using (var ftl = new FastTextLauncher(fexe, fmod)) { ftl.RunAsync((w2v) => dict.UpdateVectOfWord(w2v)); foreach (var w in words) { ftl.Push(w); } } trans.Commit(); } catch { trans.Rollback(); throw; } } } }
public CommonEnCyr(FastTextLauncher ft_lang_detector, bool to_lower = true) { _ftLangDetector = ft_lang_detector; _toLower = to_lower; }
public CommonEnCyr(FastTextLauncher ft_launcher, bool to_lower = true) { _ftLauncher = ft_launcher; _toLower = to_lower; }