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
80b429aa
Unverified
Commit
80b429aa
authored
Jul 06, 2023
by
farzanehnakhaee70
Committed by
GitHub
Jul 06, 2023
Browse files
Merge pull request #1 from EleutherAI/qa4mre
List out answer choices in QA4MRE
parents
5a75f82a
c7508401
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
6 deletions
+13
-6
lm_eval/tasks/qa4mre/preprocess_qa4mre.py
lm_eval/tasks/qa4mre/preprocess_qa4mre.py
+4
-0
lm_eval/tasks/qa4mre/qa4mre_2011.yaml
lm_eval/tasks/qa4mre/qa4mre_2011.yaml
+3
-2
lm_eval/tasks/qa4mre/qa4mre_2012.yaml
lm_eval/tasks/qa4mre/qa4mre_2012.yaml
+3
-2
lm_eval/tasks/qa4mre/qa4mre_2013.yaml
lm_eval/tasks/qa4mre/qa4mre_2013.yaml
+3
-2
No files found.
lm_eval/tasks/qa4mre/preprocess_qa4mre.py
View file @
80b429aa
def
qa4mre_process
(
doc
):
def
qa4mre_process
(
doc
):
return
int
(
doc
[
"correct_answer_id"
])
-
1
return
int
(
doc
[
"correct_answer_id"
])
-
1
def
doc_to_target
(
doc
):
return
doc
[
"answer_options"
][
"answer_str"
][
qa4mre_process
(
doc
)]
lm_eval/tasks/qa4mre/qa4mre_2011.yaml
View file @
80b429aa
...
@@ -6,8 +6,9 @@ dataset_name: 2011.main.EN
...
@@ -6,8 +6,9 @@ dataset_name: 2011.main.EN
output_type
:
multiple_choice
output_type
:
multiple_choice
test_split
:
train
test_split
:
train
template_aliases
:
"
{%
set
answer_choices
=
answer_options['answer_str']
%}"
template_aliases
:
"
{%
set
answer_choices
=
answer_options['answer_str']
%}"
doc_to_text
:
"
{{document_str.strip()}}
\n
Question:
{{question_str}}
\n
Answer:"
doc_to_text
:
"
{{document_str.strip()}}
\n
Question:
{{question_str}}
\n
Choices:
\n
-
{{answer_choices|join('
\n
-
')}}
\n
Answer:"
doc_to_target
:
!function
preprocess_qa4mre.qa4mre_process
doc_to_target
:
!function
preprocess_qa4mre.doc_to_target
gold_alias
:
!function
preprocess_qa4mre.qa4mre_process
should_decontaminate
:
true
should_decontaminate
:
true
doc_to_decontamination_query
:
"
{{document_str.strip()}}
+
'
'
+
{{question_str}}"
doc_to_decontamination_query
:
"
{{document_str.strip()}}
+
'
'
+
{{question_str}}"
metric_list
:
metric_list
:
...
...
lm_eval/tasks/qa4mre/qa4mre_2012.yaml
View file @
80b429aa
...
@@ -6,8 +6,9 @@ dataset_name: 2012.main.EN
...
@@ -6,8 +6,9 @@ dataset_name: 2012.main.EN
output_type
:
multiple_choice
output_type
:
multiple_choice
test_split
:
train
test_split
:
train
template_aliases
:
"
{%
set
answer_choices
=
answer_options['answer_str']
%}"
template_aliases
:
"
{%
set
answer_choices
=
answer_options['answer_str']
%}"
doc_to_text
:
"
{{document_str.strip()}}
\n
Question:
{{question_str}}
\n
Answer:"
doc_to_text
:
"
{{document_str.strip()}}
\n
Question:
{{question_str}}
\n
Choices:
\n
-
{{answer_choices|join('
\n
-
')}}
\n
Answer:"
doc_to_target
:
!function
preprocess_qa4mre.qa4mre_process
doc_to_target
:
!function
preprocess_qa4mre.doc_to_target
gold_alias
:
!function
preprocess_qa4mre.qa4mre_process
should_decontaminate
:
true
should_decontaminate
:
true
doc_to_decontamination_query
:
"
{{document_str.strip()}}
+
'
'
+
{{question_str}}"
doc_to_decontamination_query
:
"
{{document_str.strip()}}
+
'
'
+
{{question_str}}"
metric_list
:
metric_list
:
...
...
lm_eval/tasks/qa4mre/qa4mre_2013.yaml
View file @
80b429aa
...
@@ -6,8 +6,9 @@ dataset_name: 2013.main.EN
...
@@ -6,8 +6,9 @@ dataset_name: 2013.main.EN
output_type
:
multiple_choice
output_type
:
multiple_choice
test_split
:
train
test_split
:
train
template_aliases
:
"
{%
set
answer_choices
=
answer_options['answer_str']
%}"
template_aliases
:
"
{%
set
answer_choices
=
answer_options['answer_str']
%}"
doc_to_text
:
"
{{document_str.strip()}}
\n
Question:
{{question_str}}
\n
Answer:"
doc_to_text
:
"
{{document_str.strip()}}
\n
Question:
{{question_str}}
\n
Choices:
\n
-
{{answer_choices|join('
\n
-
')}}
\n
Answer:"
doc_to_target
:
!function
preprocess_qa4mre.qa4mre_process
doc_to_target
:
!function
preprocess_qa4mre.doc_to_target
gold_alias
:
!function
preprocess_qa4mre.qa4mre_process
should_decontaminate
:
true
should_decontaminate
:
true
doc_to_decontamination_query
:
"
{{document_str.strip()}}
+
'
'
+
{{question_str}}"
doc_to_decontamination_query
:
"
{{document_str.strip()}}
+
'
'
+
{{question_str}}"
metric_list
:
metric_list
:
...
...
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