def standard(corpus, routine): number_of_documents = Document.objects.filter(corpus=corpus).count() if number_of_documents == 0: return close_routine(routine, error="No document found", status="ERR") # 1. distiller.decant (tf computation ) try: decant(corpus=corpus, routine=routine, settings=settings, ref_completion=0.5) except Exception, e: return close_routine(routine, error="Exception: %s" % e, status="ERR")
def standard( corpus, routine ): number_of_documents = Document.objects.filter(corpus=corpus ).count() logger.info("opening standard routine, corpus: '%s' [%s], %s documents" % ( corpus.name, corpus.id, number_of_documents) ) if number_of_documents == 0: logger.error("routine closed, not enough documents") return close_routine( routine, error="standard routine: No document found", status="OK") # 1. distiller.decant (tf computation ) try: decant( corpus=corpus, routine=routine, settings=settings, ref_completion=0.5 ) except Exception, e: logger.exception("Exception: %s" % e) return close_routine( routine, error="Exception: %s" % e, status="ERR")