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
4923a7ce
"examples/vscode:/vscode.git/clone" did not exist on "b90b0570926083771ac838cc7906f31d88ba9f49"
Commit
4923a7ce
authored
May 16, 2023
by
lintangsutawika
Browse files
fixed process
parent
e786cbac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lm_eval/tasks/super_glue/wsc/preprocess_wsc.py
lm_eval/tasks/super_glue/wsc/preprocess_wsc.py
+3
-3
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/wsc/preprocess_wsc.py
View file @
4923a7ce
...
@@ -4,9 +4,9 @@ def doc_to_text(x):
...
@@ -4,9 +4,9 @@ def doc_to_text(x):
def
_mark_span
(
text
,
span_str
,
span_idx
,
mark
):
def
_mark_span
(
text
,
span_str
,
span_idx
,
mark
):
pattern_tmpl
=
r
'^((?:\S+\s){N})(W)'
pattern_tmpl
=
r
'^((?:\S+\s){N})(W)'
pattern
=
re
.
sub
(
pattern_tmpl
,
'N'
,
str
(
span_idx
))
pattern
=
re
.
sub
(
'N'
,
str
(
span_idx
)
,
pattern_tmpl
)
pattern
=
re
.
sub
(
pattern
,
'W'
,
span_str
)
pattern
=
re
.
sub
(
'W'
,
span_str
,
pattern
)
return
re
.
sub
(
text
,
pattern
,
r
'\1{0} \2 {0}'
.
format
(
mark
))
return
re
.
sub
(
pattern
,
r
'\1{0} \2 {0}'
.
format
(
mark
)
,
text
)
text
=
x
[
'text'
]
text
=
x
[
'text'
]
text
=
_mark_span
(
text
,
x
[
'span1_text'
],
x
[
'span1_index'
],
'*'
)
text
=
_mark_span
(
text
,
x
[
'span1_text'
],
x
[
'span1_index'
],
'*'
)
...
...
lm_eval/tasks/super_glue/wsc/t5-prompt.yaml
View file @
4923a7ce
...
@@ -7,7 +7,7 @@ dataset_name: wsc
...
@@ -7,7 +7,7 @@ dataset_name: wsc
training_split
:
train
training_split
:
train
validation_split
:
validation
validation_split
:
validation
doc_to_text
:
!function
"
preprocess_wsc.doc_to_text"
doc_to_text
:
!function
"
preprocess_wsc.doc_to_text"
doc_to_target
:
"
{
{candidat
es[label]}}"
doc_to_target
:
"
{
%
set
answer_choices
=
['False',
'True']
%}{{answer_choic
es[label]}}"
metric_list
:
metric_list
:
-
metric
:
exact_match
-
metric
:
exact_match
aggregation
:
mean
aggregation
:
mean
...
...
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