Natural Language Processing/NLP with Probabilistic Models] Assistance Request for Week Two Assignment in "Natural Language Processing with Probabilistic Models

Hello everyone,

I hope this mail finds you well. I am currently taking the Natural Language Processing with Probabilistic Models course, and I have encountered a challenge with the grading system for the Week Two assignment.

On my first submission, I obtained a score of 62.50%, which is below the pass mark. Since then, I have made several additional submissions, but the grading system consistently returns a score of 0%, despite my attempts to address the feedback.

I would greatly appreciate any guidance or assistance to better understand why the system is giving me a 0% score on my subsequent submissions and what steps I can take to improve my performance.

Thank you for your time and support.

Best regards,
Alex

hi @Kabanda_Alex

Can you take a screenshot of your grader output with show grader output on why you failed assignment even if you asked all unittest in the assignment.

An usual reason for this to happens when your way of write a code don’t match with the auto grader’s.

Like hard coding a code, or using global variable to local variables, or editing of your assignment outside of###START AND END CODE HERE### are some of the reason one fails a grade assignment.

as you stated now you got 62% check which grade cell you are failing by clicking on show grader output

Regards
DP

When I Test my function, all of them the give me an OUT PUT of All tests passed

@Kabanda_Alex

The image you shared in the same image towards right side you will notice show grader output which provides why you scored 0 on this grade cell, I need to see that screenshot.

Please stop creating multiple post for the same assignment or issue you are facing. you have created a total of 3 posts, out of which 2 were created yesterday and 1 you created just now. rather respond to what mentors are asking for, so your issues can be resolved.

Regards
DP

@Kabanda_Alex

Require a image like this

can you see below each grade cell it provides information on why it failed by clicking on right side show grader output(hide grader output in this image as the learner clicked show grader output to know why his grade failed)

Regards
DP

Thank you for your explanation.

I appreciate your assistance.

Best regards,
Alex

hi @Kabanda_Alex

okay thank you for the image. your grader output is clearly indicating there is a syntax error in one of your grade cells or it could be in multiple grade cell.

A syntax error could be due to

  1. Missing, misplaced, or mismatched punctuation

  2. Misspelled, misplaced, or missing keywords

  3. Incorrect characters in variable names

  4. Incorrect indentation (especially in if loop statement)

  5. Incorrect use of the assignment operator (=)

  6. Different number of open and closed brackets in a statement

  7. Missing quotation marks around a string

  8. Assigning a value to a function call

  9. Assigning a string or an integer to literals

Passing a unittest doesn’t confirm your codes are correct.

Even editing/deleting or adding anything outside ###START AND END CODE HERE###

can result into grade failure. Kindly go through each grade cell once and check if any of syntax error were done in assignment.

If unable to find, then kindly DM screenshots.of grade cell codes. Make sure do not post any codes or assignment link here on public post as it is against community guidelines. Click on my name and then message to send screenshots of grade cell codes.

Regards
DP

hi @Kabanda_Alex

Error in your assignment.

  1. in predict pos grade cell for code line
    check if the (pos, word) key exists in the emission_counts
    You have used incorrect dictionary as the statement refer to check keys in all_words but you used emission_count.

  2. in create transition matrix for code line
    Check if the (prev POS, current POS) tuple exists in the transition counts dictionary
    You have used transition_counts as dictionary where as it should if keys in trans_keys

  3. in create emission matrix for code line
    Check if the (POS tag, word) tuple exists as a key in emission counts
    You have used incorrect dictionary as emission_count.keys where as you should use emis_keys

  4. in viterbi forward grade cell for code line
    Calculate the probability =
    best probs of POS tag k, previous word i-1 +
    log(prob of transition from POS k to POS j) +
    log(prob that emission of POS j is word i
    You have used incorrect python function, please use math.log

5a. in viterbi backward for code line
If the probability of POS tag at row k, you are suppose to include m in the if condition for best prob as you had to check probability of last word and pred is in array form(check the code line which mentions in the same grade cell). So k is the row, m is the column, [k, m-1]
Same mistake in next code line while storing the new best probability use [k, m - 1]

5b. in viterbi backward for code line
Convert the last word’s predicted POS tag
from its unique integer ID into the string representation
using the ‘states’ list
store this in the ‘pred’ array for the last word
You were suppose to convert ast words predicted pos tag, so your previous code line was z[m-1] so you were suppose to use the same and not k, remember k is row.

5c. for code line
Find the best POS tags by walking backward through the best_paths
So don’t use any len function or corpus, rather first mention the last word position in the pred array, so it would m-1, then 0, then -1 as you are suppose to go backwards one by one and not immediately go to the 0th word in corpus

5d. for code line
Retrieve the unique integer ID of
the POS tag for the word at position ‘i’ in the corp
So here if you go back and check the unique interger stored was z and position mentions i, so for pos_tag_word_i would be z[i]

5e. Use the same z[i - 1] to the next pred[i - 1] code as you recalled it from previous code line.

  1. In compute accuracy grade cell for code line
    Check if the POS tag label matches the prediction
    you reverse the condition my mentioning
    if prediction==tag where as it should tag==prediction

Let me know if you are still encountering issue.

Regards
DP

Hi Deepti_Prasad,

I hope this message finds you well. Thank you for your insightful comments on my code; I have implemented the changes you suggested. However, I’ve noticed that my score remains 0% after my latest submission.

Could you please help me understand if there are any additional areas I should focus on, or if there might be specific issues that could be affecting my score? I truly appreciate your guidance as I continue to improve.

Thank you for your support!

Best regards,
Kabanda Alex

@Kabanda_Alex

please check your DM. need to see if your correction done were correctly or not. So shared the updated correction done by you.

Also can you confirm once you made the correction, did you re-run the cells from beginning one by one again before submitting??

hi @Kabanda_Alex

Remember when a mentor is going through your each line of code and giving you a detailed correction to be done, you are atleast suppose to make those corrections. According to the recent screenshots received I didn’t notice any corrections made to any of the points I explained in detail.

So again please refer to the previous comment where I have grade cell wise, what corrections need to be done in your assignment, then save the assignment, run the cells from beginning one of my one and then submit to get successful submission.

After this if you still are getting 0% grade, I would first like to see your corrections done as I can see there is some misunderstanding about how to do the corrections.

Regards
DP

Hello Deepi_Prasad,

Thank you for your detailed feedback and for taking the time to go through my code so thoroughly. I sincerely appreciate your effort to guide me.

I have carefully reviewed your previous comments and made the necessary corrections in line with your instructions. After implementing those changes, I ran the cells from the beginning, as you advised. However, despite making these adjustments, I am still receiving a 0% grade on the submission.

Could there be another underlying issue that might be causing this, such as the platform not recognizing the submission? I would appreciate any further insights you might have to help resolve this issue.

Looking forward to your guidance.

Best regards,
Alex

I need to see your corrections as the last time you sent correction screenshots, showed no corrections being made @Kabanda_Alex

"Thank you Deepti_Prasad! for the guidance and support throughout this journey. I managed to resolve the issue by carefully following each step suggested by my mentor, making sure to only modify the code within the designated sections, and then resubmitting with those exact changes. This attention to detail and focus on specific corrections helped ensure a successful result.

Thank you all for the encouragement and assistance!