<commit_before>total_count = Edition.count
changed_count = 0
Edition.where(summary: nil).find_each do |edition|
  edition.update_column(:summary, Whitehall::Uploader::Parsers::SummariseBody.parse(edition.body))
  changed_count += 1
end

puts "Total: #{total_count}, changed: #{changed_count}"<commit_msg>Provide summaries for editions with blank summaries, not just null<commit_after>total_count = Edition.count
changed_count = 0
Edition.find_each do |edition|
  if edition.summary.blank?
    edition.update_column(:summary, Whitehall::Uploader::Parsers::SummariseBody.parse(edition.body))
    changed_count += 1
  end
end

puts "Total: #{total_count}, changed: #{changed_count}"
{'fraction_non_alphanumeric': 0.12076583210603829, 'fraction_numerical': 0.005891016200294551, 'mean_word_length': 7.192771084337349, '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': '983104', 'n_tokens_mistral': 221, 'n_tokens_neox': 217, 'n_words': 46}