Skip to content
New issue

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

Weird error - select term in position 1676 ('u.') contains a dropped type #3

Closed
dselivanov opened this issue Jun 8, 2017 · 1 comment
Closed

Comments

@dselivanov
Copy link

@dselivanov dselivanov commented Jun 8, 2017

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

@patperry
Copy link
Owner

@patperry patperry commented Jun 8, 2017

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 .)

@patperry patperry closed this Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.