diff --git a/src/main/java/org/texttechnologylab/project/gruppe_05_1/domain/nlp/Sentiment.java b/src/main/java/org/texttechnologylab/project/gruppe_05_1/domain/nlp/Sentiment.java index ab9398f..3894a72 100644 --- a/src/main/java/org/texttechnologylab/project/gruppe_05_1/domain/nlp/Sentiment.java +++ b/src/main/java/org/texttechnologylab/project/gruppe_05_1/domain/nlp/Sentiment.java @@ -113,9 +113,9 @@ public class Sentiment { doc.getInteger("begin"), doc.getInteger("end"), MongoDBHandler.getFieldAsDouble(doc, "score"), - MongoDBHandler.getFieldAsDouble(doc, "pos"), + MongoDBHandler.getFieldAsDouble(doc, "neg"), MongoDBHandler.getFieldAsDouble(doc, "neu"), - MongoDBHandler.getFieldAsDouble(doc, "neg") + MongoDBHandler.getFieldAsDouble(doc, "pos") )); } return sentiments; diff --git a/src/main/java/org/texttechnologylab/project/gruppe_05_1/rest/SpeechController.java b/src/main/java/org/texttechnologylab/project/gruppe_05_1/rest/SpeechController.java index f7f5f85..85e5d19 100644 --- a/src/main/java/org/texttechnologylab/project/gruppe_05_1/rest/SpeechController.java +++ b/src/main/java/org/texttechnologylab/project/gruppe_05_1/rest/SpeechController.java @@ -158,8 +158,9 @@ public class SpeechController { // Der erste Sentiment gilt der gesamten Rede. Die weitere Sentiments entsprechen die Sätze. List sentiments = speech.getNlp().getSentiments(); if ((sentiments != null) && ! sentiments.isEmpty()) { - Sentiment overallSentiment = sentiments.get(0); - attributes.put("overallSentiment", overallSentiment); + List overallSentiments = new ArrayList<>(sentiments); + attributes.put("overallSentiments", overallSentiments); + sentiments.remove(0); // Sentiment-Icon diff --git a/src/main/resources/templates/nlp.ftl b/src/main/resources/templates/nlp.ftl index 7e9bf9e..a7f9f83 100644 --- a/src/main/resources/templates/nlp.ftl +++ b/src/main/resources/templates/nlp.ftl @@ -20,8 +20,9 @@
- <#if overallSentiment??> + <#if overallSentiments??>

Sentiments Information (als Radar Chart)

+ <#assign sentiments = overallSentiments> <#include "sentimentsRadarChart.ftl"> <#else>

Keine Sentiments Information für diese Rede verfügbar

diff --git a/src/main/resources/templates/posBarChart.ftl b/src/main/resources/templates/posBarChart.ftl index 08b2972..4f0fb8f 100644 --- a/src/main/resources/templates/posBarChart.ftl +++ b/src/main/resources/templates/posBarChart.ftl @@ -1,12 +1,10 @@ + +