The captcha_available_models()
function lists the models available for
prediction in the {captcha}
package or another repository referenced
in the repo
parameter.
The models are loaded from the captcha repository release page
using the piggyback::pb_list()
function.
The captcha_load_model()
function downloads a model using
piggyback::pb_download()
and returns a luz_module_fitted
object.
Usage
captcha_available_models(repo = "decryptr/captcha", tag = "captcha_model")
captcha_load_model(captcha, repo = "decryptr/captcha", tag = "captcha_model")
Arguments
- repo
repository in the form
"<user>/<captcha>"
. Defaults to"decryptr/captcha"
- tag
tag name of the release to load the file.
- captcha
file name or captcha name
Value
captcha_available_models()
returns a character vector with the
names of the available models. captcha_load_model()
returns an object
of class luz_module_fitted
.
Details
Currently, available models are:
trf5: Tribunal Regional Federal 5
tjmg: Tribunal de Justiça de Minas Gerais
trt: Tribunal Regional do Trabalho 3
esaj: Tribunal de Justiça da Bahia
jucesp: Junta Comercial de São Paulo
tjpe: Tribunal de Justiça de Pernambuco
tjrs: Tribunal de Justiça do Rio Grande do Sul
sei: Sistema Eletrônico de Informações - ME
rfb: Receita Federal do Brasil
This list may be updated when new models are added to the release.
Examples
# run only with internet connection
if (interactive() && torch::torch_is_installed()) {
captcha_models_available()
# loads rfb model
model <- captcha_load_model("rfb")
# model estimated accuracy on validation dataset
utils::tail(model$records$metrics$valid, 1)[[1]][["captcha acc"]]
}