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
00038fea
Commit
00038fea
authored
Oct 05, 2020
by
Leo Gao
Browse files
Q/A instead of Question/Answer
parent
6c816cb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lm_eval/tasks/webqs.py
lm_eval/tasks/webqs.py
+2
-2
No files found.
lm_eval/tasks/webqs.py
View file @
00038fea
...
@@ -19,12 +19,12 @@ class WebQs(HFNLPTask):
...
@@ -19,12 +19,12 @@ class WebQs(HFNLPTask):
def
doc_to_text
(
self
,
doc
,
include_target
=
True
):
def
doc_to_text
(
self
,
doc
,
include_target
=
True
):
print
(
doc
)
print
(
doc
)
q
=
"Q
uestion
: "
+
doc
[
'question'
]
+
'
\n
'
q
=
"Q: "
+
doc
[
'question'
]
+
'
\n
'
# this picks one answer to be the "correct" one, despite sometimes
# this picks one answer to be the "correct" one, despite sometimes
# multiple correct answers being possible.
# multiple correct answers being possible.
# TODO: make sure we're actually handling multi-answer correctly
# TODO: make sure we're actually handling multi-answer correctly
a
=
"A
nswer
:"
+
((
" "
+
doc
[
'answers'
][
0
])
if
include_target
else
''
)
a
=
"A:"
+
((
" "
+
doc
[
'answers'
][
0
])
if
include_target
else
''
)
return
q
+
a
return
q
+
a
def
evaluate
(
self
,
docs
,
lm
,
provide_description
,
num_fewshot
):
def
evaluate
(
self
,
docs
,
lm
,
provide_description
,
num_fewshot
):
...
...
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