<jupyter_start><jupyter_text>Evaluation<jupyter_code>model = load_model("models/lstm_300k_epochs_1.h5")
test_num = 300
preds = model.predict(train_x[:test_num])
pred_labels = [[np.argmax(x)] for x in preds]
pred_titles = le.inverse_transform(pred_labels)
pred_titles
analysis_df = pd.DataFrame({'pred_x': pred_titles.tolist(), 'x': x[:test_num], 'y': y[:test_num]})
analysis_df = analysis_df[['x', 'y', 'pred_x']]
analysis_df
np.save('pickled/labelencoder_classes.npy', le.classes_)
with open('pickled/tokenizer.pickle', 'wb') as handle:
    pickle.dump(t, handle, protocol=pickle.HIGHEST_PROTOCOL)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1624203821656051, 'fraction_numerical': 0.012738853503184714, 'mean_word_length': 8.984126984126984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '441998', 'license': 'MIT', 'n_tokens_mistral': 258, 'n_tokens_neox': 251, 'n_words': 37, 'path': 'approaches/LSTM/LSTM.ipynb', 'repo_name': 'gtsli/grocery_e-receipt', 'size': '628'}