<commit_before>namespace :activity do

  desc "Builds all the ActivityStreams (chat) in Redis"
  task :build => :environment do
    rooms = Hash[Product.all.map{|p| [p.id, p.chat_rooms.first.try(:id)] }]

    Activity.all.includes(:actor, :subject, :target).each do |activity|<commit_msg>Find activities in batches to stay in memory limits<commit_after>namespace :activity do

  desc "Builds all the ActivityStreams (chat) in Redis"
  task :build => :environment do
    rooms = Hash[Product.all.map{|p| [p.id, p.chat_rooms.first.try(:id)] }]

    Activity.includes(:actor, :subject, :target).find_each do |activity|
{'fraction_non_alphanumeric': 0.13821138211382114, 'fraction_numerical': 0.0, 'mean_word_length': 4.811320754716981, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7355796', 'n_tokens_mistral': 202, 'n_tokens_neox': 193, 'n_words': 55}