Package opennlp.tools.namefind
Klasse NameFinderME
java.lang.Object
opennlp.tools.namefind.NameFinderME
- Alle implementierten Schnittstellen:
- TokenNameFinder
A maximum-entropy-based 
name finder implementation.- 
FeldübersichtFelder
- 
KonstruktorübersichtKonstruktorenKonstruktorBeschreibungNameFinderME(TokenNameFinderModel model) Initializes aNameFinderMEwith aTokenNameFinderModel.
- 
MethodenübersichtModifizierer und TypMethodeBeschreibungvoidForgets all adaptive data which was collected during previous calls to one of the find methods.static Span[]dropOverlappingSpans(Span[] spans) Removesspanswith are intersecting or crossing in any way.Span[]Generates name tags for the given sequence, typically a sentence, returningtoken spansfor any identified names.Span[]Generates name tags for the given sequence, typically a sentence, returningtoken spansfor any identified names.double[]probs()Retrieves the probabilities of the last decoded sequence.voidprobs(double[] probs) Populates the specified array with the probabilities of the last decoded sequence.double[]Retrieves an array of probabilities for each of the specified spans which is the arithmetic mean of the probabilities for each of the outcomes which make up the span.static TokenNameFinderModeltrain(String languageCode, String type, ObjectStream<NameSample> samples, TrainingParameters params, TokenNameFinderFactory factory) Starts a training of aTokenNameFinderModelwith the given parameters.
- 
Felddetails- 
DEFAULT_BEAM_SIZEpublic static final int DEFAULT_BEAM_SIZE- Siehe auch:
 
- 
START- Siehe auch:
 
- 
CONTINUE- Siehe auch:
 
- 
OTHER- Siehe auch:
 
 
- 
- 
Konstruktordetails- 
NameFinderMEInitializes aNameFinderMEwith aTokenNameFinderModel.- Parameter:
- model- The- TokenNameFinderModelto initialize with.
 
 
- 
- 
Methodendetails- 
findBeschreibung aus Schnittstelle kopiert:TokenNameFinderGenerates name tags for the given sequence, typically a sentence, returningtoken spansfor any identified names.- Angegeben von:
- findin Schnittstelle- TokenNameFinder
- Parameter:
- tokens- An array of the tokens or words of the sequence, typically a sentence.
- Gibt zurück:
- An array of spansfor each of the names identified.
 
- 
findGenerates name tags for the given sequence, typically a sentence, returningtoken spansfor any identified names.- Parameter:
- tokens- An array of the tokens or words of a sequence, typically a sentence.
- additionalContext- Features which are based on context outside of the sentence but which should also be used.
- Gibt zurück:
- An array of token spansfor each of the names identified.
 
- 
clearAdaptiveDatapublic void clearAdaptiveData()Beschreibung aus Schnittstelle kopiert:TokenNameFinderForgets all adaptive data which was collected during previous calls to one of the find methods.Note: This method should typically be called at the end of the processing of a document. - Angegeben von:
- clearAdaptiveDatain Schnittstelle- TokenNameFinder
 
- 
probspublic void probs(double[] probs) Populates the specified array with the probabilities of the last decoded sequence. The sequence was determined based on the previous call tofind(String[]). The specified array should be at least as large as the number of tokens in the previous call tofind(String[]).- Parameter:
- probs- An array with the probabilities of the last decoded sequence.
 
- 
probspublic double[] probs()Retrieves the probabilities of the last decoded sequence. The sequence was determined based on the previous call tofind(String[]).- Gibt zurück:
- An array with the same number of probabilities as tokens were sent
         to find(String[])when it was last called.
 
- 
probsRetrieves an array of probabilities for each of the specified spans which is the arithmetic mean of the probabilities for each of the outcomes which make up the span.- Parameter:
- spans- The- spansof the names for which probabilities are requested.
- Gibt zurück:
- An array of probabilities for each of the specified spans.
 
- 
trainpublic static TokenNameFinderModel train(String languageCode, String type, ObjectStream<NameSample> samples, TrainingParameters params, TokenNameFinderFactory factory) throws IOException Starts a training of aTokenNameFinderModelwith the given parameters.- Parameter:
- languageCode- The ISO conform language code.
- type- The type to use.
- samples- The- ObjectStreamof- NameSampleused as input for training.
- params- The- TrainingParametersfor the context of the training.
- factory- The- TokenNameFinderFactoryfor creating related objects defined via- params.
- Gibt zurück:
- A valid, trained TokenNameFinderModelinstance.
- Löst aus:
- IOException- Thrown if IO errors occurred during training.
 
- 
dropOverlappingSpansRemovesspanswith are intersecting or crossing in any way.The following rules are used to remove the spans: 
 Identical spans: The first span in the array after sorting it remains.
 Intersecting spans: The first span after sorting remains.
 Contained spans: All spans which are contained by another are removed.
 
-