def generate_recommendations(self): self.logging.debug('starting worker....') worker = Worker() rec = Recommender() self.logging.debug("starting to process user data") worker.process_user_data() self.logging.debug("starting to process document data") worker.process_document_data() worker.get_all_tags() worker.get_school_types() self.logging.debug("constructing product matrix") product_matrix = worker.build_product_matrix() documents_data = worker.get_product_matrix_data(product_matrix) for doc_col in documents_data: self.logging.debug("Processing batch of {0} matrix docs".format(len(doc_col))) # we dont want to process single item lists if len(doc_col) > 2: self.logging.debug("generating recommendations....") downloaded_documents_matrix = worker.build_downloaded_document_matrix(doc_col) df = rec.get_data_frame(downloaded_documents_matrix) yield self.process_document_collection(df)