ft_download_model: Download Fasttext Model Files

Description Usage Arguments Value Author(s) Examples

View source: R/download.R

Description

To run embeddings with a specific language, you must first download the respective language file. This needs to be done only once. As the raw files are quite large (over 6GB), this function grabs only the most frequent words. You can control the number of words by setting the number of megabytes to download.

Usage

1
ft_download_model(lang = "en", mb = 500, location = NULL)

Arguments

lang

the two letter language code specifying the language you would like to download. See the function ft_languages for a complete list of available choices.

mb

the number of megabytes to download from the file. The default (500) gets around 200k rows. Adjust as needed. Set to Inf to get all rows. This is a 6GB file.

location

Path to directory where models should be saved. Defaults to the directory where the package is installed.

Value

Invisibly returns the status code of the download. The embedding matrix is stored on disk.

Author(s)

Taylor B. Arnold, taylor.arnold@acm.org

Examples

1
2
3
4
## Not run: 
ft_download_model(lang = "zh", mb = 200)

## End(Not run)

statsmaths/fasttextM documentation built on April 2, 2020, 5:33 p.m.