Skip to content

Commit

Permalink
Merge pull request #98 from koheiw/koheiw-patch-2
Browse files Browse the repository at this point in the history
Suppress message in internal functions
  • Loading branch information
koheiw authored Jan 22, 2025
2 parents de3a2ac + 166b166 commit 2b47a1b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: seededlda
Type: Package
Title: Seeded Sequential LDA for Topic Modeling
Version: 1.4.2
Version: 1.4.3
Authors@R: c(person("Kohei", "Watanabe", email = "watanabe.kohei@gmail.com", role = c("aut", "cre", "cph")),
person("Phan", "Xuan-Hieu", email = "pxhieu@gmail.com", role = c("aut", "cph"), comment = "GibbsLDA++"))
Description: Seeded Sequential LDA can classify sentences of texts into pre-define topics with a small number of seed words (Watanabe & Baturo, 2023) <doi:10.1177/08944393231178605>.
Expand All @@ -18,7 +18,8 @@ Imports:
quanteda (>= 4.0.0),
methods,
proxyC (>= 0.3.1),
Matrix
Matrix,
utils
LinkingTo: Rcpp, RcppArmadillo (>= 0.7.600.1.0), quanteda, testthat
Suggests:
spelling,
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Changes in v1.5.0
## Changes in v1.4.3

- Move quanteda from Depends to Imports.
- Suppress messages from internal functions.
- Move **quanteda** from Depends to Imports.

## Changes in v1.4.2

Expand Down
8 changes: 6 additions & 2 deletions R/seededlda.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,12 @@ tfm <- function(x, dictionary, levels = 1,
x <- dfm_group(x, rep("text", ndoc(x)))
y <- Matrix(nrow = 0, ncol = length(feat), sparse = TRUE)
for (i in seq_along(dict)) {
temp <- dfm_select(x, pattern = dict[i], verbose = FALSE)
temp <- dfm_match(temp, features = feat)
temp <- dfm_select(x, pattern = dict[i], padding = TRUE, verbose = FALSE)
if (utils::packageVersion("quanteda") >= "4.2.0") {
temp <- dfm_match(temp, features = feat, verbose = FALSE)
} else {
temp <- dfm_match(temp, features = feat)
}
y <- rbind(y, as(temp, "dgCMatrix"))
}
rownames(y) <- key
Expand Down

0 comments on commit 2b47a1b

Please sign in to comment.