migrated missing occurances to Logger messages
This commit is contained in:
parent
660a6a5948
commit
05154c5259
1 changed files with 8 additions and 8 deletions
|
@ -229,22 +229,22 @@ public class NlpUtils {
|
|||
|
||||
}
|
||||
for (Token token : JCasUtil.select(jcas, Token.class)) {
|
||||
System.out.println(token.getCoveredText() + '\t' + token.getPosValue());
|
||||
Logger.debug(token.getCoveredText() + '\t' + token.getPosValue());
|
||||
}
|
||||
|
||||
|
||||
for (NamedEntity entity : JCasUtil.select(jcas, NamedEntity.class)) {
|
||||
if (entity.getValue().equals("PER")) {
|
||||
System.out.println("Person: " + entity.getCoveredText());
|
||||
Logger.debug("Person: " + entity.getCoveredText());
|
||||
} else if (entity.getValue().equals("LOC")) {
|
||||
System.out.println("Location: " + entity.getCoveredText());
|
||||
Logger.debug("Location: " + entity.getCoveredText());
|
||||
}
|
||||
}
|
||||
|
||||
for (Sentence sentence : JCasUtil.select(jcas, Sentence.class)) {
|
||||
System.out.println(sentence.getCoveredText());
|
||||
Logger.debug(sentence.getCoveredText());
|
||||
for (Sentiment sentiment : JCasUtil.selectCovered(Sentiment.class, sentence)) {
|
||||
System.out.println("Sentiment: " + sentiment.getSentiment());
|
||||
Logger.debug("Sentiment: " + sentiment.getSentiment());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,7 +337,7 @@ public class NlpUtils {
|
|||
Bson filter = Filters.exists("analysisResults", false);
|
||||
List<Speech> unprocessedSpeeches = mongoDBHandler.retrieveAllSpeeches(filter);
|
||||
if (unprocessedSpeeches.isEmpty()) {
|
||||
System.out.println("No unprocessed speeches found");
|
||||
Logger.warn("No unprocessed speeches found");
|
||||
}
|
||||
else {
|
||||
pComposer.resetPipeline();
|
||||
|
@ -353,7 +353,7 @@ public class NlpUtils {
|
|||
JCas jCas;
|
||||
jCas = rede.toCas();
|
||||
pComposer.run(jCas);
|
||||
System.out.println("Anzahl Sentiment-Annotationen: " + JCasUtil.select(jCas, org.hucompute.textimager.uima.type.Sentiment.class).size());
|
||||
Logger.info("Anzahl Sentiment-Annotationen: " + JCasUtil.select(jCas, org.hucompute.textimager.uima.type.Sentiment.class).size());
|
||||
Document analysisResults = extractAnnotations(jCas);
|
||||
Bson updateFilter = Filters.eq("speechKey", rede.getSpeechKey());
|
||||
Bson update = new Document("$set", new Document("analysisResults", analysisResults));
|
||||
|
@ -361,7 +361,7 @@ public class NlpUtils {
|
|||
}
|
||||
if (!bulkOperations.isEmpty()) {
|
||||
mongoDBHandler.bulkWriteNlpData(bulkOperations);
|
||||
System.out.println("Bulk write completed for " + bulkOperations.size() + " documents.");
|
||||
Logger.debug("Bulk write completed for " + bulkOperations.size() + " documents.");
|
||||
mongoDBHandler.close();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue