def getVector_semantic(self, tweets, lang): now = datetime.datetime.now() dia = now.day mes = now.month anyo = now.year #configuracion del sistema conf = Conf() path = conf.getAbsPath() model_loc = '%s/LuigiTasks/TrainText/Doc2VecLang_semantic/%s/%s/%s_%s.model'%(path, anyo, mes, dia, lang) days_minus = 1 while os.path.isfile(model_loc) == False and days_minus < 20: now = datetime.datetime.now() - datetime.timedelta(days=days_minus) dia = now.day mes = now.month anyo = now.year model_loc = '%s/LuigiTasks/TrainText/Doc2VecLang_semantic/%s/%s/%s_%s.model'%(path, anyo, mes, dia, lang) days_minus += 1 d2v = None if model_loc in self.models_opened: d2v = self.models_opened[model_loc] else: d2v = Doc2Vec() self.models_opened[model_loc] = d2v vectorText = self.generateVectorText_semantic(tweets, lang).split(" ") vector = np.array(d2v.simulateVectorsFromVectorText(vectorText, model_loc)) return vector / np.linalg.norm(vector)
def output(self): conf = Conf() path = conf.getAbsPath() now = datetime.datetime.now() dia = now.day mes = now.month anyo = now.year hour = now.hour return luigi.LocalTarget('%s/LuigiTasks/contenido/%s/%s/%s/%s/%s' % (path, anyo, mes, dia, hour, self.busqueda))
def run(self): #configuracion del sistema conf = Conf() path = conf.getAbsPath() comand = "luigi --module LuigiTasks.GenerateSentiment " if self.mentions == True: comand += "GenerateSentimentMetions" else: comand += "GenerateSentimentUser" comand += " --lang " + self.lang + " --user " + self.username comand += " > /dev/null 2>&1" os.popen(comand)
def output(self): conf = Conf() path = conf.getAbsPath() now = datetime.datetime.now() dia = now.day mes = now.month anyo = now.year try: usuario = self.usuario.replace("@", "") self.usuario = usuario except: pass return luigi.LocalTarget('%s/LuigiTasks/circulo/%s/%s/%s' % (path, anyo, mes, self.usuario))
def output(self): conf = Conf() path = conf.getAbsPath() """ """ now = datetime.datetime.now() dia = now.day mes = now.month anyo = now.year try: usuario = self.usuario.replace("@", "") self.usuario = usuario except: pass #return luigi.LocalTarget('%s/LuigiTasks/graphs/gephi/%s/%s/%s_%s_%s'%(path, anyo, mes, self.usuario)) return luigi.LocalTarget('%s/graphs/pagerank/%s/%s/%s.gexf' % (path, anyo, mes, self.usuario))
def output(self): conf = Conf() path = conf.getAbsPath() return luigi.LocalTarget('%s/Data/%s.mod_def' % (path, self.lang))
def output(self): conf = Conf() path = conf.getAbsPath() return luigi.LocalTarget('%s/Data/tree_%s.clasi' % (path, self.lang))
def output(self): conf = Conf() path = conf.getAbsPath() return luigi.LocalTarget( '%s/Data/%s.train' % (path, self.lang), format=luigi.format.TextFormat(encoding='utf8'))
def output(self): conf = Conf() path = conf.getAbsPath() return luigi.LocalTarget('%s/Data/results/%s.%s.json'%(path, self.lang, self.user))