|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopennlp.tools.namefind.NameFinderME
public class NameFinderME
Class for creating a maximum-entropy-based name finder.
| Field Summary | |
|---|---|
protected NameContextGenerator |
contextGenerator
|
static java.lang.String |
CONTINUE
|
protected opennlp.maxent.MaxentModel |
model
|
static java.lang.String |
OTHER
|
static java.lang.String |
START
|
| Constructor Summary | |
|---|---|
NameFinderME(opennlp.maxent.MaxentModel mod)
Creates a new name finder with the specified model. |
|
NameFinderME(opennlp.maxent.MaxentModel mod,
NameContextGenerator cg)
Creates a new name finder with the specified model and context generator. |
|
NameFinderME(opennlp.maxent.MaxentModel mod,
NameContextGenerator cg,
int beamSize)
Creates a new name finder with the specified model and context generator. |
|
| Method Summary | |
|---|---|
void |
clearAdaptiveData()
Forgets all adaptive data which was collected during previous calls to one of the find methods. |
Span[] |
find(java.lang.String[] tokens)
Generates name tags for the given sequence, typically a sentence, returning token spans for any identified names. |
Span[] |
find(java.lang.String[] tokens,
java.lang.String[][] additionalContext)
Generates name tags for the given sequence, typically a sentence, returning token spans for any identified names. |
static void |
main(java.lang.String[] args)
Trains a new named entity model on the specified training file using the specified encoding to read it in. |
double[] |
probs()
Returns an array with the probabilities of the last decoded sequence. |
void |
probs(double[] probs)
Populates the specified array with the probabilities of the last decoded sequence. |
double[] |
probs(Span[] spans)
Returns an array of probabilities for each of the specified spans which is the product the probabilities for each of the outcomes which make up the span. |
static opennlp.maxent.GISModel |
train(opennlp.maxent.EventStream es,
int iterations,
int cut)
|
static void |
usage()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String START
public static final java.lang.String CONTINUE
public static final java.lang.String OTHER
protected opennlp.maxent.MaxentModel model
protected NameContextGenerator contextGenerator
| Constructor Detail |
|---|
public NameFinderME(opennlp.maxent.MaxentModel mod)
mod - The model to be used to find names.
public NameFinderME(opennlp.maxent.MaxentModel mod,
NameContextGenerator cg)
mod - The model to be used to find names.cg - The context generator to be used with this name finder.
public NameFinderME(opennlp.maxent.MaxentModel mod,
NameContextGenerator cg,
int beamSize)
mod - The model to be used to find names.cg - The context generator to be used with this name finder.beamSize - The size of the beam to be used in decoding this model.| Method Detail |
|---|
public Span[] find(java.lang.String[] tokens)
TokenNameFinder
find in interface TokenNameFindertokens - an array of the tokens or words of the sequence, typically a sentence.
public Span[] find(java.lang.String[] tokens,
java.lang.String[][] additionalContext)
tokens - an array of the tokens or words of the sequence, typically a sentence.additionalContext - features which are based on context outside of the sentence but which should also be used.
public void clearAdaptiveData()
public void probs(double[] probs)
chunk. The specified array should be at least as large as
the number of tokens in the previous call to chunk.
probs - An array used to hold the probabilities of the last decoded
sequence.public double[] probs()
chunk.
chunk
when it was last called.public double[] probs(Span[] spans)
spans - The spans of the names for which probabilities are desired.
public static opennlp.maxent.GISModel train(opennlp.maxent.EventStream es,
int iterations,
int cut)
throws java.io.IOException
java.io.IOExceptionpublic static void usage()
public static void main(java.lang.String[] args)
throws java.io.IOException
args - [-encoding encoding] training_file model_file
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||