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
8b038c2a
Commit
8b038c2a
authored
Feb 09, 2021
by
Leo Gao
Browse files
Update spacing
parent
3a90e246
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lm_eval/tasks/winogrande.py
lm_eval/tasks/winogrande.py
+2
-2
lm_eval/tasks/wsc273.py
lm_eval/tasks/wsc273.py
+2
-2
No files found.
lm_eval/tasks/winogrande.py
View file @
8b038c2a
...
@@ -39,13 +39,13 @@ class Winogrande(HFTask):
...
@@ -39,13 +39,13 @@ class Winogrande(HFTask):
return
doc
[
"sentence"
][:
pronoun_loc
]
+
option
return
doc
[
"sentence"
][:
pronoun_loc
]
+
option
def
doc_to_target
(
self
,
doc
):
def
doc_to_target
(
self
,
doc
):
return
" "
+
self
.
partial_target
(
doc
)
return
self
.
partial_target
(
doc
)
@
classmethod
@
classmethod
def
partial_target
(
cls
,
doc
):
def
partial_target
(
cls
,
doc
):
# The target is everything after the document specified pronoun.
# The target is everything after the document specified pronoun.
pronoun_loc
=
doc
[
"sentence"
].
index
(
"_"
)
+
1
pronoun_loc
=
doc
[
"sentence"
].
index
(
"_"
)
+
1
return
doc
[
"sentence"
][
pronoun_loc
:].
strip
()
return
" "
+
doc
[
"sentence"
][
pronoun_loc
:].
strip
()
def
construct_requests
(
self
,
doc
,
ctx
):
def
construct_requests
(
self
,
doc
,
ctx
):
"""Uses RequestFactory to construct Requests and returns an iterable of
"""Uses RequestFactory to construct Requests and returns an iterable of
...
...
lm_eval/tasks/wsc273.py
View file @
8b038c2a
...
@@ -70,13 +70,13 @@ class WinogradSchemaChallenge273(HFTask):
...
@@ -70,13 +70,13 @@ class WinogradSchemaChallenge273(HFTask):
return
doc
[
"text"
][:
doc
[
"pronoun_loc"
]]
+
option
return
doc
[
"text"
][:
doc
[
"pronoun_loc"
]]
+
option
def
doc_to_target
(
self
,
doc
):
def
doc_to_target
(
self
,
doc
):
return
" "
+
self
.
partial_target
(
doc
)
return
self
.
partial_target
(
doc
)
@
classmethod
@
classmethod
def
partial_target
(
cls
,
doc
):
def
partial_target
(
cls
,
doc
):
# The target is everything after the document specified pronoun.
# The target is everything after the document specified pronoun.
start_index
=
doc
[
"pronoun_loc"
]
+
len
(
doc
[
"pronoun"
])
start_index
=
doc
[
"pronoun_loc"
]
+
len
(
doc
[
"pronoun"
])
return
doc
[
"text"
][
start_index
:].
strip
()
return
" "
+
doc
[
"text"
][
start_index
:].
strip
()
def
construct_requests
(
self
,
doc
,
ctx
):
def
construct_requests
(
self
,
doc
,
ctx
):
"""Uses RequestFactory to construct Requests and returns an iterable of
"""Uses RequestFactory to construct Requests and returns an iterable of
...
...
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