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
7a1ec14f
Unverified
Commit
7a1ec14f
authored
Jul 27, 2023
by
GUIJIN SON
Committed by
GitHub
Jul 27, 2023
Browse files
Create haerae.py
parent
df3da98c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
lm_eval/tasks/haerae.py
lm_eval/tasks/haerae.py
+56
-0
No files found.
lm_eval/tasks/haerae.py
0 → 100644
View file @
7a1ec14f
from
lm_eval.base
import
MultipleChoiceTask
class
Haerae
(
MultipleChoiceTask
):
VERSION
=
0
DATASET_PATH
=
"data/haerae/haerae.py"
def
has_training_docs
(
self
):
return
False
def
has_validation_docs
(
self
):
return
False
def
has_test_docs
(
self
):
return
True
def
test_docs
(
self
):
return
map
(
self
.
_process_doc
,
self
.
dataset
[
"test"
])
def
_process_doc
(
self
,
doc
):
choices
=
[
doc
[
"o1"
],
doc
[
"o2"
],
doc
[
"o3"
],
doc
[
"o4"
]]
if
doc
.
get
(
"o5"
)
is
not
None
:
choices
.
append
(
doc
[
"o5"
])
out_doc
=
{
"query"
:
doc
[
"query"
],
"choices"
:
choices
,
"gold"
:
int
(
doc
[
'gold'
]),
}
return
out_doc
def
doc_to_text
(
self
,
doc
):
return
doc
[
"query"
]
class
HI
(
Haerae
):
DATASET_NAME
=
"HI"
class
KGK
(
Haerae
):
DATASET_NAME
=
"KGK"
class
LW
(
Haerae
):
DATASET_NAME
=
"LW"
class
RC
(
Haerae
):
DATASET_NAME
=
"RC"
class
RW
(
Haerae
):
DATASET_NAME
=
"RW"
class
SN
(
Haerae
):
DATASET_NAME
=
"SN"
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