|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcalhoun.analysis.crf.io.InputHandlerBase
calhoun.analysis.crf.io.InputHandlerFile
public class InputHandlerFile
an InputHandler used when all of the input is in a single file. A single InputComponentIO is used to read the
file. For training, hidden sequences are stored in a separate file whose name is related to the input file name using a
FilenameMapper. The same filename mapping is used to determine the training set file name when writing out data
as when reading it in. The training file is read using a TrainingSequenceIO.
For this InputHandler, the location passed is the path to the file containing the input data.
| Constructor Summary | |
|---|---|
InputHandlerFile()
|
|
| Method Summary | |
|---|---|
TrainingSequenceIO |
getHiddenStateReader()
gets the reader used to read in results for training data. |
InputComponentIO |
getInputReader()
gets the reader used to read in input sequences. |
FilenameMapper |
getMapper()
the mapper used to generate the name of the hidden sequence file from the input sequence file. |
java.util.Iterator<? extends InputSequence<?>> |
readInputData(java.lang.String location)
returns the input data read from the specified location. |
java.util.List<? extends TrainingSequence<?>> |
readTrainingData(java.lang.String location)
|
java.util.List<? extends TrainingSequence<?>> |
readTrainingData(java.lang.String location,
boolean predict)
returns the training data read from the specified location. |
void |
setHiddenStateReader(TrainingSequenceIO hiddenStateReader)
sets the reader used to get hidden sequences. |
void |
setInputReader(InputComponentIO inputReader)
gets the reader used to read in input sequences. |
void |
setMapper(FilenameMapper mapper)
the mapper used to generate the name of the hidden sequence file from the input sequence file. |
void |
writeInputData(java.lang.String location,
java.util.Iterator<? extends InputSequence<?>> data)
writes input data to the specified location. |
void |
writeTrainingData(java.lang.String location,
java.util.List<? extends TrainingSequence<?>> data)
writes training data to the specified location. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InputHandlerFile()
| Method Detail |
|---|
public java.util.Iterator<? extends InputSequence<?>> readInputData(java.lang.String location)
throws java.io.IOException
InputHandlerIterator
because the inference algorithms can predict on the sequences one at a time. The interpretation of
the location string is dependent on the particular InputHandler implementation used.
location - string location of the data. Meaning is implementation dependent.
java.io.IOException - if there is a problem reading the data
public java.util.List<? extends TrainingSequence<?>> readTrainingData(java.lang.String location)
throws java.io.IOException
java.io.IOException
public java.util.List<? extends TrainingSequence<?>> readTrainingData(java.lang.String location,
boolean predict)
throws java.io.IOException
InputHandlerIterator so algorithms are not forced to hold
all of the training data at once (although most will). The interpretation of
the location string is dependent on the particular InputHandler implementation used.
location - string location of the data. Meaning is implementation dependent.
java.io.IOException - if there is a problem reading the data
public void writeInputData(java.lang.String location,
java.util.Iterator<? extends InputSequence<?>> data)
throws java.io.IOException
InputHandlerInputHandler implementation used.
location - string location of the data. Meaning is implementation dependent.data - an iterator over input sequences
java.io.IOException - if there is a problem reading the data
public void writeTrainingData(java.lang.String location,
java.util.List<? extends TrainingSequence<?>> data)
throws java.io.IOException
InputHandlerInputHandler implementation used.
location - string location of the data. Meaning is implementation dependent.data - a list of training sequences to write out.
java.io.IOException - if there is a problem reading the datapublic TrainingSequenceIO getHiddenStateReader()
TrainingSequenceIO used to read in the hidden sequences for trainingpublic void setHiddenStateReader(TrainingSequenceIO hiddenStateReader)
hiddenStateReader - the reader that will be used to access hidden statespublic InputComponentIO getInputReader()
read methods are called.
public void setInputReader(InputComponentIO inputReader)
read methods are called.
inputReader - the reader used to read in input sequences.public FilenameMapper getMapper()
public void setMapper(FilenameMapper mapper)
mapper - the mapper used to generate the hidden sequence file name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||