Skip to content

Commit 9c0f5ba

Browse files
committed
small performance tweak
1 parent cec92cb commit 9c0f5ba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server/preprocessing/other-scripts/preprocess.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ replace_keywords_if_empty <- function(metadata, stops) {
111111
missing_subjects = which(lapply(metadata$subject, function(x) {nchar(x)}) <= 1)
112112
vplog$info(paste("vis_id:", .GlobalEnv$VIS_ID, "Documents without subjects after replacing from title:", length(missing_subjects)))
113113
if (length(missing_subjects) > 0) {
114-
for (i in missing_subjects) {
114+
foreach (i = missing_subjects) %dopar% {
115115
candidates = mapply(paste, metadata$title[i], metadata$paper_abstract[i])
116116
candidates = lapply(candidates, function(x)paste(removeWords(x, stops), collapse=""))
117117
candidates = lapply(candidates, function(x) {gsub("[^[:alpha:]]", " ", x)})

0 commit comments

Comments
 (0)