public static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".mv.db")) create = true; return create; }
private static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".h2.db")) create = true; return create; }
public static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".mv.db")) create = true; return create; }
public static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".h2.db")) create = true; return create; }
private static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".h2.db")) create = true; return create; }
public static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".mv.db")) create = true; return create; }
/** * Create a new empty file. */ public static boolean touch(String file) throws IOException { return !exists(file) && (new File(file)).createNewFile(); }
/** * Create a new empty file. */ public static boolean touch(String file) throws IOException { return !exists(file) && (new File(file)).createNewFile(); }
/** * Checks if the dataset is cached in the DB. * * @param dataset The name of the dataset (e.g. "train", "test") * @param dbFile The name of the MapDB file * @return Whether the dataset exists in the DB */ public boolean isCached(String dataset, String dbFile) { return IOUtils.exists(dbFile) && getMap(dataset).size() > 0; }
public static boolean rmDir(String directory) throws IOException { if (!exists(directory)) return false; if (!isDirectory(directory)) throw new IOException(directory + " is not a directory!"); return (new File(directory)).delete(); }
/** * Create a directory, if it does not exist. */ public static boolean mkdir(String dir) { if (!exists(dir)) { return (new File(dir)).mkdirs(); } else { return isDirectory(dir); } }
/** * Delete a file * * @return true only if the delete was successful */ public static boolean rm(String file) throws IOException { if (!exists(file)) return false; if (!isFile(file)) throw new IOException(file + " is not a file!"); return (new File(file)).delete(); }
/** * Delete a file * * @return true only if the delete was successful */ public static boolean rm(String file) throws IOException { if (!exists(file)) return false; if (!isFile(file)) throw new IOException(file + " is not a file!"); return (new File(file)).delete(); }
/** * Checks if the dataset is cached in the DB. * * @param dataset The name of the dataset (e.g. "train", "test") * @param dbFile The name of the MapDB file * @return Whether the dataset exists in the DB */ public boolean isCached(String dataset, String dbFile) { return IOUtils.exists(dbFile) && getMap(dataset).size() > 0; }
/** * Create a directory, if it does not exist. */ public static boolean mkdir(String dir) { if (!exists(dir)) { return (new File(dir)).mkdirs(); } else { return isDirectory(dir); } }
public static boolean rmDir(String directory) throws IOException { if (!exists(directory)) return false; if (!isDirectory(directory)) throw new IOException(directory + " is not a directory!"); return (new File(directory)).delete(); }
public void train() { if (!IOUtils.exists(modelsDir)) IOUtils.mkdir(modelsDir); Learner classifier = new PrepSRLClassifier(modelName + ".lc", modelName + ".lex"); Parser trainDataReader = new PrepSRLDataReader(dataDir, "train"); BatchTrainer trainer = new BatchTrainer(classifier, trainDataReader, 1000); trainer.train(20); classifier.save(); trainDataReader.close(); }
public void train() { if (!IOUtils.exists(modelsDir)) IOUtils.mkdir(modelsDir); Learner classifier = new PrepSRLClassifier(modelName + ".lc", modelName + ".lex"); Parser trainDataReader = new PrepSRLDataReader(dataDir, "train"); BatchTrainer trainer = new BatchTrainer(classifier, trainDataReader, 1000); trainer.train(20); classifier.save(); trainDataReader.close(); }