Skip to content

Instantly share code, notes, and snippets.

@gaphex
Created February 26, 2020 10:14
Show Gist options
  • Select an option

  • Save gaphex/f09946792d59dfb235bae256ef7f2e48 to your computer and use it in GitHub Desktop.

Select an option

Save gaphex/f09946792d59dfb235bae256ef7f2e48 to your computer and use it in GitHub Desktop.
def load_snli(fpaths):
sa, sb, lb = [], [], []
fpaths = np.atleast_1d(fpaths)
for fpath in fpaths:
with open(fpath) as fi:
for line in fi:
sample = json.loads(line)
sa.append(sample['sentence1'])
sb.append(sample['sentence2'])
lb.append(sample['gold_label'])
return sa, sb, lb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment