Skip to contents

Loads a designated pretrained model available in the `text2map.pretrained` package, hosted on GitLab. Some models need to be downloaded just once per machine. Downloading may take a while. If no location is specified (recommended), the file will be saved in the packages data folder allowing the model to be loaded with `data()`. If a location other than the packages data folder is specified, the model can be loaded with `load()`.

Usage

download_pretrained(
  model = c("vecs_fasttext300_wiki_news", "vecs_fasttext300_wiki_news_subword",
    "vecs_fasttext300_commoncrawl", "vecs_glove300_wiki_gigaword",
    "vecs_sgns300_coha_histwords", "vecs_cbow300_googlenews", "vecs_sgns300_bnc_pos",
    "vecs_sgns300_googlengrams_histwords", "vecs_sgns300_googlengrams_fic_histwords",
    "vecs_sgns300_googlengrams_histwords_fr", "vecs_sgns300_googlengrams_histwords_de",
    "vecs_sgns300_googlengrams_histwords_zh", "vecs_svd300_googlengrams_histwords",
    "vecs_sgns200_british_news", "vecs_sgns300_googlengrams_kte_en"),
  location = NULL,
  force = FALSE,
  quiet = FALSE
)

Arguments

model

Character string indicating model name to be downloaded

location

Default is `NULL` (and recommended), and will save in the R package data folder, If desired, specify saving the cmodel elsewhere Note: if saved elsewhere, model must be loaded with `load()`, not `data()`

force

Default `FALSE`. If model already exists locally, download will be stopped unless `TRUE`.

quiet

Logical (default `FALSE`) to mute messages

Details

Currently, the following corpora are available to be downloaded:

  • vecs_fasttext300_wiki_news

  • vecs_fasttext300_wiki_news_subword

  • vecs_fasttext300_commoncrawl

  • vecs_glove300_wiki_gigaword

  • vecs_sgns300_coha_histwords

  • vecs_cbow300_googlenews

  • vecs_sgns300_bnc_pos

  • vecs_sgns300_googlengrams_histwords

  • vecs_sgns300_googlengrams_fic_histwords

  • vecs_sgns300_googlengrams_histwords_fr

  • vecs_sgns300_googlengrams_histwords_de

  • vecs_sgns300_googlengrams_histwords_zh

  • vecs_svd300_googlengrams_histwords

  • vecs_sgns200_british_news

Author

Dustin Stoltz