Created
January 14, 2021 16:44
-
-
Save AyishaR/c0f4685e247002a498c888933972a28c 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
# pick random test data sample from one batch | |
x = random.randint(0, len(Xtest) - 1) | |
print("Sample:\n", test_df['Text'].to_numpy()[x], sep = "") | |
input = cv.transform([test_df['Text'].to_numpy()[x]]).toarray() | |
output = model.predict(input) | |
pred = np.argmax(output[0]) # finding max | |
print("\nPredicted: ", languages[pred]) # Picking the label from class_names based on the model output | |
print("Probability: ", output[0][pred]) | |
output_true = test_df['language'].to_numpy()[x] | |
print("\nTrue: ", output_true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment