public class SuggestionsOrdererFeatureExtractor extends Object implements SuggestionsOrderer
Modifier and Type | Field and Description |
---|---|
protected Language |
language |
protected LanguageModel |
languageModel |
protected double |
mistakeProb |
protected String |
score |
protected int |
topN |
Constructor and Description |
---|
SuggestionsOrdererFeatureExtractor(Language lang,
LanguageModel languageModel) |
Modifier and Type | Method and Description |
---|---|
org.apache.commons.lang3.tuple.Pair<List<SuggestedReplacement>,SortedMap<String,Float>> |
computeFeatures(List<String> suggestions,
String word,
AnalyzedSentence sentence,
int startPos)
compute features for training or prediction of a ranking model for suggestions
|
protected void |
initParameters() |
boolean |
isMlAvailable() |
List<SuggestedReplacement> |
orderSuggestions(List<String> suggestions,
String word,
AnalyzedSentence sentence,
int startPos) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
orderSuggestionsUsingModel
protected final Language language
protected final LanguageModel languageModel
protected int topN
protected String score
protected double mistakeProb
public SuggestionsOrdererFeatureExtractor(Language lang, LanguageModel languageModel)
protected void initParameters()
public boolean isMlAvailable()
isMlAvailable
in interface SuggestionsOrderer
public List<SuggestedReplacement> orderSuggestions(List<String> suggestions, String word, AnalyzedSentence sentence, int startPos)
orderSuggestions
in interface SuggestionsOrderer
public org.apache.commons.lang3.tuple.Pair<List<SuggestedReplacement>,SortedMap<String,Float>> computeFeatures(List<String> suggestions, String word, AnalyzedSentence sentence, int startPos)
suggestions
- word
- sentence
- startPos
-