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
example_product = "Nikon Coolpix A10 Point and Shoot Camera (Black)" | |
example_product = preprocess(example_product) | |
example_sequence = tokenizer.texts_to_sequences([example_product]) | |
example_padded_sequence = pad_sequences(example_sequence, maxlen=MAX_SEQUENCE_LENGTH) | |
print("-"*10) | |
print("Predicted category: ", category_reverse_index[model_1.predict_classes(example_padded_sequence, verbose=0)[0]]) | |
print("-"*10) | |
probabilities = model_1.predict(example_padded_sequence, verbose=0) | |
probabilities = probabilities[0] | |
print("Clothing Probability: ",probabilities[category_index["clothing"]] ) | |
print("Camera Probability: ",probabilities[category_index["camera"]] ) | |
print("home appliances probability: ",probabilities[category_index["home-appliances"]] ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment