|
||||||||||
| 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.InputHandlerDirectory
public class InputHandlerDirectory
an InputHandler used when the input is in several files within a single directory. A single InputComponentIO is used for each
file. A map associates each file name with its InputComponentIO. For training, hidden sequences are stored in a separate file in the directory whose name is set with the hiddenSequenceFile property.
For this InputHandler, the location passed is the path to the directory containing the input data.
| Constructor Summary | |
|---|---|
InputHandlerDirectory()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getHiddenSequenceFile()
gets the name of the hidden sequence file. |
TrainingSequenceIO |
getHiddenStateReader()
gets the reader used to read in results for training data. |
java.util.Map<java.lang.String,InputComponentIO> |
getInputReaders()
gets the readers used to read in input sequences. |
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 |
setHiddenSequenceFile(java.lang.String hiddenSequenceFile)
sets the name of the hidden sequence file. |
void |
setHiddenStateReader(TrainingSequenceIO hiddenStateReader)
sets the reader used to get hidden sequences. |
void |
setInputReaders(java.util.Map<java.lang.String,InputComponentIO> inputReader)
sets the readers used to read in input sequences. |
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 InputHandlerDirectory()
| 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 java.util.Map<java.lang.String,InputComponentIO> getInputReaders()
read methods are called.
public void setInputReaders(java.util.Map<java.lang.String,InputComponentIO> inputReader)
read methods are called.
the value is a map that associates filenames within the directory to input components.
inputReader - the reader used to read in input sequences.public java.lang.String getHiddenSequenceFile()
public void setHiddenSequenceFile(java.lang.String hiddenSequenceFile)
hiddenSequenceFile - the name of the hidden sequence file within the input directory.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||