Unverified Commit 01630657 authored by Leo Gao's avatar Leo Gao Committed by GitHub
Browse files

Merge pull request #128 from jon-tow/superglue-wsc-fix

Fix `doc_to_text` passage bug
parents f5f60934 715dc759
......@@ -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 = (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment