pommedeterresautee / fastrtext

R wrapper for fastText
https://pommedeterresautee.github.io/fastrtext/
Other
101 stars 15 forks source link

Space-separated bigram output from get_nn #35

Open cspenn opened 5 years ago

cspenn commented 5 years ago

In my execute, I'm able to easily tell fastRtext to use bigrams, per the instructions/commands for fasttext:

execute(
  commands = c(
    "skipgram",
    "-input",
    tmp_file_txt,
    "-output",
    tmp_file_model,
    "-verbose",
    1,
    "-wordNgrams",
    2
  )
)

However, to get bigrams out that are space-separated, I'm not sure how to do that with the get_nn function, and it's not in the documentation:

nndf <- as.data.frame(get_nn(model, term, 250))

Thus I end up with messy bigrams in the DF. Any way to force get_nn to return space-separated bigrams?

pommedeterresautee commented 5 years ago

What do you need to extract ? I am not sure to understand.