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
dae050b4
Commit
dae050b4
authored
May 06, 2023
by
ingyuseong
Browse files
Modify the name of label 1
parent
c07ebd4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lm_eval/tasks/korunsmile.py
lm_eval/tasks/korunsmile.py
+3
-3
No files found.
lm_eval/tasks/korunsmile.py
View file @
dae050b4
...
...
@@ -20,7 +20,7 @@ _CITATION = """
def
multilable_to_multiclass
(
label
:
list
):
"""
0 = 혐오
1 =
욕설
1 =
악플
2 = 양호
"""
assert
type
(
label
[
0
])
==
int
...
...
@@ -59,7 +59,7 @@ class KorUnSmile(MultipleChoiceTask):
def
_process_doc
(
self
,
doc
):
out_doc
=
{
"title"
:
doc
[
"문장"
],
"choices"
:
[
"혐오"
,
"
욕설
"
,
"양호"
],
"choices"
:
[
"혐오"
,
"
악플
"
,
"양호"
],
"gold"
:
multilable_to_multiclass
(
doc
[
"labels"
])
}
return
out_doc
...
...
@@ -68,7 +68,7 @@ class KorUnSmile(MultipleChoiceTask):
return
"{}"
.
format
(
doc
[
"title"
])
def
doc_to_target
(
self
,
doc
):
return
" {}"
.
format
({
0
:
"혐오"
,
1
:
"
욕설
"
,
2
:
"양호"
}[
doc
[
"gold"
]])
return
" {}"
.
format
({
0
:
"혐오"
,
1
:
"
악플
"
,
2
:
"양호"
}[
doc
[
"gold"
]])
def
process_results
(
self
,
doc
,
results
):
pred
=
np
.
argmax
(
results
)
...
...
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