NLP C3 W2 Named Entity Recognition

While executing the NER assignment, label_vectorizer, I am getting an error,
TypeError: ‘dict’ object is not callable

Please see attached screenshot.

Hi @nithyau_ramkumar

You are using incorrect label vectorizer function key

Check point 1 in the below pinned comment.

Regards
DP

1 Like

Hi,

After making changes as per 1, I am getting the following error.

Hi @nithyau_ramkumar

I didn’t mention to use value of -1 to be added to label_ids.

Read the instructions carefully

Hi @Deepti_Prasad Are you referring to this portion of the code?

image removed as it has grade cell codes and posting any codes is against community guidelines

Even with 0, the same error is seen.

please don’t post codes on public post. you were allowed to post code for your previous assignment because it was not graded.

you are not reading instructions carefully.

This is what I wrote in that post

for GRADED FUNCTION: label_vectorizer
You have mentioned the below code for element id as empty list
Use the dictionaty tag_map passed as an argument to the label_vectorizer function

to make the correspondence between tags and numbers.

element_ids =
HOW TO CORRECT:
The tag_map is a dictionary that maps the tags that you could have to numbers. Run the cell below to see the possible classes you will be predicting. So Use the tag_maps.get function to the token with the corresponding value of -1 under the for token loop

it clearly mentions to use value -1 for element_ids

your code is still incorrect for element_ids

when instruction me tions between tags and numbers, that doesn’t mean you are suppose to use numbers only there, at this place you are suppose to use the value -1.

in the label IDs you only require to pad the element without mentioning any value.

Regards
DP

@nithyau_ramkumar

you actually hard coded the path.

the instruction where it mentions use dictionary

there for element_ids = [ Your code should come here for the instruction I mentioned with tag_map.get keys, where you tag, number it should tag, -1]

then in label_ids, before the grade cell instructions clearly mentions to use value of -1