mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
updates to classifier primer
This commit is contained in:
parent
d9f8d1b688
commit
c42196e16d
1 changed files with 7 additions and 4 deletions
11
Rakefile
11
Rakefile
|
@ -292,13 +292,16 @@ task :update_screenshots => [:environment] do
|
||||||
end
|
end
|
||||||
=end
|
=end
|
||||||
|
|
||||||
desc 'train_classifier'
|
desc 'prime_classifier'
|
||||||
task :train_classifier => [:environment] do
|
task :prime_classifier => [:environment] do
|
||||||
Site.select(:id, :username).where(is_banned: false, is_deleted: false).all.each do |site|
|
Site.select(:id, :username).where(is_banned: false, is_deleted: false).all.each do |site|
|
||||||
|
next if site.site_files_dataset.where(classifier: 'spam').count > 0
|
||||||
html_files = site.site_files_dataset.where(path: /\.html$/).all
|
html_files = site.site_files_dataset.where(path: /\.html$/).all
|
||||||
|
|
||||||
html_files.each do |file|
|
html_files.each do |html_file|
|
||||||
site.train html_files.path
|
print "training #{site.username}/#{html_file.path}..."
|
||||||
|
site.train html_file.path
|
||||||
|
print "done.\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue