Make StupidBackoff the default smoothing model for phrase suggester

Closes #2780
This commit is contained in:
Simon Willnauer 2013-03-14 23:03:15 +01:00
parent 91c51ef05c
commit 5f20d81199
2 changed files with 5 additions and 6 deletions

View File

@ -124,7 +124,7 @@ public final class PhraseSuggestParser implements SuggestContextParser {
} }
if (suggestion.model() == null) { if (suggestion.model() == null) {
suggestion.setModel(LaplaceScorer.FACTORY); suggestion.setModel(StupidBackoffScorer.FACTORY);
} }
if (!gramSizeSet || suggestion.generators().isEmpty()) { if (!gramSizeSet || suggestion.generators().isEmpty()) {

View File

@ -133,8 +133,8 @@ public final class PhraseSuggestionBuilder extends SuggestionBuilder<PhraseSugge
} }
/** /**
* Sets an explict smoothing model used for this suggester. The default is * Sets an explicit smoothing model used for this suggester. The default is
* {@link #LAPLACE}. * {@link PhraseSuggester#StupidBackoff}.
*/ */
public PhraseSuggestionBuilder smoothingModel(SmoothingModel model) { public PhraseSuggestionBuilder smoothingModel(SmoothingModel model) {
this.model = model; this.model = model;
@ -192,7 +192,7 @@ public final class PhraseSuggestionBuilder extends SuggestionBuilder<PhraseSugge
/** /**
* A "stupid-backoff" smoothing model simialr to <a * A "stupid-backoff" smoothing model simialr to <a
* href="http://en.wikipedia.org/wiki/Katz's_back-off_model"> Katz's * href="http://en.wikipedia.org/wiki/Katz's_back-off_model"> Katz's
* Backoff</a>. * Backoff</a>. This model is used as the default if no model is configured.
* <p> * <p>
* See <a * See <a
* href="http://en.wikipedia.org/wiki/N-gram#Smoothing_techniques">N-Gram * href="http://en.wikipedia.org/wiki/N-gram#Smoothing_techniques">N-Gram
@ -222,8 +222,7 @@ public final class PhraseSuggestionBuilder extends SuggestionBuilder<PhraseSugge
/** /**
* An <a href="http://en.wikipedia.org/wiki/Additive_smoothing">additive * An <a href="http://en.wikipedia.org/wiki/Additive_smoothing">additive
* smoothing</a> model. Laplace is used as the default if no smoothing model * smoothing</a> model.
* is configured.
* <p> * <p>
* See <a * See <a
* href="http://en.wikipedia.org/wiki/N-gram#Smoothing_techniques">N-Gram * href="http://en.wikipedia.org/wiki/N-gram#Smoothing_techniques">N-Gram