discourse/plugins/discourse-ai/lib/tasks/modules/sentiment/backfill.rake
2025-07-22 15:07:59 +02:00

11 lines
384 B
Ruby
Vendored

# frozen_string_literal: true
desc "Backfill sentiment for all posts"
task "ai:sentiment:backfill", [:start_post] => [:environment] do |_, args|
DiscourseAi::Sentiment::PostClassification
.backfill_query(from_post_id: args[:start_post].to_i)
.find_in_batches do |batch|
print "."
DiscourseAi::Sentiment::PostClassification.new.bulk_classify!(batch)
end
end