Skip to content

Instantly share code, notes, and snippets.

@wezleysherman
Created July 31, 2020 05:12
Show Gist options
  • Save wezleysherman/eeade3c3e103607703ba69ce0d5e9b9d to your computer and use it in GitHub Desktop.
Save wezleysherman/eeade3c3e103607703ba69ce0d5e9b9d to your computer and use it in GitHub Desktop.
def score_bar(input_bar, artists_bars, artists_avg_readability, artists_avg_rhyme_idx):
gen_readability = textstat.automated_readability_index(input_bar)
gen_rhyme_idx = calc_rhyme_density(input_bar)
comp_bars = compare_bars(input_bar, artists_bars)
# Scores based off readability, rhyme index, and originality. The lower the score the better.
bar_score = (artists_avg_readability - gen_readability) + (artists_avg_rhyme_idx - gen_rhyme_idx) + comp_bars
return bar_score
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment