<commit_before>from django.core.management.base import BaseCommand, CommandError
from cityhallmonitor.models import Document
import sys
sys.path.append(sys.path[0] + "/cityhallmonitor/document_classifier") 
from title_analysis import *
import random

class Command(BaseCommand):
	help = 'Adds a classification type to each document.'

	def handle(self, *args, **options):

		for doc in Document.objects.all():
			doc.classification = classifyTitle(cleanTitle(doc.title))
			doc.save()<commit_msg>Edited module path for import, and removed import *<commit_after>from django.core.management.base import BaseCommand, CommandError
from cityhallmonitor.models import Document
from cityhallmonitor.document_classifier.title_analysis import cleanTitle, classifyTitle
import random

class Command(BaseCommand):
	help = 'Adds a classification type to each document.'

	def handle(self, *args, **options):

		for doc in Document.objects.all():
			doc.classification = classifyTitle(cleanTitle(doc.title))
			doc.save()
{'fraction_non_alphanumeric': 0.09325396825396826, 'fraction_numerical': 0.000992063492063492, 'mean_word_length': 6.055944055944056, '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': '4256037', 'n_tokens_mistral': 289, 'n_tokens_neox': 269, 'n_words': 83}