edu.stanford.nlp.sequences
Class CoNLLDocumentReaderAndWriter
java.lang.Object
edu.stanford.nlp.sequences.CoNLLDocumentReaderAndWriter
- All Implemented Interfaces:
- IteratorFromReaderFactory<List<FeatureLabel>>, DocumentReaderAndWriter, Serializable
public class CoNLLDocumentReaderAndWriter
- extends Object
- implements DocumentReaderAndWriter
DocumentReader for CoNLL 03 format. In this format, there is one word
per line, with extra attributes of a word (POS tag, chunk, etc.) in other
space or tab separated columns, where leading and trailing whitespace on
the line are ignored. Sentences are supposedly
separated by a blank line (one with no non-whitespace characters), but
where blank lines occur is in practice often fairly random. In particular,
entities not infrequently span blank lines.
- Author:
- Jenny Finkel, Huy Nguyen, Christopher Manning
- See Also:
- Serialized Form
BOUNDARY
public static final String BOUNDARY
- See Also:
- Constant Field Values
OTHER
public static final String OTHER
- See Also:
- Constant Field Values
CoNLLDocumentReaderAndWriter
public CoNLLDocumentReaderAndWriter()
init
public void init(SeqClassifierFlags flags)
- Description copied from interface:
DocumentReaderAndWriter
- Will be called immediately after construction. Needed
because of reflection.
- Specified by:
init
in interface DocumentReaderAndWriter
toString
public String toString()
- Overrides:
toString
in class Object
getIterator
public Iterator<List<FeatureLabel>> getIterator(Reader r)
- Specified by:
getIterator
in interface IteratorFromReaderFactory<List<FeatureLabel>>
printAnswers
public void printAnswers(List<FeatureLabel> doc,
PrintWriter out)
- Description copied from interface:
DocumentReaderAndWriter
- This method prints the output of the classifier to a
PrintWriter
.
- Specified by:
printAnswers
in interface DocumentReaderAndWriter
- Parameters:
doc
- The document: A List of FeatureLabelout
- Where to send the answers to
main
public static void main(String[] args)
throws IOException,
ClassNotFoundException
- Count some stats on what occurs in a file.
- Throws:
IOException
ClassNotFoundException
Stanford NLP Group