public VectorExtractor(int numThreads, int numPages, String lsaRoot, int dim, boolean normalized) throws IOException { super(numThreads, numPages); if (!lsaRoot.endsWith(File.separator)) { lsaRoot += File.separator; } logger.info("reading lsm model from " + lsaRoot + " (" + dim + ")..."); File Ut = new File(lsaRoot + "X-Ut"); File Sk = new File(lsaRoot + "X-S"); File r = new File(lsaRoot + "X-row"); File c = new File(lsaRoot + "X-col"); File df = new File(lsaRoot + "X-df"); boolean rescaleIdf = true; lsm = new LSM(Ut, Sk, r, c, df, dim, rescaleIdf, normalized); }
public WikipediaVectorExtractor(int numThreads, int numPages, Locale locale, String lsaRoot) throws IOException { super(numThreads, numPages, locale); if (!lsaRoot.endsWith(File.separator)) { lsaRoot += File.separator; } File Ut = new File(lsaRoot + "X-Ut"); File Sk = new File(lsaRoot + "X-S"); File r = new File(lsaRoot + "X-row"); File c = new File(lsaRoot + "X-col"); File df = new File(lsaRoot + "X-df"); int dim = 100; boolean rescaleIdf = true; lsm = new LSM(Ut, Sk, r, c, df, dim, rescaleIdf); }
public static void main(String[] args) throws Exception { String logConfig = System.getProperty("log-config"); if (logConfig == null) { logConfig = "log-config.txt"; } PropertyConfigurator.configure(logConfig); if (args.length != 6) { System.out.println( "Usage: java -mx512M eu.fbk.utils.lsa.util.NgramComparator input threshold size dim idf file"); System.exit(1); } File Ut = new File(args[0] + "-Ut"); File Sk = new File(args[0] + "-S"); File r = new File(args[0] + "-row"); File c = new File(args[0] + "-col"); File df = new File(args[0] + "-df"); double threshold = Double.parseDouble(args[1]); int size = Integer.parseInt(args[2]); int dim = Integer.parseInt(args[3]); boolean rescaleIdf = Boolean.parseBoolean(args[4]); LSM lsm = new LSM(Ut, Sk, r, c, df, dim, rescaleIdf); LSSimilarity lss = new LSSimilarity(lsm, size); new NgramComparator(args[5], lss); } // end main } // end NgramComparator
File doc = new File(args[3]); LSM lsm = new LSM(Ut, Sk, r, c, df, dim, rescaleIdf); LSSimilarity lss = new LSSimilarity(lsm, size); double qt = Double.parseDouble(args[4]);
boolean rescaleIdf = Boolean.parseBoolean(args[4]); LSM lsm = new LSM(Ut, Sk, r, c, df, dim, rescaleIdf); LSSimilarity lss = new LSSimilarity(lsm, size);
public static void main(String[] args) throws Exception { String logConfig = System.getProperty("log-config"); if (logConfig == null) { logConfig = "log-config.txt"; } PropertyConfigurator.configure(logConfig); if (args.length != 7) { System.out.println( "Usage: java -mx2G eu.fbk.utils.lsa.util.Text2Vector lsa-root lsa-dim in-csv-file out-file id-col text-col separator"); System.exit(1); } File Ut = new File(args[0] + "-Ut"); File Sk = new File(args[0] + "-S"); File r = new File(args[0] + "-row"); File c = new File(args[0] + "-col"); File df = new File(args[0] + "-df"); double threshold = 0.5;//Double.parseDouble(args[1]); int size = 20;//Integer.parseInt(args[2]); int dim = Integer.parseInt(args[1]); boolean rescaleIdf = false;//Boolean.parseBoolean(args[4]); File in = new File(args[2]); File out = new File(args[3]); int i = Integer.parseInt(args[4]); int j = Integer.parseInt(args[5]); //LSM lsm = null; LSM lsm = new LSM(Ut, Sk, r, c, df, dim, rescaleIdf); //LSSimilarity lss = new LSSimilarity(lsm, size); new Text2Vector(lsm, in, out, i, j, args[6]); } // end main
public static void main(String[] args) throws Exception { String logConfig = System.getProperty("log-config"); if (logConfig == null) { logConfig = "log-config.txt"; } long begin = System.currentTimeMillis(); PropertyConfigurator.configure(logConfig); if (args.length != 5) { logger.info(getHelp()); System.exit(1); } File Ut = new File(args[0] + "-Ut"); File Sk = new File(args[0] + "-S"); File r = new File(args[0] + "-row"); File c = new File(args[0] + "-col"); File df = new File(args[0] + "-df"); double threshold = Double.parseDouble(args[1]); int size = Integer.parseInt(args[2]); int dim = Integer.parseInt(args[3]); boolean rescaleIdf = Boolean.parseBoolean(args[4]); LSM LSM = new LSM(Ut, Sk, r, c, df, dim, rescaleIdf); LSM.interactive(); long end = System.currentTimeMillis(); logger.info("term similarity calculated in " + (end - begin) + " ms"); } // end main
LSM lsm = new LSM(Ut, Sk, r, c, df, dim, rescaleIdf); LSSimilarity lss = new LSSimilarity(lsm, size, stemmer); lss.interactive();
LSM lsm = new LSM(fileUt, fileSk, fileR, fileC, fileDf, dim, true);
normalized = true; LSM lsm = new LSM(fileUt, fileSk, fileR, fileC, fileDf, dim, true, normalized);
LSM lsm = new LSM(Ut, Sk, r, c, df, dim, rescaleIdf); LSSimilarity lss = new LSSimilarity(lsm, size);
LSM lsm = new LSM(Ut, Sk, r, c, df, dim, rescaleIdf); LSSimilarity lss = new LSSimilarity(lsm, size);
LSM lsm = new LSM(fileUt, fileSk, fileR, fileC, fileDf, dim, true, normalized); OneExamplePerSenseSearcher oneExamplePerSenseSearcher = new OneExamplePerSenseSearcher(line.getOptionValue("index")); oneExamplePerSenseSearcher.setNotificationPoint(notificationPoint);
LSM lsm = new LSM(fileUt, fileSk, fileR, fileC, fileDf, dim, true, normalized);
dim = Integer.parseInt(line.getOptionValue("dim")); LSM lsm = new LSM(fileUt, fileSk, fileR, fileC, fileDf, dim, true, normalized); int numForms = OneExamplePerSenseExtractor.DEFAULT_NUM_FORMS; if (line.hasOption("num-forms")) {