C2W3 Assignment Ex 7 & 8

For exercise 7 I am currently getting 3 test cases failing though I’m not sure what is wrong, since all we’re doing is just calling the get_words_with_nplus_frequency on the train_data and then calling replace_oov_words_by_unk on the train and test data passing vocabulary we got from the first part of the exercise.

For exercise 8 I’m not sure why the inner for loop’s iterator is set as sentence when shouldn’t it be i? I justh have 1 test case failing for that exercise out of 6 but I’m not sure what is wrong.

1 Like

Please click my name and message your notebook as an attachment.

I got the same problem.

Please click my name and message your notebook as an attachment.

@balaji.ambresh for me also same problem can you please solve testcases are failing in 7,8 exercise but i dont where the problem is

@tejakalyanam
Please click my name and message your notebook as an attachment.

@balaji.ambresh okay i have sent notebook to you can you please look into it

  1. In exercise 7, please fix the calls to replace_oov_words_by_unk and replace_oov_words_by_unk by including the replacement token.
  2. In exercise 8, m should be corrected. Remember that for n-grams, you start from current position and look exactly n positions forward.

@balaji.ambresh can you please check 10th exercise also also

There are 3 problems with your implementation for exercise 10:

  1. n should stand for gram size. For instance, when using trigrams, n should equal 3.
  2. unique_words is a global variable. Size of number of unique words is provided as a function parameter. Use it instead.
  3. k should be set based on the function parameter. Do not hardcode the value.
1 Like

I am facing a similar issue only in my cases 2 test cases failed .

Please click my name and message your notebook as an attachment.