Tweet_to_tensor function

Hi can someone helps to make sense why I got wrong answer in unittest?

Output does not match with expected values. Maybe you can check the value you are using for unk_token variable. Also, try to avoid using the global dictionary Vocab.
 Expected: [444, 3, 304, 567, 56, 9].
 Got: [444, 2, 304, 567, 56, 9].
 7  Tests passed
 1  Tests failed

I tried to open the w1_unittest; and something is fishy:

        {
            "name": "simple_test_check2",
            "input": {
                "tweet": "@heyclaireee is back! thnx God!!! i'm so happy :)",
                "vocab_dict": Vocab,
                "unk_token": "followfriday",
            },
            "expected": {
                "output_list": [444, 3, 304, 567, 56, 9],
                "output_type": type([]),
            },
        },

is it should the unk_token is __ UNK __ not followfriday

My Lab ID: yqzhwxhx

Hi,
I guess checking again “get the unique integer ID of the UNK token” and “for each word in the list”

1 Like

ahh right, I missed that points. Thanks for pointing this out!

Yeah, I got that same mistake, and it turns out I was using ‘UNK’ (the string) for getting the unk_ID. I used the variable (unk_token) instead, and it fixed the problem.