/** * Fetches the next available data instance for training/testing. Also, pre-processes each new * {@link TextAnnotation} object before accessing its members. * * @return A {@link Constituent} (which might be a part of a {@link Relation}, depending on the * type of {@link View} ) */ @Override public Object next() { if (candidates.isEmpty() || candidates.size() == currentCandidate) { currentTextAnnotation++; if (!dataset.hasNext()) return null; TextAnnotation ta = dataset.next(); if (!ta.hasView(viewName)) return next(); candidates = candidateGenerator(ta); if (candidates.isEmpty()) return next(); currentCandidate = 0; if (currentTextAnnotation % 1000 == 0) logger.info("Read {} TextAnnotations", currentTextAnnotation); } return candidates.get(currentCandidate++); }
/** * Fetches the next available data instance for training/testing. Also, pre-processes each new * {@link TextAnnotation} object before accessing its members. * * @return A {@link Constituent} (which might be a part of a {@link Relation}, * depending on the type of {@link View} ) */ @Override public Object next() { if (candidates.isEmpty() || candidates.size() == currentCandidate) { currentTextAnnotation++; if (!dataset.hasNext()) return null; TextAnnotation ta = dataset.next(); if (!ta.hasView(viewName)) return next(); candidates = candidateGenerator(ta); if (candidates.isEmpty()) return next(); currentCandidate = 0; if (currentTextAnnotation % 1000 == 0) logger.info("Read {} TextAnnotations", currentTextAnnotation); } return candidates.get(currentCandidate++); }
/** * Fetches the next available data instance for training/testing. Also, pre-processes each new * {@link TextAnnotation} object before accessing its members. * * @return A {@link Constituent} (which might be a part of a {@link Relation}, depending on the * type of {@link View} ) */ @Override public Object next() { if (candidates.isEmpty() || candidates.size() == currentCandidate) { currentTextAnnotation++; if (!dataset.hasNext()) return null; TextAnnotation ta = dataset.next(); if (!ta.hasView(viewName)) return next(); candidates = candidateGenerator(ta); if (candidates.isEmpty()) return next(); currentCandidate = 0; if (currentTextAnnotation % 1000 == 0) logger.info("Read {} TextAnnotations", currentTextAnnotation); } return candidates.get(currentCandidate++); }
while (dataset.hasNext()) { TextAnnotation ta = dataset.next(); Set<String> views = new HashSet<>(ta.getAvailableViews());
while (dataset.hasNext()) { TextAnnotation ta = dataset.next(); Set<String> views = new HashSet<>(ta.getAvailableViews());
while (dataset.hasNext()) { TextAnnotation ta = dataset.next(); Set<String> views = new HashSet<>(ta.getAvailableViews());
while (dataset.hasNext()) { TextAnnotation ta = dataset.next(); if (!ta.hasView(SenseManager.getGoldViewName()))
while (dataset.hasNext()) { TextAnnotation ta = dataset.next(); if (!ta.hasView(SenseManager.getGoldViewName()))
PredicateArgumentEvaluator evaluator = new PredicateArgumentEvaluator(); while (dataset.hasNext()) { TextAnnotation ta = dataset.next();