public abstract class DataReader extends Object implements edu.illinois.cs.cogcomp.lbjava.parse.Parser
Parser
code used by all applications.Modifier and Type | Field and Description |
---|---|
static String |
CANDIDATE |
protected List<Constituent> |
candidates |
protected int |
currentCandidate |
protected int |
currentTextAnnotation |
protected String |
file |
protected static org.slf4j.Logger |
logger |
static edu.illinois.cs.cogcomp.quant.driver.Preprocessor |
preprocessor |
protected ResourceManager |
rm |
protected List<TextAnnotation> |
textAnnotations |
protected String |
viewName |
Constructor and Description |
---|
DataReader(String file,
String corpusName,
String viewName) |
Modifier and Type | Method and Description |
---|---|
protected void |
addGoldBIOView(TextAnnotation ta,
List<String> labels) |
protected void |
addGoldPOSView(TextAnnotation ta,
List<String> sentencePOS) |
abstract List<Constituent> |
candidateGenerator(TextAnnotation ta) |
void |
close() |
protected String |
getCorrectPath(String file)
A workaround for the unit tests in Maven that move the relative path of the root directory in
ESRLConfigurator to the directory of each module. |
protected Constituent |
getExactMatch(View view,
Constituent c) |
protected List<Constituent> |
getFinalCandidates(View goldView,
List<Constituent> candidates) |
Object |
next()
Fetches the next available data instance for training/testing.
|
abstract List<TextAnnotation> |
readData() |
void |
reset() |
protected static org.slf4j.Logger logger
protected ResourceManager rm
public static final String CANDIDATE
protected List<TextAnnotation> textAnnotations
protected List<Constituent> candidates
protected int currentCandidate
protected int currentTextAnnotation
protected final String viewName
protected final String file
public static edu.illinois.cs.cogcomp.quant.driver.Preprocessor preprocessor
protected String getCorrectPath(String file)
ESRLConfigurator
to the directory of each module. NB: This code assumes the
default data directory to be $ROOT_DIR/data/.file
- The file/directory to be usedpublic abstract List<TextAnnotation> readData()
protected void addGoldPOSView(TextAnnotation ta, List<String> sentencePOS)
protected void addGoldBIOView(TextAnnotation ta, List<String> labels)
public abstract List<Constituent> candidateGenerator(TextAnnotation ta)
protected List<Constituent> getFinalCandidates(View goldView, List<Constituent> candidates)
protected Constituent getExactMatch(View view, Constituent c)
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.