knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

reticulate::use_virtualenv("../env")

You can download external datasets to easily build models. External dataset can be found on RaRe-Technologies/gensim-data.

library(gensimr)

dataset <- "glove-twitter-25"

# model description
api_info(dataset) %>% 
  .[["description"]]

# download the model
model <- api_load(dataset)

# find words most similar to "cat"
model$most_similar("cat") %>% 
  reticulate::py_to_r()


news-r/gensimr documentation built on Jan. 9, 2021, 5:55 a.m.