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
e1fdf2a8
Commit
e1fdf2a8
authored
Aug 08, 2023
by
lintangsutawika
Browse files
update
parent
0e26c0bd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
17 deletions
+3
-17
lm_eval/tasks/super_glue/wic/t5-prompt.yaml
lm_eval/tasks/super_glue/wic/t5-prompt.yaml
+1
-1
lm_eval/tasks/super_glue/wsc/default.yaml
lm_eval/tasks/super_glue/wsc/default.yaml
+1
-1
lm_eval/tasks/super_glue/wsc/preprocess_wsc.py
lm_eval/tasks/super_glue/wsc/preprocess_wsc.py
+0
-14
lm_eval/tasks/super_glue/wsc/t5-prompt.yaml
lm_eval/tasks/super_glue/wsc/t5-prompt.yaml
+1
-1
No files found.
lm_eval/tasks/super_glue/wic/t5-prompt.yaml
View file @
e1fdf2a8
...
@@ -6,7 +6,7 @@ dataset_name: wic
...
@@ -6,7 +6,7 @@ dataset_name: wic
training_split
:
train
training_split
:
train
validation_split
:
validation
validation_split
:
validation
output_type
:
greedy_until
output_type
:
greedy_until
doc_to_text
:
"
wic
sentence1:
{{sentence1}}
sentence2:
{{sentence2}}"
doc_to_text
:
"
wic
sentence1:
{{sentence1}}
sentence2:
{{sentence2}}
word:
{{word}}
"
doc_to_target
:
label
doc_to_target
:
label
doc_to_choice
:
[
'
False'
,
'
True'
]
doc_to_choice
:
[
'
False'
,
'
True'
]
metric_list
:
metric_list
:
...
...
lm_eval/tasks/super_glue/wsc/default.yaml
View file @
e1fdf2a8
...
@@ -2,7 +2,7 @@ group:
...
@@ -2,7 +2,7 @@ group:
-
super-glue-lm-eval-v1
-
super-glue-lm-eval-v1
task
:
wsc
task
:
wsc
dataset_path
:
super_glue
dataset_path
:
super_glue
dataset_name
:
wsc
dataset_name
:
wsc
.fixed
output_type
:
multiple_choice
output_type
:
multiple_choice
training_split
:
train
training_split
:
train
validation_split
:
validation
validation_split
:
validation
...
...
lm_eval/tasks/super_glue/wsc/preprocess_wsc.py
View file @
e1fdf2a8
import
re
from
lm_eval.utils
import
general_detokenize
from
lm_eval.utils
import
general_detokenize
def
t5_prompt_doc_to_text
(
x
):
def
_mark_span
(
text
,
span_str
,
span_idx
,
mark
):
pattern_tmpl
=
r
"^((?:\S+\s){N})(W)"
pattern
=
re
.
sub
(
"N"
,
str
(
span_idx
),
pattern_tmpl
)
pattern
=
re
.
sub
(
"W"
,
span_str
,
pattern
)
return
re
.
sub
(
pattern
,
r
"\1{0}\2{0}"
.
format
(
mark
),
text
)
text
=
x
[
"text"
]
text
=
_mark_span
(
text
,
x
[
"span2_text"
],
x
[
"span2_index"
],
"*"
)
return
"wsc: "
+
text
def
default_doc_to_text
(
x
):
def
default_doc_to_text
(
x
):
raw_passage
=
x
[
"text"
]
raw_passage
=
x
[
"text"
]
# NOTE: HuggingFace span indices are word-based not character-based.
# NOTE: HuggingFace span indices are word-based not character-based.
...
...
lm_eval/tasks/super_glue/wsc/t5-prompt.yaml
View file @
e1fdf2a8
...
@@ -6,7 +6,7 @@ dataset_name: wsc
...
@@ -6,7 +6,7 @@ dataset_name: wsc
training_split
:
train
training_split
:
train
validation_split
:
validation
validation_split
:
validation
output_type
:
greedy_until
output_type
:
greedy_until
doc_to_text
:
!function
"
preprocess_wsc
.t5_prompt_doc_to_text"
doc_to_text
:
!function
"
t5_utils
.t5_prompt_doc_to_text"
doc_to_target
:
span1_text
doc_to_target
:
span1_text
metric_list
:
metric_list
:
-
metric
:
exact_match
-
metric
:
exact_match
...
...
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