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
e7852f4e
Commit
e7852f4e
authored
Sep 21, 2022
by
Jaesun Park
Browse files
Fix KOBEST few-shot label
parent
4604f458
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
lm_eval/tasks/kobest.py
lm_eval/tasks/kobest.py
+8
-8
No files found.
lm_eval/tasks/kobest.py
View file @
e7852f4e
...
@@ -53,11 +53,11 @@ class BoolQ(Task):
...
@@ -53,11 +53,11 @@ class BoolQ(Task):
return
"{} 질문: {} 답변: "
.
format
(
doc
[
"paragraph"
],
doc
[
"question"
])
return
"{} 질문: {} 답변: "
.
format
(
doc
[
"paragraph"
],
doc
[
"question"
])
def
doc_to_target
(
self
,
doc
):
def
doc_to_target
(
self
,
doc
):
return
" {}"
.
format
({
0
:
"아니오
.
"
,
1
:
"예
.
"
})
return
" {}"
.
format
({
0
:
"아니오"
,
1
:
"예"
}
[
doc
[
"label"
]]
)
def
construct_requests
(
self
,
doc
,
ctx
):
def
construct_requests
(
self
,
doc
,
ctx
):
ll_no
,
_
=
rf
.
loglikelihood
(
ctx
,
" 아니오
.
"
)
ll_no
,
_
=
rf
.
loglikelihood
(
ctx
,
" 아니오"
)
ll_yes
,
_
=
rf
.
loglikelihood
(
ctx
,
" 예
.
"
)
ll_yes
,
_
=
rf
.
loglikelihood
(
ctx
,
" 예"
)
return
ll_no
,
ll_yes
return
ll_no
,
ll_yes
...
@@ -180,8 +180,8 @@ class WiC(Task):
...
@@ -180,8 +180,8 @@ class WiC(Task):
return
"문장1: {} 문장2: {} 두 문장에서 {}가 같은 뜻으로 쓰였나?"
.
format
(
doc
[
"context_1"
],
doc
[
"context_2"
],
doc
[
"word"
])
return
"문장1: {} 문장2: {} 두 문장에서 {}가 같은 뜻으로 쓰였나?"
.
format
(
doc
[
"context_1"
],
doc
[
"context_2"
],
doc
[
"word"
])
def
doc_to_target
(
self
,
doc
):
def
doc_to_target
(
self
,
doc
):
return
" {}"
.
format
({
0
:
"아니오"
,
1
:
"예"
})
return
" {}"
.
format
({
0
:
"아니오"
,
1
:
"예"
}
[
doc
[
"label"
]]
)
def
construct_requests
(
self
,
doc
,
ctx
):
def
construct_requests
(
self
,
doc
,
ctx
):
ll_no
,
_
=
rf
.
loglikelihood
(
ctx
,
" 아니오"
)
ll_no
,
_
=
rf
.
loglikelihood
(
ctx
,
" 아니오"
)
ll_yes
,
_
=
rf
.
loglikelihood
(
ctx
,
" 예"
)
ll_yes
,
_
=
rf
.
loglikelihood
(
ctx
,
" 예"
)
...
@@ -295,8 +295,8 @@ class SentiNeg(Task):
...
@@ -295,8 +295,8 @@ class SentiNeg(Task):
return
"문장: {} 긍부정:"
.
format
(
doc
[
"sentence"
])
return
"문장: {} 긍부정:"
.
format
(
doc
[
"sentence"
])
def
doc_to_target
(
self
,
doc
):
def
doc_to_target
(
self
,
doc
):
return
" {}"
.
format
({
0
:
"부정"
,
1
:
"긍정"
})
return
" {}"
.
format
({
0
:
"부정"
,
1
:
"긍정"
}
[
doc
[
"label"
]]
)
def
construct_requests
(
self
,
doc
,
ctx
):
def
construct_requests
(
self
,
doc
,
ctx
):
ll_no
,
_
=
rf
.
loglikelihood
(
ctx
,
" 부정"
)
ll_no
,
_
=
rf
.
loglikelihood
(
ctx
,
" 부정"
)
ll_yes
,
_
=
rf
.
loglikelihood
(
ctx
,
" 긍정"
)
ll_yes
,
_
=
rf
.
loglikelihood
(
ctx
,
" 긍정"
)
...
...
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