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

Parallelize lsh_compare() #69

Open
lmullen opened this issue Nov 23, 2015 · 1 comment
Open

Parallelize lsh_compare() #69

lmullen opened this issue Nov 23, 2015 · 1 comment

Comments

@lmullen
Copy link
Member

lmullen commented Nov 23, 2015

No description provided.

@retrography
Copy link

Would it be possible to parallelize lsh_compare? On large corpora the number of comparisons can quickly become very big.

I managed to do this using %dopar% and bind_rows from dplyr, but I assume there are other way to do it as well:

lshc <- function (candidates, corpus, f)
{
    num_rows <- nrow(candidates)
    bind_rows(
    foreach (i=seq_len(num_rows)) %dopar% {
        a <- candidates$a[i]
        b <- candidates$b[i]
        score <- f(corpus[[a]], corpus[[b]])
        list(a = a, b = b, score = score)
    })
}

Then I noticed that you have already used mclapply in TextReuseCorpus. So, maybe the same can be done for lsh_compare? Let me know if I can help with that.

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