bert_download_model: Download a BERT-like Transformers model

Description Usage Arguments Value Examples

View source: R/embed.R

Description

Download a BERT-like Transformers model

Usage

1
2
3
4
bert_download_model(
  model_name = "bert-base-multilingual-uncased",
  path = system.file(package = "golgotha", "models")
)

Arguments

model_name

character string with the name of the model. E.g. 'bert-base-uncased', 'bert-base-multilingual-uncased', 'bert-base-multilingual-cased', 'bert-base-dutch-cased'. Defaults to 'bert-base-multilingual-uncased'.

path

path to a directory on disk where the model will be downloaded to inside a subfolder model_name

Value

invisibly, the directory where the model is saved to

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
bert_download_model("bert-base-multilingual-uncased")
bert_download_model("bert-base-dutch-cased")

path <- file.path(getwd(), "inst", "models")
bert_download_model("bert-base-multilingual-uncased", path = path)
bert_download_model("bert-base-dutch-cased", path = path)


unlink(file.path(system.file(package = "golgotha", "models"),
       "bert-base-multilingual-uncased"), recursive = TRUE)
unlink(file.path(system.file(package = "golgotha", "models"),
       "bert-base-dutch-cased"), recursive = TRUE)

bnosac/golgotha documentation built on May 28, 2020, 4:06 a.m.