reduced amount of strings and removed overuse of threads
This commit is contained in:
@@ -27,7 +27,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
public class Datahandler {
|
||||
|
||||
private ExecutorService pool = Executors.newFixedThreadPool(4);
|
||||
private ExecutorService pool = Executors.newFixedThreadPool(6);
|
||||
private CompletionService completionService = new ExecutorCompletionService(pool);
|
||||
private HashMap<String, Annotation> pipelineAnnotationCache;
|
||||
private HashMap<String, Annotation> pipelineSentimentAnnotationCache;
|
||||
@@ -139,7 +139,7 @@ public class Datahandler {
|
||||
props.setProperty("parse.model", shiftReduceParserPath);
|
||||
props.setProperty("parse.maxlen", "90");
|
||||
props.setProperty("parse.binaryTrees", "true");
|
||||
props.setProperty("threads", "5");
|
||||
props.setProperty("threads", "1");
|
||||
props.setProperty("pos.maxlen", "90");
|
||||
props.setProperty("tokenize.maxlen", "90");
|
||||
props.setProperty("ssplit.maxlen", "90");
|
||||
@@ -166,7 +166,7 @@ public class Datahandler {
|
||||
propsSentiment.setProperty("parse.model", lexParserEnglishPCFG);
|
||||
propsSentiment.setProperty("sentiment.model", sentimentModel);
|
||||
propsSentiment.setProperty("parse.maxlen", "90");
|
||||
propsSentiment.setProperty("threads", "5");
|
||||
propsSentiment.setProperty("threads", "1");
|
||||
propsSentiment.setProperty("pos.maxlen", "90");
|
||||
propsSentiment.setProperty("tokenize.maxlen", "90");
|
||||
propsSentiment.setProperty("ssplit.maxlen", "90");
|
||||
@@ -585,7 +585,6 @@ public class Datahandler {
|
||||
|
||||
for (String str1 : ues_copy) {
|
||||
if (strF != str1) {
|
||||
|
||||
//critical section
|
||||
Future<SentimentAnalyzerTest> submit = completionService.submit(new get_res(strF, str1, stanfordCoreNLP, stanfordCoreNLPSentiment,
|
||||
coreMaps1, strAnno, strAnnoSentiment, coreDocument, tokenizeCountingF, taggedWordListF
|
||||
|
||||
@@ -86,7 +86,7 @@ public class PipelineJMWESingleton {
|
||||
propsJMWE = new Properties();
|
||||
propsJMWE.setProperty("annotators", "tokenize,ssplit,pos,lemma");
|
||||
propsJMWE.setProperty("tokenize.options", "untokenizable=firstKeep");
|
||||
propsJMWE.setProperty("threads", "5");
|
||||
propsJMWE.setProperty("threads", "1");
|
||||
propsJMWE.setProperty("pos.maxlen", "90");
|
||||
propsJMWE.setProperty("tokenize.maxlen", "90");
|
||||
propsJMWE.setProperty("ssplit.maxlen", "90");
|
||||
|
||||
Reference in New Issue
Block a user