Last active
April 28, 2020 17:42
-
-
Save piEsposito/88cf92386ae153b6a876e8ecb6ebb4e7 to your computer and use it in GitHub Desktop.
This file contains 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
padded_dataset = [] | |
for i in tqdm(range(len(reviews))): | |
padded_dataset.append(pad_tensor(reviews[i], int(max_pad_length))) | |
X = torch.stack(padded_dataset) | |
y = torch.tensor(labels) | |
#train test splitting | |
X_train, X_test, y_train, y_test = train_test_split(X, | |
y, | |
test_size=.25, | |
random_state=42) | |
X_train, y_train = torch.tensor(X_train), torch.tensor(y_train) | |
X_test, y_test = torch.tensor(X_test), torch.tensor(y_test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment