trinker / gofastr

Make a DocumentTermMatrix faster
20 stars 3 forks source link

removeNumbers is deprecated; use remove_numbers instead #9

Closed Ihatecode22 closed 7 years ago

Ihatecode22 commented 7 years ago

I had a topic modeler built and working then I opened the same code, files, etc a few days later and it does not work, I get the error below, I have a run a bunch of tests, right now my hunch is that gofastr needs its back end remove numbers adjusted

Warning message in tokens.character(x, ...): "removeNumbers is deprecated; use remove_numbers instead"

Error in validObject(.Object): invalid class "dfmSparse" object: superclass "replValueSp" not defined in the environment of the object's class Traceback:

  1. textData %>% with(gofastr::q_dtm_stem(sentences, Chat)) %>% gofastr::remove_stopwords(stops, . stem = TRUE) %>% gofastr::filter_tf_idf(0.002, verbose = TRUE)
  2. withVisible(eval(quote(_fseq(_lhs)), env, env))
  3. eval(quote(_fseq(_lhs)), env, env)
  4. eval(expr, envir, enclos)
  5. _fseq(_lhs)
  6. freduce(value, _function_list)
  7. function_list[i]
  8. with(., gofastr::q_dtm_stem(sentences, Chat))
  9. with.default(., gofastr::q_dtm_stem(sentences, Chat))
  10. eval(substitute(expr), data, enclos = parent.frame())
  11. eval(expr, envir, enclos)
  12. gofastr::q_dtm_stem(sentences, Chat)
  13. quanteda::convert(quanteda::dfm(text, stem = TRUE, verbose = FALSE, . removeNumbers = FALSE, ...), to = to)
  14. quanteda::dfm(text, stem = TRUE, verbose = FALSE, removeNumbers = FALSE, . ...)
  15. dfm.character(text, stem = TRUE, verbose = FALSE, removeNumbers = FALSE, . ...)
  16. dfm(temp, verbose = verbose, tolower = FALSE, stem = stem, remove = remove, . select = select, thesaurus = thesaurus, dictionary = dictionary, . valuetype = valuetype, start_time = start_time)
  17. dfm.tokenizedTexts(temp, verbose = verbose, tolower = FALSE, . stem = stem, remove = remove, select = select, thesaurus = thesaurus, . dictionary = dictionary, valuetype = valuetype, start_time = start_time)
  18. compile_dfm(x, verbose = verbose)
  19. compile_dfm.tokens(x, verbose = verbose)
  20. new("dfmSparse", temp)
  21. initialize(value, ...)
  22. initialize(value, ...)
  23. callNextMethod()
  24. .nextMethod(.Object = .Object, ... = ...)
  25. validObject(.Object)
  26. stop(msg, ": ", errors, domain = NA)
trinker commented 7 years ago

Have you broken the problem up and identified which function in the chain is causing the problem? Have you updated packages? Can you provide a reproducible example?

Ihatecode22 commented 7 years ago

Yes, I used Jupyter instead of R studio so I could break it all down, the file is attached, I have altered a bunch of things and had some programmers more experienced than me look at it and it seems to be a package thing. TopicModelJTR.ipynb.zip

trinker commented 7 years ago

Can an you make the report R specific (a script that does not use an IPython notebook) and show where the gofastr package is causing an error? When we debug we want to isolate the problem. Right now this error obfuscated by several layers in an app includig the use of an IPython notebook rather than a script. In order to provide a solution we first need to figure out the cause. We can do some of this, for example: the warning you get about:

removeNumbers is deprecated; use remove_numbers

is in a gofastr depenency quanteda. If you were using updated packages you should not get this warning but even so the warning says the args have been dreprecated thus they still will work and is unrelated to the error. This tells me you're using outdated packages but sessionInfo would tell more.

This page describes how to write a minimal working example for a bug report: https://stackoverflow.com/help/mcve

Once you provide this I can isolate if the problem is in gofastr , in the IPython notebook, other dependencies, the data you're using, or the coding you've written. Often making the problem minimal will reveal the issue to you.

trinker commented 7 years ago

I'm closing this per the lack of response. Feel free to reopen