diff --git a/aspect_based_sentiment_analysis/pipelines.py b/aspect_based_sentiment_analysis/pipelines.py index fdbdd1a..c3c1340 100755 --- a/aspect_based_sentiment_analysis/pipelines.py +++ b/aspect_based_sentiment_analysis/pipelines.py @@ -299,7 +299,7 @@ def postprocess( examples = batch_examples[start:end] # Examples should have the same aspect (an implicit check). aspect, = {e.aspect for e in examples} - scores = np.max([e.scores for e in examples], axis=0) + scores = np.max([e.scores for e in examples], axis=0).astype(float) scores /= np.linalg.norm(scores, ord=1) sentiment_id = np.argmax(scores).astype(int) aspect_document = CompletedSubTask( diff --git a/aspect_based_sentiment_analysis/professors.py b/aspect_based_sentiment_analysis/professors.py index a50b6bc..2b125b9 100755 --- a/aspect_based_sentiment_analysis/professors.py +++ b/aspect_based_sentiment_analysis/professors.py @@ -47,7 +47,7 @@ def review( if review.is_reference is False: sentiment = Sentiment.neutral - scores = [0, 0, 0] + scores = [0.0, 0.0, 0.0] prediction = PredictedExample.from_example( example, sentiment=sentiment, scores=scores, review=review)