Skip to content

Commit e91aa54

Browse files
committed
speed up examples of read/write paragraph2vec
1 parent 80671d7 commit e91aa54

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

R/paragraph2vec.R

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,14 @@ as.matrix.paragraph2vec_trained <- function(x, encoding='UTF-8', ...){
169169
#' x <- subset(belgium_parliament, language %in% "french")
170170
#' x <- subset(x, nchar(text) > 0 & txt_count(text, pattern = " ") < 1000)
171171
#'
172-
#' model <- paragraph2vec(x = x, type = "PV-DM", dim = 15, iter = 5)
173172
#' \donttest{
173+
#' model <- paragraph2vec(x = x, type = "PV-DM", dim = 100, iter = 20)
174174
#' model <- paragraph2vec(x = x, type = "PV-DBOW", dim = 100, iter = 20)
175175
#' }
176-
#'
176+
#' \dontshow{
177+
#' model <- paragraph2vec(x = head(x, 5),
178+
#' type = "PV-DM", dim = 5, iter = 1, min_count = 0)
179+
#' }
177180
#' path <- "mymodel.bin"
178181
#' \dontshow{
179182
#' path <- tempfile(pattern = "paragraph2vec", fileext = ".bin")
@@ -213,11 +216,14 @@ write.paragraph2vec <- function(x, file){
213216
#' x <- subset(belgium_parliament, language %in% "french")
214217
#' x <- subset(x, nchar(text) > 0 & txt_count(text, pattern = " ") < 1000)
215218
#'
216-
#' model <- paragraph2vec(x = x, type = "PV-DM", dim = 15, iter = 5)
217219
#' \donttest{
220+
#' model <- paragraph2vec(x = x, type = "PV-DM", dim = 100, iter = 20)
218221
#' model <- paragraph2vec(x = x, type = "PV-DBOW", dim = 100, iter = 20)
219222
#' }
220-
#'
223+
#' \dontshow{
224+
#' model <- paragraph2vec(x = head(x, 5),
225+
#' type = "PV-DM", dim = 5, iter = 1, min_count = 0)
226+
#' }
221227
#' path <- "mymodel.bin"
222228
#' \dontshow{
223229
#' path <- tempfile(pattern = "paragraph2vec", fileext = ".bin")

man/read.paragraph2vec.Rd

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/write.paragraph2vec.Rd

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)