# Vote Issue in grading the assignment 3 in NLP Course 1

**URL:** <https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752>\
**Category:** NLP with Classification and Vector Spaces\
**Tags:** week-module-3\
**Created:** [April 16, 2023, 11:07am UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752 "2023-04-16T11:07:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitin\_Joshi10](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@Nitin\_Joshi10](https://community.deeplearning.ai/u/Nitin_Joshi10)\
**Post date:** [April 16, 2023, 11:07am UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/1 "2023-04-16T11:07:55Z")

</div>

![Screenshot 2023-04-16 162315](https://global.discourse-cdn.com/dlai/original/3X/7/5/75a537d37e5b92d4e5313cb85be55b7a063ac012.png)  
I have already tried rebooting and get letest version. Also creating the new copy to assignment. Nothing seems to be working.

---

<div class="post-metadata">

**Author:** ![ai\_curious](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/ai_curious/32/128003_2.png) [@ai\_curious](https://community.deeplearning.ai/u/ai_curious)\
**Post date:** [April 16, 2023, 12:33pm UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/2 "2023-04-16T12:33:24Z")

</div>

Did you also take a look through these 18 related threads for ideas?

[https://community.deeplearning.ai/search?context=category&context\_id=202&q=get\_country%20grading&skip\_context=true](https://community.deeplearning.ai/search?context=category&context_id=202&q=get_country%20grading&skip_context=true)

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [April 16, 2023, 7:25pm UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/3 "2023-04-16T19:25:34Z")

</div>

Yes, notice that you also failed the grader for the previous function `get_country`. There’s a very common error in that function that involves referencing global variables instead of the actual parameters being passed to your function. If you make that mistake in `get_country` then `get_accuracy` also fails the grader, since it calls `get_country`.

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [April 16, 2023, 7:28pm UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/4 "2023-04-16T19:28:44Z")

</div>

Just as a general matter, when you pass the tests in the notebook, but fail the grader, it means that your code is not “general”. E.g. you’ve hard-coded some assumptions like dimensions to match the particular test case in the notebook or you’ve referenced a global variable that happens to be passed as an argument in the notebook case, but the grader passes a different input parameter.

---

<div class="post-metadata">

**Author:** ![Nitin\_Joshi10](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@Nitin\_Joshi10](https://community.deeplearning.ai/u/Nitin_Joshi10)\
**Post date:** [April 17, 2023, 4:00am UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/5 "2023-04-17T04:00:37Z")

</div>

Thanks. It is working now.

---

<div class="post-metadata">

**Author:** ![ai\_curious](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/ai_curious/32/128003_2.png) [@ai\_curious](https://community.deeplearning.ai/u/ai_curious)\
**Post date:** [April 17, 2023, 12:22pm UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/6 "2023-04-17T12:22:48Z")

</div>

Glad to see your problem is resolved, but you could leave a legacy for future learners by sharing information about what changed. Did you just restart the kernel and ‘run all’ ? Use a different browser? Fix a bug? Any best practice or takeaways others can use? Thanks

---

<div class="post-metadata">

**Author:** ![New\_Aryan\_Verma](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@New\_Aryan\_Verma](https://community.deeplearning.ai/u/New_Aryan_Verma)\
**Post date:** [September 26, 2023, 6:09am UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/7 "2023-09-26T06:09:16Z")

</div>

Hey Bro I am facing the exact same issue, please share me the changes,  
it would mean a lot,  
Thanks

---

<div class="post-metadata">

**Author:** ![New\_Aryan\_Verma](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@New\_Aryan\_Verma](https://community.deeplearning.ai/u/New_Aryan_Verma)\
**Post date:** [September 26, 2023, 6:55am UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/8 "2023-09-26T06:55:31Z")

</div>

Sorry Sir I am not able to apply your hint. Please help me how to make this particular code cell more general.  
This is the only assignment I am facing problems Sir, please help me with this.  
Thank You  
(I am a big fan of you Sir)

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [September 26, 2023, 10:36am UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/9 "2023-09-26T10:36:07Z")

</div>

It is probably [my earlier comment](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/3) that is the one that is more specific to this problem. Did you read and think about what it says there?

---

<div class="post-metadata">

**Author:** ![New\_Aryan\_Verma](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@New\_Aryan\_Verma](https://community.deeplearning.ai/u/New_Aryan_Verma)\
**Post date:** [September 26, 2023, 1:50pm UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/10 "2023-09-26T13:50:44Z")

</div>

Yes Sir I understood it very well but somehow I am just not able to perform desired changes.  
Please suggest me the change.  
Thank You

_{moderator edit - solution code removed}_

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [September 26, 2023, 2:54pm UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/11 "2023-09-26T14:54:10Z")

</div>

Ask yourself why you reference two different variables `embeddings` and `word_embeddings` in that code? Where is `word_embeddings` defined? It is a global variable that happens to be passed as an argument (by reference) to `get_country` by the code given in the notebook. So writing the code the way you did is not general: it works in the notebook because that is what happened to get passed as the `embeddings` argument. But what if the grader passes a different dictionary for that argument? Kaboom, right? 🙀

---

<div class="post-metadata">

**Author:** ![New\_Aryan\_Verma](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@New\_Aryan\_Verma](https://community.deeplearning.ai/u/New_Aryan_Verma)\
**Post date:** [September 27, 2023, 8:00am UTC](https://community.deeplearning.ai/t/vote-issue-in-grading-the-assignment-3-in-nlp-course-1/309752/12 "2023-09-27T08:00:13Z")

</div>

Thank You Sir,  
I knew your help will be worth it.  
Thank you for your patience.
