Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
15f4a3ef
Unverified
Commit
15f4a3ef
authored
Oct 03, 2023
by
Hailey Schoelkopf
Committed by
GitHub
Oct 03, 2023
Browse files
Merge pull request #890 from tmabraham/big-refactor
[Refactor] Fix PubMedQA
parents
efa38caa
3a7f52d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
lm_eval/tasks/pubmedqa/preprocess_pubmedqa.py
lm_eval/tasks/pubmedqa/preprocess_pubmedqa.py
+2
-2
lm_eval/tasks/pubmedqa/pubmedqa.yaml
lm_eval/tasks/pubmedqa/pubmedqa.yaml
+6
-6
No files found.
lm_eval/tasks/pubmedqa/preprocess_pubmedqa.py
View file @
15f4a3ef
def
doc_to_text
(
doc
)
->
str
:
ctxs
=
"
\n
"
.
join
(
doc
[
"
context"
][
"contexts
"
])
ctxs
=
"
\n
"
.
join
(
doc
[
"
CONTEXTS
"
])
return
"Abstract: {}
\n
Question: {}
\n
Answer:"
.
format
(
ctxs
,
doc
[
"
question
"
],
doc
[
"final_decision"
]
ctxs
,
doc
[
"
QUESTION
"
],
doc
[
"final_decision"
]
)
...
...
lm_eval/tasks/pubmedqa/pubmedqa.yaml
View file @
15f4a3ef
task
:
pubmed
_
qa
dataset_path
:
pubmed_qa
dataset_name
:
pqa_labeled
task
:
pubmedqa
dataset_path
:
bigbio/
pubmed_qa
dataset_name
:
p
ubmed_
qa_labeled
_fold0_source
output_type
:
multiple_choice
training_split
:
null
validation_split
:
null
test_split
:
t
rain
training_split
:
train
validation_split
:
validation
test_split
:
t
est
doc_to_text
:
!function
preprocess_pubmedqa.doc_to_text
doc_to_target
:
final_decision
doc_to_choice
:
[
"
yes"
,
"
no"
,
"
maybe"
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment