Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asaad fix reference recognizer #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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