Class XGBoostSuggestionsOrderer
java.lang.Object
org.languagetool.rules.spelling.suggestions.SuggestionsOrdererFeatureExtractor
org.languagetool.rules.spelling.suggestions.XGBoostSuggestionsOrderer
- All Implemented Interfaces:
SuggestionsOrderer,SuggestionsRanker
public class XGBoostSuggestionsOrderer
extends SuggestionsOrdererFeatureExtractor
implements SuggestionsRanker
-
Field Summary
Fields inherited from class org.languagetool.rules.spelling.suggestions.SuggestionsOrdererFeatureExtractor
language, languageModel, mistakeProb, score, topN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanorderSuggestions(List<String> suggestions, String word, AnalyzedSentence sentence, int startPos) static voidsetAutoCorrectThresholdForLanguage(Language lang, float value) For testing purposes onlybooleanshouldAutoCorrect(List<SuggestedReplacement> rankedSuggestions) Model output should have been calibrated using a precision-recall curve evaluation, so that a threshold for confidence values with sufficiently high precision for auto correction is knownMethods inherited from class org.languagetool.rules.spelling.suggestions.SuggestionsOrdererFeatureExtractor
computeFeaturesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.languagetool.rules.spelling.suggestions.SuggestionsOrderer
orderSuggestionsUsingModel
-
Constructor Details
-
XGBoostSuggestionsOrderer
-
-
Method Details
-
setAutoCorrectThresholdForLanguage
For testing purposes only -
initParameters
protected void initParameters()- Overrides:
initParametersin classSuggestionsOrdererFeatureExtractor
-
isMlAvailable
public boolean isMlAvailable()- Specified by:
isMlAvailablein interfaceSuggestionsOrderer- Overrides:
isMlAvailablein classSuggestionsOrdererFeatureExtractor
-
orderSuggestions
public List<SuggestedReplacement> orderSuggestions(List<String> suggestions, String word, AnalyzedSentence sentence, int startPos) - Specified by:
orderSuggestionsin interfaceSuggestionsOrderer- Overrides:
orderSuggestionsin classSuggestionsOrdererFeatureExtractor
-
shouldAutoCorrect
Description copied from interface:SuggestionsRankerModel output should have been calibrated using a precision-recall curve evaluation, so that a threshold for confidence values with sufficiently high precision for auto correction is known- Specified by:
shouldAutoCorrectin interfaceSuggestionsRanker- Parameters:
rankedSuggestions- suggestions returned by orderSuggestions- Returns:
- if confidence is high enough for auto correction
-