You can do this efficiently in PyTorch for every word in your vocab by ... def closest(vec): dists = torch.sqrt(((glove.vectors - vec) ...
確定! 回上一頁