public class SequenceLabelerEventStream extends opennlp.tools.util.AbstractEventStream<SequenceLabelSample>
| Constructor and Description |
|---|
SequenceLabelerEventStream(opennlp.tools.util.ObjectStream<SequenceLabelSample> dataStream) |
SequenceLabelerEventStream(opennlp.tools.util.ObjectStream<SequenceLabelSample> dataStream,
String type,
SequenceLabelerContextGenerator contextGenerator,
SequenceLabelerCodec codec)
Creates a new name finder event stream using the specified data stream and context generator.
|
| Modifier and Type | Method and Description |
|---|---|
static String[][] |
additionalContext(String[] tokens,
Map<String,String> prevMap)
Generated previous decision features for each token based on contents of the specified map.
|
protected Iterator<opennlp.tools.ml.model.Event> |
createEvents(SequenceLabelSample sample) |
static List<opennlp.tools.ml.model.Event> |
generateEvents(String[] sentence,
String[] outcomes,
SequenceLabelerContextGenerator cg) |
static String[] |
generateOutcomes(Span[] names,
String type,
int length)
Deprecated.
use the BioCodec implementation of the SequenceValidator instead!
|
public SequenceLabelerEventStream(opennlp.tools.util.ObjectStream<SequenceLabelSample> dataStream, String type, SequenceLabelerContextGenerator contextGenerator, SequenceLabelerCodec codec)
dataStream - The data stream of events.type - null or overrides the type parameter in the provided samplescontextGenerator - The context generator used to generate features for the event stream.codec - the encodingpublic SequenceLabelerEventStream(opennlp.tools.util.ObjectStream<SequenceLabelSample> dataStream)
@Deprecated public static String[] generateOutcomes(Span[] names, String type, int length)
names - Token spans for each of the names.type - null or overrides the type parameter in the provided sampleslength - The length of the sentence.public static List<opennlp.tools.ml.model.Event> generateEvents(String[] sentence, String[] outcomes, SequenceLabelerContextGenerator cg)
protected Iterator<opennlp.tools.ml.model.Event> createEvents(SequenceLabelSample sample)
createEvents in class opennlp.tools.util.AbstractEventStream<SequenceLabelSample>public static String[][] additionalContext(String[] tokens, Map<String,String> prevMap)
tokens - The token for which the context is generated.prevMap - A mapping of tokens to their previous decisions.Copyright © 2016 IXA pipes. All rights reserved.