Assignment 3: Language Models: Auto-Complete

Hi ,
please see the below highlighted statements

seems ,conflicting statements …
why …i think it should be (n-1) ?

did you read the next statement in the same above highlight line by you?

you will want to prepend n starting markers in order to use them to compute the initial probability for (n+1)-gram later in the assignment.

Also thank you for following code of conduct :slight_smile:


Hi Deepti,
yes , i read that statement but in execise

it is n-gram problem currect…then why it should n

venila you shared two different images, one from autocomplete assignment and one from ungraded lab and both exercise are using n-gram differently.

In the ungraded lab, n-gram is being used n-1 in tokenized sentence.
The following code shows how to get an (n-1)-gram prefix from n-gram on an example of getting trigram from a 4-gram, hence use of n-1 is correct here.

but in the assignment,
you will implement a function that computes the counts of n-grams for an arbitrary number

In assignment you are creating counts of number of word sequence from initial start_token to end token but in the ungraded lab it was using n-gram on a tokenised sentence with already assigned n-gram, i.e. trigram.


now i understood ,
thank you very much Deepti

1 Like