In step 1, we found the top n similar words (similar in context) to a given word by calling wordsNearest(), providing both the input and count n. The n count is the number of words that we want to list.
In step 2, we tried to find the similarity of two given words. To do this, we actually calculated the cosine similarity between the two given words. The cosine similarity is one of the useful metrics that we can use to find the similarity between words/documents. We converted input words into vectors using our trained model.