edu.washington.cs.knowitall.extractor.conf
Class LabeledBinaryExtractionReader
java.lang.Object
edu.washington.cs.knowitall.extractor.conf.LabeledBinaryExtractionReader
public class LabeledBinaryExtractionReader
- extends java.lang.Object
Used for reading LabeledBinaryExtraction
objects from a plain
text source. The format of the source should be (for each extraction):
- Line 1: Source sentence tokens
- Line 2: Source POS tags
- Line 3: Source NP Chunk tags
- Line 4: Argument1 tokens
- Line 5: Argument1 range start and length
- Line 6: Relation tokens
- Line 7: Relation range start and length
- Line 8: Argument2 tokens
- Line 9: Argument 2 range start and length
- Line 10: label (either 0 or 1)
For example:
Bush was US President .
NNP VBD NNP NNP .
B-NP O B-NP I-NP O
Bush
0 1
was
1 1
US President
2 2
1
This gets loaded into a LabeledBinaryExtraction
object representing
(Bush, was, US President) with a positive label (=0).
- Author:
- afader
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LabeledBinaryExtractionReader
public LabeledBinaryExtractionReader(java.io.InputStream in)
throws java.io.IOException
- Constructs a new reader from the given input stream.
- Parameters:
in
-
- Throws:
java.io.IOException
- if unable to read the source
readExtractions
public java.lang.Iterable<LabeledBinaryExtraction> readExtractions()
throws java.io.IOException
- Returns:
- an
Iterable
object containing the labeled extractions
- Throws:
java.io.IOException