Created
February 26, 2020 10:14
-
-
Save gaphex/f09946792d59dfb235bae256ef7f2e48 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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