第15章自然言語処理:事前学習
15.7. Word Similarity and Analogy15.7 単語の類似度と類推
In Section 15.4, we trained a word2vec model on a small dataset, and applied it to find semantically similar words for an input word. In practice, word vectors that are pretrained on large corpora can be applied to downstream natural language processing tasks, which will be covered later in Section 16. To demonstrate semantics of pretrained word vectors from large corpora in a straightforward way, let’s apply them in the word similarity and analogy tasks.
英語のヒント
import os
import torch
from torch import nn
from d2l import torch as d2l