I enjoyed work with Facebook’s fastText (https://github.com/facebookresearch/fastText) library and its R’s wrapper fastrtext (https://github.com/pommedeterresautee/fastrtext). However, I want to spend some more time with StarSpace library (also Facebook’s library for NLP). Unfortunately, there’s no R package for StarSpace!

It’s quite surprising because I there are thousands of packages. Nevertheless, this one is missing. In the end, I decided to write my wrapper - https://github.com/zzawadz/StarSpaceR.

I had some problems with compilation because of dozens of compiler flags which must be set before compilation. I think that for the first time I had to use custom configure script to set up everything paths, flags and so on. The good thing is that in the configure script you can just simply run an R script to do all the job.

I also use some code from fastrtext. The author had a brilliant idea to include a custom header with some macros to change fastText behavior, like redirect streams to the R console, rename the main function to pass CMD check and so on. If you are interested, check his code here: https://github.com/pommedeterresautee/fastrtext/blob/master/src/r_compliance.h.

The current version only supports loading model to the memory and extracting words embeddings for a set of words. Check the example below: .

# library(devtools)