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 Constituent
s 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
AnnotatorException
public 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.Parser
Constituent
(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.Parser
public void close()
close
in interface edu.illinois.cs.cogcomp.lbjava.parse.Parser
Copyright © 2017. All rights reserved.