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
b1a3c6e3
Commit
b1a3c6e3
authored
Apr 25, 2022
by
cjlovering
Browse files
QQP with PS integration.
parent
26e94211
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
30 deletions
+1
-30
lm_eval/tasks/glue.py
lm_eval/tasks/glue.py
+1
-30
No files found.
lm_eval/tasks/glue.py
View file @
b1a3c6e3
...
...
@@ -245,7 +245,7 @@ class MRPC(PromptSourceTask):
return
self
.
dataset
[
"validation"
]
class
QQP
(
Task
):
class
QQP
(
PromptSource
Task
):
VERSION
=
0
DATASET_PATH
=
"glue"
DATASET_NAME
=
"qqp"
...
...
@@ -267,35 +267,6 @@ class QQP(Task):
def
validation_docs
(
self
):
return
self
.
dataset
[
"validation"
]
def
doc_to_text
(
self
,
doc
):
return
"Question 1: {}
\n
Question 2: {}
\n
Question: Do both questions ask the same thing?
\n
Answer:"
.
format
(
doc
[
"question1"
],
doc
[
"question2"
],
)
def
doc_to_target
(
self
,
doc
):
return
" {}"
.
format
(
yesno
(
doc
[
"label"
]))
def
construct_requests
(
self
,
doc
,
ctx
):
ll_yes
,
_
=
rf
.
loglikelihood
(
ctx
,
" yes"
)
ll_no
,
_
=
rf
.
loglikelihood
(
ctx
,
" no"
)
return
ll_yes
,
ll_no
def
process_results
(
self
,
doc
,
results
):
ll_yes
,
ll_no
=
results
gold
=
doc
[
"label"
]
pred
=
ll_yes
>
ll_no
return
{
"acc"
:
pred
==
gold
,
"f1"
:
(
gold
,
pred
),
}
def
higher_is_better
(
self
):
return
{
"acc"
:
True
,
"f1"
:
True
}
def
aggregation
(
self
):
return
{
"acc"
:
mean
,
"f1"
:
f1_score
}
class
STSB
(
Task
):
VERSION
=
0
...
...
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