In the last cells of the assignment, the suggestions are always 4. shouldn’t there be one suggestion per n-gram? So I believe here it would be 5 at least for those queries with 4 prompt tokens. Do I understand it well?
Just my reply.
The max n-gram (or n_plus1_gram) is used to get the suggestion so if there are 5 n-grams (1…5) then the 5-gram will be used to get the count and hence the probability for the 5th word when added to the last 4…