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
01630657
Unverified
Commit
01630657
authored
Feb 05, 2021
by
Leo Gao
Committed by
GitHub
Feb 05, 2021
Browse files
Merge pull request #128 from jon-tow/superglue-wsc-fix
Fix `doc_to_text` passage bug
parents
f5f60934
715dc759
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
lm_eval/tasks/superglue.py
lm_eval/tasks/superglue.py
+4
-5
No files found.
lm_eval/tasks/superglue.py
View file @
01630657
...
...
@@ -435,11 +435,10 @@ class SGWinogradSchemaChallenge(HFTask):
def
doc_to_text
(
self
,
doc
):
raw_passage
=
doc
[
"text"
]
passage
=
(
raw_passage
[:
doc
[
"span2_index"
]]
+
"*{}*"
.
format
(
doc
[
"span2_text"
])
+
raw_passage
[
doc
[
"span2_index"
]
+
len
(
doc
[
"span2_text"
]):]
)
# NOTE: HuggingFace span indices are word-based not character-based.
pre
=
" "
.
join
(
raw_passage
.
split
()[:
doc
[
"span2_index"
]])
post
=
raw_passage
[
len
(
pre
)
+
len
(
doc
[
"span2_text"
])
+
1
:]
passage
=
pre
+
" *{}*"
.
format
(
doc
[
'span2_text'
])
+
post
noun
=
doc
[
"span1_text"
]
pronoun
=
doc
[
"span2_text"
]
text
=
(
...
...
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