<jupyter_start><jupyter_text>save model<jupyter_code>model.save('/content/drive/MyDrive/phoebe/trigger_word_model.h5')<jupyter_output><empty_output><jupyter_text>Load model and test it on an audio image, transformed into an array of numbers<jupyter_code>import tensorflow as tf
new_model = tf.keras.models.load_model('/content/drive/MyDrive/phoebe/trigger_word_model.h5')
#use 1 validation audio for testing
from keras.preprocessing import image
path = '/content/drive/MyDrive/phoebe/phoebe_chunk_val_spec/class1/audio00.png'
img=image.load_img(path, target_size=(150, 150))

x=image.img_to_array(img)
x=np.expand_dims(x, axis=0)
#images = np.vstack([x])

print(new_model.predict(x))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12171507607192254, 'fraction_numerical': 0.017980636237897647, 'mean_word_length': 7.32183908045977, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '307524', 'license': 'Apache-2.0', 'n_tokens_mistral': 283, 'n_tokens_neox': 273, 'n_words': 42, 'path': 'trigger_word.ipynb', 'repo_name': 'ShhrutiDeka/Trigger-word-Detection', 'size': '723'}