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
dd5b526b
Commit
dd5b526b
authored
Aug 28, 2023
by
lintangsutawika
Browse files
format
parent
04f5697d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
lm_eval/tasks/wsc273/utils.py
lm_eval/tasks/wsc273/utils.py
+4
-4
No files found.
lm_eval/tasks/wsc273/utils.py
View file @
dd5b526b
upper_pronouns
=
[
upper_pronouns
=
[
"A"
,
"A"
,
"An"
,
"An"
,
...
@@ -13,8 +12,8 @@ upper_pronouns = [
...
@@ -13,8 +12,8 @@ upper_pronouns = [
"Their"
,
"Their"
,
]
]
def
process_doc
(
dataset
):
def
process_doc
(
dataset
):
def
process_fn
(
doc
):
def
process_fn
(
doc
):
# The HF implementation of `wsc273` is not `partial evaluation` friendly.
# The HF implementation of `wsc273` is not `partial evaluation` friendly.
doc
[
"text"
]
=
doc
[
"text"
].
replace
(
" "
,
" "
)
doc
[
"text"
]
=
doc
[
"text"
].
replace
(
" "
,
" "
)
...
@@ -24,6 +23,7 @@ def process_doc(dataset):
...
@@ -24,6 +23,7 @@ def process_doc(dataset):
return
dataset
.
map
(
process_fn
)
return
dataset
.
map
(
process_fn
)
def
__normalize_option
(
doc
,
option
):
def
__normalize_option
(
doc
,
option
):
# Append `'s` to possessive determiner based options.
# Append `'s` to possessive determiner based options.
if
doc
[
"pronoun"
].
lower
()
in
[
"my"
,
"his"
,
"her"
,
"our"
,
"their"
]:
if
doc
[
"pronoun"
].
lower
()
in
[
"my"
,
"his"
,
"her"
,
"our"
,
"their"
]:
...
...
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