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

Update reader.py #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
19 changes: 2 additions & 17 deletions hw3/code/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,7 @@ def _select_answer(
return candidate_answers[0].text

elif self.mode == "confidence":
# ---------------------------------------------------------------------
# TODO - Implement confidence-based answer selection
# ---------------------------------------------------------------------
# To do this, you will be provided a list of candidate answers in the
# same order as the relevant documents for a given query. The Answers
# are data.Answer objects, constituting a text and a score.
#
# You should return the text of the candidate answer whose score is
# the largest.
# ---------------------------------------------------------------------
raise NotImplementedError(f"To be updated by the student: {self.mode}")
# ---------------------------------------------------------------------
# Don't change anything below this point (: You've done enough!
# Keep up with the good work buddy!
# ---------------------------------------------------------------------
return cand
raise NotImplementedError(f"Not currently supported")
elif self.mode == "debug":
return [cand for cand in candidate_answers]
else:
Expand Down Expand Up @@ -267,4 +252,4 @@ def __init__(self, **kwargs):
def _find_candidates(
self, query: str, documents: Union[str, List[str]]
) -> List[Answer]:
pass
pass