C4-W3 assignment: Question Answering : Grade Received: 0%

I finished the last assignment with no errors, everything works and are passed including all the unit tests, but when I submit the assignment and view the grades, it gives me “Grade Received: 0%” and tells me to try again.

Is there any more detailed feedback if you click “Show Grader Output”? The overall point is that just passing the tests in the notebook does not prove your code is completely correct. But if you get 0%, that usually means there is some kind of syntax error or the like with the grader’s test cases. So the point is that your code is not “general”: it only works with one set of test cases. The sorts of errors that can cause this are referencing global variables or hard-coding assumptions about the dimensions of the inputs. Please look again at your notebook with that in mind.

Hello @NGh

Another issue it could be because the last two courses of NLP were recently graded, some of the learners have ended up working on an obsolete/old copy of assignment which can cause grader failure. By any chance for us to confirm the issue is same as stated, we need a screenshot of your submission grader output which provided detail on why you failed any grader cells.

Also in future, avoid sharing any codes from graded assignments, any links to your assignment which grades your programming skills in a course here, as it is against community guidelines and you need to follow Code of Conduct.

Regards
DP

1 Like

This is the screenshot:
It says “There was a problem compiling the code from your notebook. Details:
name ‘tokenizer’ is not defined”, but I have no clue what the issue might be.

That variable tokenizer is created by one of the early cells in the notebook that is before any of the code that you write and is used in many places. Are you sure you didn’t accidentally change that cell to be “markdown” instead of code or something like that? What happens right now if you do the following in the notebook:

Kernel -> Restart and Clear Output
Save
Cell -> Run All

Does everything still run correctly?

@paulinpaloalto
Yes, I checked again and it’s a “code” cell, not a “markdown”.
And I did what you suggested, still no error anywhere, all tests passed, but it still gives me 0% grade.

Ok, thanks for trying those experiments. Please check your DMs for a message from me about how to proceed.

To close the loop on the public thread, the problem is that the function definition of the tokenize_and_mask function was changed in a way that made the code fail the grader.

Here’s what it looks like in the template code (at least as of April 18, 2024):

# GRADED FUNCTION: tokenize_and_mask
def tokenize_and_mask(text, 
                      noise=0.15, 
                      randomizer=np.random.uniform, 
                      tokenizer=None):

As a general matter, it is never a good idea to change the definition of any of the graded functions that they give you. It’s not illegal to change things outside the “YOUR CODE HERE” sections but you need to be very sure you know what you are doing when you make changes outside the demarcated area.

1 Like