And when I want to know whether a vocab is in the dataset or not, I run this:
if "the" in vects:
and the code stops here. I waited for a long time but it does not do anything.
Then, I loaded the model and set the unk_init to lambda x: False
Now, I can use vects['the'] to know whether the vocab exists or not.
❓ Questions and Help
I loaded a model:
And when I want to know whether a vocab is in the dataset or not, I run this:
and the code stops here. I waited for a long time but it does not do anything. Then, I loaded the model and set the unk_init to
lambda x: False
Now, I can usevects['the']
to know whether the vocab exists or not.But why does not getitem work?