|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopennlp.model.AbstractEventStream
opennlp.tools.util.AbstractEventStream<NameSample>
opennlp.tools.namefind.NameFinderEventStream
public class NameFinderEventStream
Class for creating an event stream out of data files for training an name finder.
Constructor Summary | |
---|---|
NameFinderEventStream(ObjectStream<NameSample> dataStream)
|
|
NameFinderEventStream(ObjectStream<NameSample> dataStream,
String type,
NameContextGenerator contextGenerator)
Creates a new name finder event stream using the specified data stream and context generator. |
Method Summary | |
---|---|
static String[][] |
additionalContext(String[] tokens,
Map<String,String> prevMap)
Generated previous decision features for each token based on contents of the specified map. |
static List<opennlp.model.Event> |
generateEvents(String[] sentence,
String[] outcomes,
NameContextGenerator cg)
|
static String[] |
generateOutcomes(Span[] names,
String type,
int length)
Generates the name tag outcomes (start, continue, other) for each token in a sentence with the specified length using the specified name spans. |
static void |
main(String[] args)
Deprecated. |
Methods inherited from class opennlp.tools.util.AbstractEventStream |
---|
hasNext, next |
Methods inherited from class opennlp.model.AbstractEventStream |
---|
remove |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NameFinderEventStream(ObjectStream<NameSample> dataStream, String type, NameContextGenerator contextGenerator)
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.public NameFinderEventStream(ObjectStream<NameSample> dataStream)
Method Detail |
---|
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.model.Event> generateEvents(String[] sentence, String[] outcomes, NameContextGenerator cg)
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.
@Deprecated public static final void main(String[] args) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |