public abstract class DataReader extends Object implements edu.illinois.cs.cogcomp.lbjava.parse.Parser
Parser code.
It also provides a simple caching mechanism based on TextAnnotationMapDBHandler.
The main assumption is that an LBJava-based classifier is going to be using a collection
of Constituents as the set of training/testing examples.
Subclasses need to implement specific methods for candidate generation and input format reading.| Modifier and Type | Field and Description |
|---|---|
static String |
CANDIDATE |
protected String |
corpusName |
protected IResetableIterator<TextAnnotation> |
dataset |
protected String |
file |
protected static org.slf4j.Logger |
logger |
protected String |
viewName |
| Constructor and Description |
|---|
DataReader(String file,
String corpusName,
String viewName) |
| Modifier and Type | Method and Description |
|---|---|
abstract List<Constituent> |
candidateGenerator(TextAnnotation ta) |
void |
close() |
protected List<Constituent> |
getFinalCandidates(View goldView,
List<Constituent> candidates) |
Object |
next()
Fetches the next available data instance for training/testing.
|
abstract void |
preprocess(TextAnnotation ta) |
abstract List<TextAnnotation> |
readData() |
void |
reset() |
protected static org.slf4j.Logger logger
public static final String CANDIDATE
protected IResetableIterator<TextAnnotation> dataset
protected String viewName
protected String corpusName
protected final String file
public abstract void preprocess(TextAnnotation ta) throws AnnotatorException
AnnotatorExceptionpublic abstract List<TextAnnotation> readData()
public abstract List<Constituent> candidateGenerator(TextAnnotation ta)
protected List<Constituent> getFinalCandidates(View goldView, List<Constituent> candidates)
public Object next()
TextAnnotation object before accessing its members.next in interface edu.illinois.cs.cogcomp.lbjava.parse.ParserConstituent (which might be a part of a Relation, depending on the
type of View )public void reset()
reset in interface edu.illinois.cs.cogcomp.lbjava.parse.Parserpublic void close()
close in interface edu.illinois.cs.cogcomp.lbjava.parse.ParserCopyright © 2017. All rights reserved.