Exemplo n.º 1
0
        private void RunTmt_DoWork(object sender, DoWorkEventArgs e)
        {
            TmtToolMg.RunTmtTool(tbTopicNumberArray.Text.Trim(), tbMaxIteration.Text.Trim());
            int    maxIteration        = Int32.Parse(Configures.GetAutoWizardMaxIteration());
            string termDistZipFilePath = FileMg.AutoTmtOutputFileDir + string.Format(Constants.TmtOutputTopicTermDistZipFilePathTemp, maxIteration.ToString("D5"));

            UnzipToolMg.RunUnzipTool(termDistZipFilePath, FileMg.AutoRDataFileDir);
            e.Result = true;
        }
Exemplo n.º 2
0
        private static bool GenerateTopicWithTmt(BackgroundWorker backgroundWorker)
        {
            OutputMg.OutputHeader1(backgroundWorker, "Step 3", "Generate Topic with TMT");
            /* 1. Run Tmt Tool */
            OutputMg.OutputContent(backgroundWorker, "Start to run TMT");
            if (!TmtToolMg.RunTmtTool(Configures.GetAutoWizardTopicNumberArray(), Configures.GetAutoWizardMaxIteration()))
            {
                OutputMg.OutputContent(backgroundWorker, "Failed to startup TMT. Make sure you have authority to run command.");
                return(false);
            }

            /* 2. Check Tmt output */
            int    maxIter             = Int32.Parse(Configures.GetAutoWizardMaxIteration());
            string termDistZipFilePath = FileMg.AutoTmtOutputFileDir + string.Format(Constants.TmtOutputTopicTermDistZipFilePathTemp, maxIter.ToString("D5"));

            if (!File.Exists(termDistZipFilePath))
            {
                OutputMg.OutputContent(backgroundWorker, "Cannot find the result file of topic modeling.");
                return(false);
            }

            OutputMg.OutputContent(backgroundWorker, "Finished generating topic and term distribution.");

            /* 3. Unzip Term distribution */
            OutputMg.OutputContent(backgroundWorker, "Start to unzip term distribution file");
            if (!UnzipToolMg.RunUnzipTool(termDistZipFilePath, FileMg.AutoRDataFileDir) ||
                !File.Exists(FileMg.AutoRDataFileDir + Constants.RInputFileName))
            {
                OutputMg.OutputContent(backgroundWorker, "Failed to unzip term distribution file. Make sure you have setup 7-zip.");
                return(false);
            }

            OutputMg.OutputContent(backgroundWorker, "Finished unzipping term distribution file.");

            return(true);
        }