Package cc.mallet.pipe.iterator
Class SegmentIterator
- java.lang.Object
-
- cc.mallet.pipe.iterator.SegmentIterator
-
-
Constructor Summary
Constructors Constructor Description SegmentIterator(Transducer model, InstanceList ilist, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
NOTE!: Assumes thatsegmentStartTags[i]
corresponds tosegmentContinueTags[i]
.SegmentIterator(Transducer model, Instance instance, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
SegmentIterator(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] inTags, java.util.ArrayList predictions)
Useful when noTransduce
is specified.SegmentIterator(Instance instance, java.lang.Object[] startTags, java.lang.Object[] inTags, Sequence prediction)
Iterate over segments in one instance.SegmentIterator(Sequence input, Sequence predicted, Sequence truth, java.lang.Object[] startTags, java.lang.Object[] inTags)
Iterate over segments in one labeled sequence
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Instance
next()
Segment
nextSegment()
void
remove()
java.util.ArrayList
toArrayList()
-
-
-
Constructor Detail
-
SegmentIterator
public SegmentIterator(Transducer model, InstanceList ilist, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
NOTE!: Assumes thatsegmentStartTags[i]
corresponds tosegmentContinueTags[i]
.- Parameters:
model
- model to segment input sequencesilist
- list of instances to be segmentedsegmentStartTags
- array of tags indicating the start of a segmentsegmentContinueTags
- array of tags indicating the continuation of a segment
-
SegmentIterator
public SegmentIterator(Transducer model, Instance instance, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
-
SegmentIterator
public SegmentIterator(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] inTags, java.util.ArrayList predictions)
Useful when noTransduce
is specified. A list of sequences specifies the output.- Parameters:
ilist
- InstanceList containing sequence.segmentStartTags
- array of tags indicating the start of a segmentsegmentContinueTags
- array of tags indicating the continuation of a segmentpredictions
- list ofSequence
s that are the predicted output of someTransducer
-
SegmentIterator
public SegmentIterator(Instance instance, java.lang.Object[] startTags, java.lang.Object[] inTags, Sequence prediction)
Iterate over segments in one instance.- Parameters:
ilist
- InstanceList containing sequence.segmentStartTags
- array of tags indicating the start of a segmentsegmentContinueTags
- array of tags indicating the continuation of a segmentpredictions
- list ofSequence
s that are the predicted output of someTransducer
-
-