Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
matrix_corpus <- function(text, bigrams = FALSE, min_count = 5) { if (bigrams) { ngrams <- 1:2 } else { ngrams <- 1 } f <- corpus::token_filter(stemmer = "english", drop_punct = TRUE, drop_number = TRUE, drop = stop_words) stats <- corpus::term_counts(text, f, ngrams = ngrams, min = min_count) x <- corpus::term_matrix(text, f, select = stats$term) x } library(text2vec) data("movie_review") text = movie_review$review corpus = matrix_corpus(text, bigrams = FALSE)
select term in position 1676 ('u.') contains a dropped type
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. Fixed in the latest development version. I'll put the fix on CRAN next week as version 0.6.1.
(If you want to try the fix, install_github won't work; follow the instructions at https://github.com/patperry/r-corpus#building-from-source .)
install_github
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: