<jupyter_start><jupyter_text>Evaluation<jupyter_code>df.head()
test_num = 300
x = df.X.tolist()
flattened = np.asarray(x).reshape(-1)
encoded_x = t.texts_to_sequences(flattened)
train_x = pad_sequences(encoded_x, maxlen=MAX_SEQ_LEN)
train_x
# preds = model.predict(train_x[:test_num])
# pred_labels = [[np.argmax(x)] for x in preds]
preds
pred_titles = le.inverse_transform(pred_labels)
pred_titles
analysis_df = pd.DataFrame({'pred_x': pred_titles, 'x': x[:test_num], 'y': y[:test_num]})
analysis_df = analysis_df[['x', 'y', 'pred_x']]
analysis_df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16089965397923875, 'fraction_numerical': 0.006920415224913495, 'mean_word_length': 8.65, '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': '195444', 'license': 'MIT', 'n_tokens_mistral': 251, 'n_tokens_neox': 242, 'n_words': 37, 'path': 'approaches/LSTM/LSTM_generator.ipynb', 'repo_name': 'gtsli/grocery_e-receipt', 'size': '578'}