Skip to content
This repository has been archived by the owner on Feb 15, 2021. It is now read-only.

Error: 'skipgram_cbow' is not an exported object from 'namespace:fastTextR' #2

Closed
AnyaMit opened this issue Oct 17, 2018 · 9 comments
Closed

Comments

@AnyaMit
Copy link

AnyaMit commented Oct 17, 2018

Hi -
I'm following this tutorial ( https://cran.r-project.org/web/packages/textTinyR/vignettes/word_vectors_doc2vec.html
)

ERROR:

Error in skipgram_cbow(input_path = PATH_INPUT, output_path = PATH_OUT,  : 
  could not find function "skipgram_cbow"

Running into an error when running the following code:

`vecs` = fastTextR::skipgram_cbow(input_path = PATH_INPUT, output_path = PATH_OUT, 
                                 method = "skipgram", lr = 0.075, lrUpdateRate = 100, 
                                 dim = 300, ws = 5, epoch = 5, minCount = 1, neg = 5, 
                                 wordNgrams = 2, loss = "ns", bucket = 2e+06,
                                minn = 0, maxn = 0, thread = 6, t = 1e-04, verbose = `2)`

Thank you for your help!

@mlampros
Copy link
Owner

hello @AnyaMit,

have you installed the fastTextR package as described in the README.md file using

devtools::install_github('mlampros/fastTextR')

? I updated the README.md so that a user can install the package directly by downloading the .zip file.

@AnyaMit
Copy link
Author

AnyaMit commented Oct 18, 2018

Hi @mlampros,

Thank you for the fast reply. Yes, I have tried to download with devtools and zip file. During the install, the following message appears:

> setwd('C:/Users/......./library/')
> system("R CMD build fastTextR")
* checking for file 'fastTextR/DESCRIPTION' ... OK
* preparing 'fastTextR':
* checking DESCRIPTION meta-information ... OK
* cleaning src
Warning in cleanup_pkg(pkgdir, Log) :
  unable to run 'make clean' in 'src'
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building 'fastTextR_1.0.0.tar.gz'

> system("R CMD INSTALL fastTextR_1.0.0.tar.gz")
* installing to library 'C:/Users/......./library/'
* installing *source* package 'fastTextR' ...
** libs

*** arch - i386
Warning: running command 'make -f "Makevars.win" -f "C:/Users/......./Local/R-34~1.4/etc/i386/Makeconf" -f "C:/Users/......./Local/R-34~1.4/share/make/winshlib.mk" CXX='$(CXX11) $(CXX11STD)' CXXFLAGS='$(CXX11FLAGS)' CXXPICFLAGS='$(CXX11PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX11LDFLAGS)' SHLIB_LD='$(SHLIB_CXX11LD)' SHLIB="fastTextR.dll" OBJECTS="RcppExports.o args.o dictionary.o fasttext.o main.o matrix.o model.o utils.o vector.o"' had status 127
ERROR: compilation failed for package 'fastTextR'
* removing 'C:/Users/......./Local/R-3.4.4/library/fastTextR'
* restoring previous 'C:/Users/......./Local/R-3.4.4/library/fastTextR'
In R CMD INSTALL
Warning message:
running command 'R CMD INSTALL fastTextR_1.0.0.tar.gz' had status 1 

@AnyaMit
Copy link
Author

AnyaMit commented Oct 18, 2018

Hi @mlampros,

Was able to solve the issue. I downloaded the zip file from the repository page. Extracted it locally to my R library directory. Renamed the folder fastTextR. Then, ran 4 suggested lines from 'READ ME':


setwd('/your_folder/fastTextR/')
Rcpp::compileAttributes(verbose = TRUE)
setwd('/your_folder/')
system("R CMD build fastTextR")

but, instead of running the last line "(system("R CMD INSTALL fastTextR_1.0.0.tar.gz")", I installed the .zip file through R Studio GUI.

Not sure why that solved the issue, but the skipgram_cbow function works now.

@mlampros
Copy link
Owner

mlampros commented Oct 18, 2018

@AnyaMit I guess the issue that you faced with system("R CMD INSTALL ...") is windows related (fastTextR can be installed on windows). However, it's good that you found a workaround to make it work.

@mlampros
Copy link
Owner

I close the issue for know. Feel free to reopen it in case that the function does not work as expected.

@AnyaMit
Copy link
Author

AnyaMit commented Oct 19, 2018 via email

@msmith01
Copy link

I was also running into the same problem and tried the solutions suggested. Ugrading to rtools from 3.4 to 3.5 got the code working.

@AnyaMit
Copy link
Author

AnyaMit commented Feb 16, 2019 via email

@mlampros
Copy link
Owner

hi @AnyaMit, @msmith01,

I uploaded the updated version of the fastText package. It can be installed only from Github as it wasn't finally accepted from CRAN due to the fact that there are already two other versions of the same algorithm.
There is also a blog post explaining the new functionality.
This repository will be archived. New issues can be opened only in the new repository. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants