Assignment 2: Parts-of-Speech Tagging (POS)_Exercise 8 - compute_accuracy

hi ,
i am getting below error.


Thank you

1 Like

You created two posts where exercise 7 has error, then why did you go to the next section?

hi,Deepthi

ex 7 has been resolved

2 Likes

1 Like

Good @vemula that you debugged yourself, but in that post you didn’t mention how you resolved the issue.

coming to this error, notice you created word_tag_tuple, using word and tag, but the error states your word and tag do not have any values and it is expecting two values.

Notice there is a statement mentioned where predictions creates a list (y) that includes prediction and labels using zip, which you need to

Split the label into the word and the POS tag
THE INSTRUCTION TELLS To split y into the word and its tag you can use y.split().
if the above code is correct, I suspect the next line could have issue

Check that there is actually a word and a tag
no more and no less than 2 items
So here the word_tag_tuple needs to use correct condition to check if word_tag_tuple length is absolute equal to 2

Regards
DP

I am sorry @vemula when I mean absolute equal to 2, I should have mentioned it here it is not value but number of items so rather than using ==, use !=

I found another mistake in your codes

Check if the POS tag label matches the prediction
for the above code statements it tells you to check if POS tag label matches the prediction, but your code statement mentions if prediction matches the tag. So do that correction.

Thank you very much Deepti
got solution

2 Likes