public void readPhrases(String filename, int phraseColIndex, int tagColIndex) throws IOException { if (phraseColIndex < 0) { throw new IllegalArgumentException("Invalid phraseColIndex " + phraseColIndex); } Timing timer = new Timing(); timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line; while ((line = br.readLine()) != null) { String[] columns = tabPattern.split(line); String phrase = columns[phraseColIndex]; String tag = (tagColIndex >= 0)? columns[tagColIndex]: null; addPhrase(phrase, tag); } br.close(); timer.done(); }
private static MaxentTagger loadModel(String loc, boolean verbose) { Timing timer = null; if (verbose) { timer = new Timing(); timer.doing("Loading POS Model [" + loc + ']'); } MaxentTagger tagger = new MaxentTagger(loc); if (verbose) { timer.done(); } return tagger; }
public void readPhrases(String filename, boolean checkTag, Pattern delimiterPattern) throws IOException { Timing timer = new Timing(); timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line; while ((line = br.readLine()) != null) { if (checkTag) { String[] columns = delimiterPattern.split(line, 2); if (columns.length == 1) { addPhrase(columns[0]); } else { addPhrase(columns[0], columns[1]); } } else { addPhrase(line); } } br.close(); timer.done(); }
public void readPhrasesWithTagScores(String filename, Pattern fieldDelimiterPattern, Pattern countDelimiterPattern) throws IOException timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line;
scoreTiming.doing("Scoring trees"); int treeNum = 0; MulticoreWrapper<Tree, Pair<DeepTree, DeepTree>> wrapper = new MulticoreWrapper<>(op.trainOptions.trainingThreads, new ScoringProcessor());
public void executeOneTrainingBatch(List<Tree> trainingBatch, IdentityHashMap<Tree, byte[]> compressedParses, double[] sumGradSquare) { Timing convertTiming = new Timing(); convertTiming.doing("Converting trees"); IdentityHashMap<Tree, List<Tree>> topParses = CacheParseHypotheses.convertToTrees(trainingBatch, compressedParses, op.trainOptions.trainingThreads); convertTiming.done();
public void readPhrases(String filename, int phraseColIndex, int tagColIndex) throws IOException { if (phraseColIndex < 0) { throw new IllegalArgumentException("Invalid phraseColIndex " + phraseColIndex); } Timing timer = new Timing(); timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line; while ((line = br.readLine()) != null) { String[] columns = tabPattern.split(line); String phrase = columns[phraseColIndex]; String tag = (tagColIndex >= 0)? columns[tagColIndex]: null; addPhrase(phrase, tag); } br.close(); timer.done(); }
public void readPhrases(String filename, int phraseColIndex, int tagColIndex) throws IOException { if (phraseColIndex < 0) { throw new IllegalArgumentException("Invalid phraseColIndex " + phraseColIndex); } Timing timer = new Timing(); timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line; while ((line = br.readLine()) != null) { String[] columns = tabPattern.split(line); String phrase = columns[phraseColIndex]; String tag = (tagColIndex >= 0)? columns[tagColIndex]: null; addPhrase(phrase, tag); } br.close(); timer.done(); }
public void readPhrases(String filename, int phraseColIndex, int tagColIndex) throws IOException { if (phraseColIndex < 0) { throw new IllegalArgumentException("Invalid phraseColIndex " + phraseColIndex); } Timing timer = new Timing(); timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line; while ((line = br.readLine()) != null) { String[] columns = tabPattern.split(line); String phrase = columns[phraseColIndex]; String tag = (tagColIndex >= 0)? columns[tagColIndex]: null; addPhrase(phrase, tag); } br.close(); timer.done(); }
private static MaxentTagger loadModel(String loc, boolean verbose) { Timing timer = null; if (verbose) { timer = new Timing(); timer.doing("Loading POS Model [" + loc + ']'); } MaxentTagger tagger; try { tagger = new MaxentTagger(loc); } catch (IOException e) { RuntimeException runtimeException = new RuntimeException(e); throw runtimeException; } catch (ClassNotFoundException e) { RuntimeException runtimeException = new RuntimeException(e); throw runtimeException; } if (verbose) { timer.done(); } return tagger; }
private static MaxentTagger loadModel(String loc, boolean verbose) { Timing timer = null; if (verbose) { timer = new Timing(); timer.doing("Loading POS Model [" + loc + ']'); } MaxentTagger tagger = new MaxentTagger(loc); if (verbose) { timer.done(); } return tagger; }
private static MaxentTagger loadModel(String loc, boolean verbose) { Timing timer = null; if (verbose) { timer = new Timing(); timer.doing("Loading POS Model [" + loc + ']'); } MaxentTagger tagger = new MaxentTagger(loc); if (verbose) { timer.done(); } return tagger; }
public void readPhrases(String filename, boolean checkTag, Pattern delimiterPattern) throws IOException { Timing timer = new Timing(); timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line; while ((line = br.readLine()) != null) { if (checkTag) { String[] columns = delimiterPattern.split(line, 2); if (columns.length == 1) { addPhrase(columns[0]); } else { addPhrase(columns[0], columns[1]); } } else { addPhrase(line); } } br.close(); timer.done(); }
public void readPhrases(String filename, boolean checkTag, Pattern delimiterPattern) throws IOException { Timing timer = new Timing(); timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line; while ((line = br.readLine()) != null) { if (checkTag) { String[] columns = delimiterPattern.split(line, 2); if (columns.length == 1) { addPhrase(columns[0]); } else { addPhrase(columns[0], columns[1]); } } else { addPhrase(line); } } br.close(); timer.done(); }
public void readPhrasesWithTagScores(String filename, Pattern fieldDelimiterPattern, Pattern countDelimiterPattern) throws IOException timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line;
public void readPhrases(String filename, boolean checkTag, Pattern delimiterPattern) throws IOException { Timing timer = new Timing(); timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line; while ((line = br.readLine()) != null) { if (checkTag) { String[] columns = delimiterPattern.split(line, 2); if (columns.length == 1) { addPhrase(columns[0]); } else { addPhrase(columns[0], columns[1]); } } else { addPhrase(line); } } br.close(); timer.done(); }
public void readPhrasesWithTagScores(String filename, Pattern fieldDelimiterPattern, Pattern countDelimiterPattern) throws IOException timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line;
public void readPhrasesWithTagScores(String filename, Pattern fieldDelimiterPattern, Pattern countDelimiterPattern) throws IOException timer.doing("Reading phrases: " + filename); BufferedReader br = IOUtils.getBufferedFileReader(filename); String line;
public void executeOneTrainingBatch(List<Tree> trainingBatch, IdentityHashMap<Tree, byte[]> compressedParses, double[] sumGradSquare) { Timing convertTiming = new Timing(); convertTiming.doing("Converting trees"); IdentityHashMap<Tree, List<Tree>> topParses = CacheParseHypotheses.convertToTrees(trainingBatch, compressedParses, op.trainOptions.trainingThreads); convertTiming.done();
public void executeOneTrainingBatch(List<Tree> trainingBatch, IdentityHashMap<Tree, byte[]> compressedParses, double[] sumGradSquare) { Timing convertTiming = new Timing(); convertTiming.doing("Converting trees"); IdentityHashMap<Tree, List<Tree>> topParses = CacheParseHypotheses.convertToTrees(trainingBatch, compressedParses, op.trainOptions.trainingThreads); convertTiming.done();