Checks if highest-order (in this case, n=4) n-gram has been seen. If not “degrades” to a lower-order model (n=3, 2); we would use even higher orders, but ShinyApps caps app size at 100mb
Further work can expand the main weakness of this approach: long-range context
Current algorithm discards contextual information past 4-grams
We can incorporate this into future work through clustering underlying training corpus/data and predicting what cluster the entire sentence would fall into
This allows us to predict using ONLY the data subset that fits the long-range context of the sentence, while still preserving the performance characteristics of an n-gram and Stupid Backoff model