fastrtext icon indicating copy to clipboard operation
fastrtext copied to clipboard

Space-separated bigram output from get_nn

Open cspenn opened this issue 5 years ago • 1 comments

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?

cspenn avatar May 22 '19 16:05 cspenn

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

pommedeterresautee avatar May 22 '19 22:05 pommedeterresautee