For a pre-trained vocabulary and the vocabs in your datasets for training, it is common that there are
some words in datasets not included in pre-trained vocabulary. To solve this, we can set max_size and unk_init when build_vocab. max_size means the number of most commonly occurred words for building your vocab, and for the rest of words, just use unk_init to represent them, since they are less occurring in the text and unimportant. For example:
TEXT.build_vocab(train_data, max_size=25000, vectors=“glove.6B.100d”, unk_init=torch.Tensor.normal_)
For details, check this https://torchtext.readthedocs.io/en/latest/data.html?highlight=build_vocab#torchtext.data.Field.build_vocab 126
Also, remember to fix this weight during training.