Home > Blockchain >  "`select()` doesn't handle lists" when computing textSimilarity between two word embe
"`select()` doesn't handle lists" when computing textSimilarity between two word embe

Time:05-06

How many words in word embedding variables do you need to compute semantic similarity in r-package text? I’m trying to run:

library(text)
WEhello<-textEmbed("hello")
WEgoodbye<-textEmbed("goodbye")
textSimilarity(WEhello, WEgoodbye)

But I get this error:

Error in `dplyr::select()`:
! `select()` doesn't handle lists.

CodePudding user response:

To get this to work you have to select the word embedding (and avoid also including the $singlewords_we). Try this:

textSimilarity(WEhello$x, WEgoodbye$x)
  • Related