<jupyter_start><jupyter_text>Target features: [2016-2018]```Project Essay    (length, ?/!, precise numbers)Project Subject Subcategory TreeProject Resource CategoryProject CostProject Valid Time (Expiration Date - Posted Date)Teacher Project Posted Sequence```<jupyter_code>df.columns
import re
regex_sanitize = re.compile(r"(<!--DONOTREMOVEESSAYDIVIDER-->)")
df_1618['Project Essay Cleaned'] = df_1618['Project Essay'].str.replace(regex_sanitize, '')
df_1618['X_essay_len'] = df_1618['Project Essay Cleaned'].str.len()
df_1618['X_essay_?!'] = df_1618['Project Essay Cleaned'].str.count('\\?') + df_1618['Project Essay Cleaned'].str.count('\\!')
df_1618['X_essay_?!'].unique()
english_numbers = ["One", "Two", "Three", "Four", "Five", \
                   "Six", "Seven", "Eight", "Nine", "Ten", \
                   "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", \
                   "Sixteen", "Seventeen", "Eighteen", "Nineteen", "Twenty", \
                   "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety", \
                   "Thousand", "Million", "Billion"]
regex_numbers = re.compile("(\d|(" + "|".join(map(re.escape, english_numbers)) + "))")
df_1618['X_essay_numbers'] = df_1618['Project Essay Cleaned'].str.count(regex_numbers)
df_1618['X_essay_numbers'][0:20]
# df_1618.to_pickle("./projects_16_18_with_essay_features.pkl")
# df_1618 = pd.read_pickle("./projects_16_18_essay_features.pkl")
df_1618.head()
df_1618_features_only = df_1618.filter(['Project ID', 'Project Current Status', 'X_essay_len', 'X_essay_?!', 'X_essay_numbers'], axis=1)
df_1618_features_only.to_pickle("./projects_16_18_essay_features_only.pkl")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18650088809946713, 'fraction_numerical': 0.054470100651272946, 'mean_word_length': 5.353383458646617, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '344093', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 697, 'n_tokens_neox': 609, 'n_words': 98, 'path': 'modeling/ModelDataProcessing.ipynb', 'repo_name': 'streamlit-badge-bot/fp-vectorization', 'size': '1689'}