<jupyter_start><jupyter_text>0009 Uppercase (aka CapsLock)<jupyter_code>import pandas as pd

from features import aus, pu
df = pd.read_pickle('0000_features_20201124.pkl')  # 465<jupyter_output><empty_output><jupyter_text>* aus -- Average number of Uppercase words per Sentence (**new**)* pu -- Percentage of Uppercase words in text (**new**)<jupyter_code>%%time

df['aus'] = df.text.apply(aus)
df['pu'] = df.text.apply(pu)
df.aus.describe()
df.pu.describe()<jupyter_output><empty_output><jupyter_text>Save to pickle file<jupyter_code>tmp = df[['aus', 'pu']]
tmp.to_pickle('0009_uppercase_20220222.pkl')   # 465<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15600624024961, 'fraction_numerical': 0.0530421216848674, 'mean_word_length': 7.675675675675675, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '640345', 'license': 'Unlicense', 'n_tokens_mistral': 278, 'n_tokens_neox': 248, 'n_words': 45, 'path': '0009_uppercase.ipynb', 'repo_name': 'korniichuk/cvr-features', 'size': '641'}