def train_command_handler (arguments) : if (len (arguments) != 1) : raise Exception () parameter = parameters.parse_file (train_parameter_definition, arguments[0]) store = builders.build_store (parameter['store']) classifier = builders.build_classifier (parameter['classifier']) classifier.load () train_classifier (classifier, store) classifier.store () store.destroy () classifier.destroy ()
def validate_command_handler (arguments) : if (len (arguments) != 1) : raise Exception () parameter = parameters.parse_file (validate_parameter_definition, arguments[0]) store = builders.build_store (parameter['store']) classifier = builders.build_classifier (parameter['classifier']) validator = builders.build_validator (parameter['validator']) classifier.load () validate_classifier (classifier, validator, store) store.destroy () classifier.destroy () validator.destroy ()
def __init__ (self, parameter) : self.store = builders.build_store (parameter['store']) self.classifier = builders.build_classifier (parameter['classifier']) self.classifier.load () self.template_loader = genshi.template.TemplateLoader ('./templates/wui', auto_reload = True)