annotate function causes crash sometimes to just exception handling it
This commit is contained in:
parent
6916ca5d1e
commit
a9888c1679
@ -198,12 +198,16 @@ public class Datahandler {
|
||||
private void createStrAnnotation(String str, StanfordCoreNLP stanfordCoreNLP, Boolean sentimentBool) {
|
||||
Annotation strAnno2 = new Annotation(str);
|
||||
strAnno2.compact();
|
||||
try {
|
||||
stanfordCoreNLP.annotate(strAnno2);
|
||||
if (sentimentBool) {
|
||||
pipelineSentimentAnnotationCache.put(str, strAnno2);
|
||||
} else {
|
||||
pipelineAnnotationCache.put(str, strAnno2);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("stanfordcorenlp annotate failed" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private SentimentAnalyzerTest getReponseFuturesHelper(String strF, String str1, StanfordCoreNLP stanfordCoreNLP,
|
||||
|
Loading…
Reference in New Issue
Block a user