use of edu.illinois.cs.cogcomp.depparse.io.CONLLReader in project cogcomp-nlp by CogComp.
the class MainClass method getStructuredData.
private static SLProblem getStructuredData(String filepath, LabeledChuLiuEdmondsDecoder infSolver) throws Exception {
CONLLReader depReader = new CONLLReader(new Preprocessor(), useGoldPOS, conllIndexOffset);
depReader.startReading(filepath);
SLProblem problem = new SLProblem();
DepInst instance = depReader.getNext();
while (instance != null) {
infSolver.updateInferenceSolver(instance);
Pair<IInstance, IStructure> pair = getSLPair(instance);
problem.addExample(pair.getFirst(), pair.getSecond());
instance = depReader.getNext();
}
logger.info("{} of dependency instances.", problem.size());
return problem;
}
Aggregations