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
d4daf44c
Commit
d4daf44c
authored
Oct 24, 2020
by
Anish Thite
Browse files
add rte text
parent
171f2924
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
lm_eval/tasks/superglue.py
lm_eval/tasks/superglue.py
+22
-0
No files found.
lm_eval/tasks/superglue.py
View file @
d4daf44c
...
...
@@ -282,3 +282,25 @@ class SGWinogradSchemaChallenge(HFTask):
)
preds
.
append
(
1
if
generated
==
to_predict
else
0
)
return
simple_accuracy_metric
(
preds
=
preds
,
golds
=
golds
)
class
RTE
(
HFTask
):
DATASET_PATH
=
"super_glue"
DATASET_NAME
=
"rte"
def
fewshot_description
(
self
):
#TODO: implement
pass
def
doc_to_text
(
self
,
doc
,
include_target
=
True
):
if
include_target
:
if
doc
[
'label'
]
==
0
:
answer
=
'True'
else
:
answer
=
'False'
return
''
.
join
([
doc
[
'premise'
],
'
\n
question: '
,
doc
[
'hypothesis'
],
' True or False?
\n
answer: '
,
answer
])
else
:
return
''
.
join
([
doc
[
'premise'
],
'
\n
question: '
,
doc
[
'hypothesis'
],
' True or False?
\n
answer: '
])
def
evaluate
(
self
,
docs
,
lm
,
provide_description
,
num_fewshot
):
#TODO:
pass
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