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
df3da98c
Commit
df3da98c
authored
Jul 18, 2023
by
guijinSON
Browse files
update csatqa.py
parent
d3cb0c8e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
lm_eval/tasks/csatqa.py
lm_eval/tasks/csatqa.py
+11
-10
No files found.
lm_eval/tasks/csatqa.py
View file @
df3da98c
...
@@ -18,23 +18,24 @@ class CSATQA(MultipleChoiceTask):
...
@@ -18,23 +18,24 @@ class CSATQA(MultipleChoiceTask):
return
map
(
self
.
_process_doc
,
self
.
dataset
[
"test"
])
return
map
(
self
.
_process_doc
,
self
.
dataset
[
"test"
])
def
_process_doc
(
self
,
doc
):
def
_process_doc
(
self
,
doc
):
instruction
=
f
"""다음을 읽고 정답으로 알맞은 것을 고르시요.
### Context:
{
doc
[
"context"
]
}
### Question:
{
doc
[
"question"
]
}
### Options:
(1)
{
doc
[
'option#1'
]
}
\n
(2)
{
doc
[
"option#2"
]
}
\n
(3)
{
doc
[
"option#3"
]
}
\n
(4)
{
doc
[
'option#4'
]
}
\n
(5)
{
doc
[
'option$5'
]
}
### Answer: 주어진 문제의 정답은"""
choices
=
[
doc
[
"option#1"
],
doc
[
"option#2"
],
doc
[
"option#3"
],
doc
[
"option#4"
],
doc
[
"option#5"
]]
choices
=
[
doc
[
"option#1"
],
doc
[
"option#2"
],
doc
[
"option#3"
],
doc
[
"option#4"
],
doc
[
"option#5"
]]
out_doc
=
{
out_doc
=
{
"question"
:
doc
[
"question"
],
"question"
:
instruction
,
"context"
:
doc
[
"context"
],
"choices"
:
[
"(1)"
,
"(2)"
,
"(3)"
,
"(4)"
,
"(5)"
],
"choices"
:
choices
,
"gold"
:
int
(
doc
[
'gold'
]),
"gold"
:
int
(
doc
[
'gold'
]),
}
}
return
out_doc
return
out_doc
def
doc_to_text
(
self
,
doc
):
def
doc_to_text
(
self
,
doc
):
instruction
=
f
"""다음을 읽고 정답으로 알맞은 것을 고르시요.
### Context:
{
doc
[
"context"
]
}
return
doc
[
"question"
]
### Question:
{
doc
[
"question"
]
}
### Options:
(1)
{
doc
[
'choices'
][
0
]
}
\n
(2)
{
doc
[
'choices'
][
1
]
}
\n
(3)
{
doc
[
'choices'
][
2
]
}
\n
(4)
{
doc
[
'choices'
][
3
]
}
\n
(5)
{
doc
[
'choices'
][
4
]
}
### Answer: 주어진 문제의 정답은"""
return
instruction
class
WR
(
CSATQA
):
class
WR
(
CSATQA
):
...
...
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