mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
dumper task for ml image classification work
This commit is contained in:
parent
7fd75170e2
commit
e183ac32f6
1 changed files with 14 additions and 0 deletions
14
Rakefile
14
Rakefile
|
@ -465,3 +465,17 @@ task :dedupe_site_blocks => [:environment] do
|
|||
duped_block.destroy
|
||||
end
|
||||
end
|
||||
|
||||
desc 'ml_screenshots_list_dump'
|
||||
task :ml_screenshots_list_dump => [:environment] do
|
||||
['phishing', 'spam', 'ham', nil].each do |classifier|
|
||||
File.open("./files/screenshot-urls-#{classifier.to_s}.txt", 'w') do |fp|
|
||||
SiteFile.where(classifier: classifier).where(path: 'index.html').each do |site_file|
|
||||
begin
|
||||
fp.write "#{site_file.site.screenshot_url('index.html', Site::SCREENSHOT_RESOLUTIONS.first)}\n"
|
||||
rescue NoMethodError
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue