Nothing
test_that(".infer local", {
expect_error(.infer_model_type("../testdata/fake"), NA)
expect_equal(.infer_model_type("../testdata/fake"), "xlm-roberta")
## Integration with .check_model_type
expect_equal(.check_model_type(model_type = NULL, model_name = "../testdata/fake"), "xlmroberta")
## Integration with grafzahl
})
test_that(".check_model_type", {
expect_error(.check_model_type(model_type = NULL))
expect_error(.check_model_type(model_type = "idk"))
expect_error(.check_model_type(model_type = "xlmroberta", model_name = "xlm-roberta-base"), NA)
expect_error(.check_model_type(model_type = "xlm-roberta", model_name = "xlm-roberta-base"), NA)
expect_error(.check_model_type(model_type = "XLM-roberta", model_name = "xlm-roberta-base"), NA)
})
test_that("Integration with grafzahl", {
skip_on_cran()
withr::local_envvar(KILL_SWITCH = "KILL")
txt <- c(d1 = "Chinese Beijing Chinese",
d2 = "Chinese Chinese Shanghai",
d3 = "Chinese",
d4 = "Tokyo Japan Chinese",
d5 = "Chinese Chinese Chinese Tokyo Japan")
y <- factor(c("Y", "Y", "Y", "N", "Y"), ordered = TRUE)
expect_error(grafzahl(x = txt, y = y, model_name = "bert-base-cased", train_size = 1, num_train_epochs = 1), NA)
expect_error(grafzahl(x = txt, y = y, model_type = "idk", model_name = "bert-base-cased", train_size = 1, num_train_epochs = 1))
expect_error(grafzahl(x = txt, y = y, model_type = "xlmroberta", model_name = "xlm-roberta-base", train_size = 1, num_train_epochs = 1), NA)
expect_error(grafzahl(x = txt, y = y, model_type = "xlm-roberta", model_name = "xlm-roberta-base", train_size = 1, num_train_epochs = 1), NA)
expect_error(grafzahl(x = txt, y = y, model_type = "XLM-roberta", model_name = "xlm-roberta-base", train_size = 1, num_train_epochs = 1), NA)
## local
expect_error(grafzahl(x = txt, y = y, model_name = "../testdata/fake", train_size = 1, num_train_epochs = 1), NA)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.