Skip to content
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

Space-separated bigram output from get_nn #35

Open
cspenn opened this issue May 22, 2019 · 1 comment
Open

Space-separated bigram output from get_nn #35

cspenn opened this issue May 22, 2019 · 1 comment

Comments

@cspenn
Copy link

cspenn commented May 22, 2019

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
Copy link
Owner

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

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

No branches or pull requests

2 participants