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

Conversation

xesaad
Copy link

@xesaad xesaad commented Oct 22, 2021

Context and description of issue

In this issue (part 2) I identified an issue with the BasicReferenceRecognizer. Namely, when no reference to an aspect is detected, the auxiliary model overrides the prediction from ABSA with neutral sentiment and with scores = [0, 0, 0]. Notable, the entries in scores are of type int.

The problem is that, further down the pipeline in the preprocessing step, scores is required to be an array of type float in order to be normalised. If we pass [0, 0, 0] to the postprocessing step, the following error will be raised:

TypeError: ufunc 'true_divide' output (typecode 'd') could not be coerced to provided output parameter (typecode 'l') according to the casting rule ''same_kind''

Main contribution

This PR does two things to ensure that scores can be successfully normalised:

  • redefine scores = [0.0, 0.0, 0.0] in the Professor's review method to ensure it is of type List[float];
  • define the array scores to have entries of type float in the Pipeline static method postprocess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant