Skip to content

Commit

Permalink
fixing compatability with topcis 0.21.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar Kjell authored and Oscar Kjell committed Nov 30, 2024
1 parent ea179c9 commit b05c2ea
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/testthat/test_7_textTopics.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ library(dplyr)
library(text)
library(testthat)
library(ggplot2)

#install.packages("topics")
#
# .rs.restartR()
#help(textrpp_initialize)
Expand All @@ -16,6 +16,7 @@ library(ggplot2)
test_that("Bertopic", {
skip_on_cran()

save_dir_temp <- tempdir()
#Langauge_based_assessment_data_8 <- load(Language_based_assessment_data_8.rda")

# Load and prepare data
Expand All @@ -38,7 +39,7 @@ test_that("Bertopic", {
embedding_model = "distilroberta",
min_df = 2,
set_seed = 42,
save_dir="./results")
save_dir= save_dir_temp)

testthat::expect_equal(bert_model$preds$t_1[2],
.1115696,
Expand Down Expand Up @@ -71,19 +72,18 @@ test_that("Bertopic", {
test = test2,
# p_alpha = 0.05,
figure_format = "png",
save_dir = "./results"
seed = 42,
save_dir = save_dir_temp
)

plots <- text::textTopicsWordcloud(
model = bert_model,
save_dir = "./results",
figure_format = "png"
save_dir = save_dir_temp,
figure_format = "png",
seed = 42,
)


}

unlink("./results", recursive = TRUE)
})


Expand Down

0 comments on commit b05c2ea

Please sign in to comment.