Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aspect_based_sentiment_analysis/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion aspect_based_sentiment_analysis/professors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down