<commit_before>import graph
from corpus.mysql.reddit import RedditMySQLCorpus

import cred

if __name__ == '__main__':
    corpus = RedditMySQLCorpus()
    corpus.setup(**(cred.kwargs))

    result = corpus.run_sql('SELECT * FROM comment_feature_read LIMIT 100', None)
    print('Got results')

    values = [ result[i]['ari'] for i in result ]
    graph.hist('data/ari_hist', values, 'ARI', 'Frequency',
               'Frequency of ARI values')

    values = [ result[i]['flesch_reading_ease'] for i in result ]
    graph.hist('data/flesch_reading_ease_hist', values, 'Flesch Reading Ease', 'Frequency',
               'Frequency of Flesch Reading Ease values')

    values = [ result[i]['flesch_kincaid_grade_level'] for i in result ]
    graph.hist('data/flesch_kincaid_grade_level_hist', values, 'Flesch Kincaid Grade Level', 'Frequency',
               'Frequency of Flesch Kincaid Grade Level values')

    values = [ result[i]['gunning_fog_index'] for i in result ]
    graph.hist('data/gunning_fog_index_hist', values, 'Gunning Fog Index', 'Frequency',
               'Frequency of Gunning Fog Index values')

    values = [ result[i]['smog_index'] for i in result ]
    graph.hist('data/smog_index_hist', values, 'Smog Index', 'Frequency',
               'Frequency of Smog Index values')

    values = [ result[i]['coleman_liau_index'] for i in result ]
    graph.hist('data/coleman_liau_index_hist', values, 'Coleman Liau Index', 'Frequency',
               'Frequency of Coleman Liau Index values')

    values = [ result[i]['lix'] for i in result ]
    graph.hist('data/lix_hist', values, 'LIX', 'Frequency',
               'Frequency of LIX values')

    values = [ result[i]['rix'] for i in result ]
    graph.hist('data/rix_hist', values, 'RIX', 'Frequency',
               'Frequency of RIX values')
<commit_msg>Fix a derp with indexing<commit_after>import graph
from corpus.mysql.reddit import RedditMySQLCorpus

import cred

if __name__ == '__main__':
    corpus = RedditMySQLCorpus()
    corpus.setup(**(cred.kwargs))

    result = corpus.run_sql('SELECT * FROM comment_feature_read LIMIT 100', None)
    print('Got results')

    values = [ v['ari'] for v in result ]
    graph.hist('data/ari_hist', values, 'ARI', 'Frequency',
               'Frequency of ARI values')

    values = [ v['flesch_reading_ease'] for v in result ]
    graph.hist('data/flesch_reading_ease_hist', values, 'Flesch Reading Ease', 'Frequency',
               'Frequency of Flesch Reading Ease values')

    values = [ v['flesch_kincaid_grade_level'] for v in result ]
    graph.hist('data/flesch_kincaid_grade_level_hist', values, 'Flesch Kincaid Grade Level', 'Frequency',
               'Frequency of Flesch Kincaid Grade Level values')

    values = [ v['gunning_fog_index'] for v in result ]
    graph.hist('data/gunning_fog_index_hist', values, 'Gunning Fog Index', 'Frequency',
               'Frequency of Gunning Fog Index values')

    values = [ v['smog_index'] for v in result ]
    graph.hist('data/smog_index_hist', values, 'Smog Index', 'Frequency',
               'Frequency of Smog Index values')

    values = [ v['coleman_liau_index'] for v in result ]
    graph.hist('data/coleman_liau_index_hist', values, 'Coleman Liau Index', 'Frequency',
               'Frequency of Coleman Liau Index values')

    values = [ v['lix'] for v in result ]
    graph.hist('data/lix_hist', values, 'LIX', 'Frequency',
               'Frequency of LIX values')

    values = [ v['rix'] for v in result ]
    graph.hist('data/rix_hist', values, 'RIX', 'Frequency',
               'Frequency of RIX values')

{'fraction_non_alphanumeric': 0.12475741613529248, 'fraction_numerical': 0.0016634322151372332, 'mean_word_length': 3.3209580838323354, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '2941297', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1119, 'n_words': 314}