C3W2-final lab: Why are all my NER predictions B-art?

Hi,

I passed the prediction() function, but when I used it to predict sentence, all the NER outputs are B-art. I don’t know how to remedy it. I would appreciate it very much for your suggestions. Thanks a lot!!

Below is the prediction fucntion:
![image|690x446]Sharing grade cell codes is against community guidelines, kindly refrain from posting codes in future, you can always share error encountered or your output with the expected output image.

This is the wrong prediction example:
sentence = “Sharon Floyd flew to Miami last Friday”
predictions = predict(sentence, model, sentence_vectorizer, tag_map)
for x,y in zip(sentence.split(’ '), predictions):
if y != ‘0’:
print(x,y)

Sharon B-art
Floyd B-art
flew B-art
to B-art
Miami B-art
last B-art
Friday B-art

Hi @Xiaoruiyu

See if this thread helps you

Regards
DP

Could you please expand on this. I am still a bit confused.
Thank you!

@mackaseck

kindly create a new topic rather than responding on older posts as your issue might not be totally related to the post you are commenting on.

You can always tag this post in your created topic if you find similarity.

When you create a post, please make sure not to post any codes rather post only the error or if you have got a different output than expected output, then share a screenshot of that.

Regards
DP

1 Like