Skip to content

Instantly share code, notes, and snippets.

@amatsuo
Created March 27, 2019 10:13
Show Gist options
  • Save amatsuo/7f64299310a110bd8158e3c2b262ff0b to your computer and use it in GitHub Desktop.
Save amatsuo/7f64299310a110bd8158e3c2b262ff0b to your computer and use it in GitHub Desktop.
Run and combine separate spacyr benchmarks for two versions
rm(list = ls())
.rs.restartR()
library(spacyr)
#spacy_install(envname = "spacy_condaenv_2.0", version = "2.0.18")
spacy_initialize(condaenv = "spacy_condaenv_2.0", refresh_settings = T)
data_text_irishbudget2010 <- quanteda::texts(quanteda::data_corpus_irishbudget2010)
bench_1 <- microbenchmark::microbenchmark(
v2.0.18 = spacy_tokenize(data_text_irishbudget2010),
#spacy_tokenize(data_corpus_dailnoconf1991$documents$texts),
times = 10
)
save(bench_1, file = "~/Desktop/temp/bench_1.rda")
rm(list = ls())
.rs.restartR()
library(spacyr)
data_text_irishbudget2010 <- quanteda::texts(quanteda::data_corpus_irishbudget2010)
spacy_initialize(refresh_settings = T)
bench_res <- microbenchmark::microbenchmark(
v2.1.3 = spacy_tokenize(data_text_irishbudget2010),
v2.0.18 = 1,
times = 10
)
load(file = "~/Desktop/temp/bench_1.rda")
bench_res$time[bench_res$expr=="v2.0.18"] <- bench_1$time
save(bench_res, file = "~/Desktop/temp/bench_res.rda"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment