-
Notifications
You must be signed in to change notification settings - Fork 645
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
Made it possible to get answers from litqa evaluations #760
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I posed a better alternative in comments, approving because this does work
|
||
CORRECT = "correct" | ||
INCORRECT = "incorrect" | ||
UNSURE = "unsure" | ||
|
||
@property | ||
def answer(self) -> str | None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha so basically this PR moves LitQAEvaluation
to be basically an Enum
/tuple
hybrid.
I can tell from this PR that you want to just keep moving, but a better pattern would be something like a dataclass
or BaseModel
that contains an Evaluation
. So to be more specific:
- Dataclass
LitQAEntry
for an LitQA question that containsanswer: str
,ideal: str
,selection: Evaluation
- Moves all methods (e.g.
from_question
/from_answer
) to the dataclassLitQAEntry
Does that make sense?
Of course it's more of a breaking change, but you can remove the str | None
awkwardness and have simpler code
Also, feel free to just say let's save for another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna leave this here: #761
Will see how things shake-out before refactor though
I'm not super happy with the pattern, but I modified
LitQAEvaluation
so that it stuffs the extracted answer into theStrEnum
value. This makes it so we can recover the actual answers at the end, to help with consensus sampling.