I got the following error message the test_preprocess_data(preprocess_data), even though I have the expected outcomes as obtained outcomes.
Wrong number of unknown tokens in the test_data_replaced list. Check the unknown token value and how you are using it.
Welcome to the community.
Can you please share the screenshot of errors.
This error is probably because you are using global scope variable for unknown token value.
Please make sure you use
unknown_token variable in your implementations and not “<unk>”.
You can learn more about this (variable scope, function parameters in Python) by searching on the internet and finding many explanations like:
This is the knowledge every Python user should know not only for this course.
Thanks for your help … the problem is solved after replacing “” with unknown_token
im also getting a similar error can someone please tell me where I’m going wrong
Hi, I have the same problem. Did you work it out? Thanks!
I also had the same problem. Resolved it by passing the unknown_token parameter to the replace_oov_words_by_unk instead of assuming that it will take it from the default value in the parameter.