<jupyter_start><jupyter_text>Simple analysisLet's produce some basic metrics and charts to illustrate what's going on in our dataset.<jupyter_code>import pandas as pd
df = pd.read_csv("./searches.csv")
df.head()<jupyter_output><empty_output><jupyter_text>The 20 most common search terms are:<jupyter_code>df.search_terms.value_counts()[:20]
The average number of search results is
df.n_results.mean(), df.n_results.median()<jupyter_output><empty_output><jupyter_text>Looks like we have a distribution with a very long tail...<jupyter_code>bin_width = 10_000

df.n_results.hist(
    bins=range(df.n_results.min(), df.n_results.max() + bin_width, bin_width)
);<jupyter_output><empty_output><jupyter_text>Yep, that's a very sharp distribution. Let's zoom in on the first chunk of results<jupyter_code>df.n_results.hist(bins=range(0, 10_000, 500));
df.n_results.hist(bins=range(0, 1000, 50));<jupyter_output><empty_output><jupyter_text>The queries which return the most results are:<jupyter_code>(
    df.sort_values(by="n_results", ascending=False).drop_duplicates(
        subset=["search_terms"]
    )[:25]
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12576956904133685, 'fraction_numerical': 0.023746701846965697, 'mean_word_length': 7.306569343065694, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '259506', 'license': 'MIT', 'n_tokens_mistral': 441, 'n_tokens_neox': 403, 'n_words': 85, 'path': 'notebooks/rank_analysis/notebooks/02 - simple analysis.ipynb', 'repo_name': 'wellcomecollection/data-science', 'size': '1137'}