-
Notifications
You must be signed in to change notification settings - Fork 78
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
trouble using wordVectors in Rscript. #37
Comments
OK: whatever the issue is, it seems to be solved on the dev branch but not master. Hmm, looks like I need to read up on Rscript. My testing code is this: library(wordVectors)
test = read.vectors("~/vector_models/GoogleNewsPartial.bin",nrow=1000)
test %>% closest_to("that") And I get the error:
This seems to be because Rscript doesn't load basic libraries by default: if I run Rscript --default-packages=methods,utils test.R It works for me. That's a different problem than you're getting! But maybe try it with those default package flags? |
Interestingly, when I run your minimal file (substituting a vector file I have on hand), I get this:
Yet another weird error. I see this with the dev branch, too, however:
I can make it work, though, by adding:
to the top of the Rscript file. That accomplishes the same thing as adding |
Pasted from an e-mail I received for tracking.
I’m having trouble using wordVectors in Rscript.
A minimal case:
This code works fine in an interactive R session, but it fails when run via Rscript:
(I get the same failure if I rewrite it to use traditional(function(nesting(syntax))) instead of magrittr, BTW.)
Code like
cosineSimilarity(model[['man']],model[['woman']]) %>% print()
also fails similarly in Rscript but works when stepped through or source()’d in an interactive R session.
Back in 2015 I used wordVectors extensively in Rscript with no problems, so whatever’s going on here seems to be connected to changes since then.
The text was updated successfully, but these errors were encountered: