Download and load pretrained word2vector models (https://github.com/maxoodf/word2vec#basic-usage)

load_pretrained(dir = "inst/extdata", model_name = "cb_ns_500_10")

Arguments

dir

character vector for name of dir where pretrained models will be downloaded, optional (default: "inst/extdata")

model_name

character vector for name of pretrained model, optional (default: "cb_ns_500_10")

Value

word2vec model object

Examples

coRPysprofiling::load_pretrained()
#> Downloaded model found. Loading downloaded model...
#> $model #> <pointer: 0x00000000275504e0> #> #> $model_path #> [1] "C:/Users/elano/ubc-mds/block5/dsci_524/groupproject/coRPysprofiling-R/inst/extdata/cb_ns_500_10/cb_ns_500_10.w2v" #> #> $dim #> [1] 500 #> #> $vocabulary #> [1] 437107 #> #> attr(,"class") #> [1] "word2vec"
coRPysprofiling::load_pretrained(model_name = "sg_hs_500_10")
#> Model was not found locally. Downloading and processing this pretrained model can take up to 20 minutes in total.
#> This will only need to be run once for each pretrained model.
#> Downloading pretrained model for sentence embedding. This part may take up to 10 minutes with stable internet connection...
#> Download Complete! Processing raw files. This part may also take up to 10 minutes...
#> $model #> <pointer: 0x000000002754f220> #> #> $model_path #> [1] "C:/Users/elano/ubc-mds/block5/dsci_524/groupproject/coRPysprofiling-R/inst/extdata/sg_hs_500_10/sg_hs_500_10.w2v" #> #> $dim #> [1] 500 #> #> $vocabulary #> [1] 437107 #> #> attr(,"class") #> [1] "word2vec"