@Override public void reset() { currentCandidate = 0; candidates = new ArrayList<>(); currentTextAnnotation = 0; dataset.reset(); }
/** * 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++); }
@Override public void reset() { currentCandidate = 0; candidates = new ArrayList<>(); currentTextAnnotation = 0; dataset.reset(); }
@Override public void reset() { currentCandidate = 0; candidates = new ArrayList<>(); currentTextAnnotation = 0; dataset.reset(); }