我正在按照this tutorial进行训练,就像我在训练中一样,但是它总是说同样的话。有人知道这是怎么回事吗?
> #Construct sample document-term matrix con el vectorizer inicial
> sample.it <- itoken(rawsample$Abstract,
+ preprocessor = prep_fun,
+ tokenizer = tok_fun,
+ ids = rawsample$id,
+ progressbar = F)
> sample.dtm <- create_dtm (sample.it, vectorizer, vtype = "dgTMatrix", progressbar = FALSE)
> sample.tfidf <- TfIdf$new() #define tfidf model
> sample.tfidf <- fit_transform(sample.dtm, tfidf)
Error in fit_transform.Matrix(sample.dtm, tfidf) :
inherits(model, "mlapiTransformation") is not TRUE
> sample.tfidf = create_dtm(sample.it, vectorizer, vtype = "dgTMatrix", progressbar = FALSE) %>%
+ transform(tfidf)
Error in transform.Matrix(., tfidf) :
inherits(model, "mlapiTransformation") is not TRUE
sample.tfidf <- TfIdf$new() #define tfidf model
sample.tfidf <- fit_transform(sample.dtm, tfidf)