Athira
Athira

Reputation: 155

How to check the output of word2vec

I am using word2vec to train sentences to get most nearest words. I am trying it using word2vec using R language.

Input:

"You are my best friend"

Output:

The model was generated in 'C:/Users/acer/Pictures/INTERNSHIP'!

I have used the following code in R:

g <- word2vec("mydata.txt","Word.txt")

But I have to check output after training the text with word2vec in R. Can anyone please help in trying out the same with R?

Upvotes: 2

Views: 991

Answers (1)

NCC1701
NCC1701

Reputation: 149

I think you will find very useful information in the link below. The answer to most of your questions is practically available. In this source, it is stated how to use and test the word2vec algorithm in R.

Specifically write.word2vec (model," mymodel.bin ") to save and retest the model

lookslike <-predict (model, c (" jardin "," cafes "), type =" nearest ", top_n = 5)
lookslike

http://www.bnosac.be/index.php/blog/100-word2vec-in-R

Upvotes: 1

Related Questions