I was using Stanford Lexparser recently. Unfortunately, I have encountered a problem as it take a very long time especially when I pass in a large file. Will multithreading help improve the performance? I know that multithreading can be easily done in command line. However, I would like to multithread it using the API internally. Currently, I am using this code. How I make it multithread?
for (List<HasWord> sentence : new DocumentPreprocessor(fileReader)) {
parse = lp.apply(sentence);
TreePrint tp = new TreePrint("typedDependenciesCollapsed");
tp.printTree(parse, pw);
}