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
34fc9e68
Commit
34fc9e68
authored
Jul 05, 2023
by
lintangsutawika
Browse files
add winogrande
parent
241aa871
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
lm_eval/tasks/winogrande/default.yaml
lm_eval/tasks/winogrande/default.yaml
+16
-0
lm_eval/tasks/winogrande/preprocess.py
lm_eval/tasks/winogrande/preprocess.py
+15
-0
No files found.
lm_eval/tasks/winogrande/default.yaml
0 → 100644
View file @
34fc9e68
group
:
-
super-glue-lm-eval-v1
task
:
winogrande
dataset_path
:
winogrande
dataset_name
:
winogrande_xl
output_type
:
multiple_choice
should_decontaminate
:
true
doc_to_decontamination_query
:
"
{{sentence}}"
training_split
:
train
validation_split
:
validation
metric_list
:
-
metric
:
exact_match
aggregation
:
mean
higher_is_better
:
true
ignore_case
:
true
ignore_punctuation
:
true
lm_eval/tasks/winogrande/preprocess.py
0 → 100644
View file @
34fc9e68
import
re
from
lm_eval.utils
import
general_detokenize
def
partial_context
(
doc
,
option
):
# Substitute the pronoun in the sentence with the specified option
# and ignore everything after.
pronoun_loc
=
doc
[
"sentence"
].
index
(
"_"
)
return
doc
[
"sentence"
][:
pronoun_loc
]
+
option
def
partial_target
(
doc
):
# The target is everything after the document specified pronoun.
pronoun_loc
=
doc
[
"sentence"
].
index
(
"_"
)
+
1
return
" "
+
doc
[
"sentence"
][
pronoun_loc
:].
strip
()
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