class TrendPusher(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) date = db.Column(db.Date) windowsize = db.Column(db.Integer, default=1) uid = db.Column(db.Integer()) timestamp = db.Column(db.Integer()) user_info = db.Column(db.Text) weibo_info = db.Column(db.Text) domain = db.Column(db.String(20)) rank = db.Column(db.Integer) def __init__(self, topic, date, windowsize, uid, timestamp, user_info, weibo_info, domain, rank): self.topic = topic self.date = date self.windowsize = windowsize self.uid = uid self.timestamp = timestamp self.user_info = user_info self.weibo_info = weibo_info self.domain = domain self.rank = rank @classmethod def _name(cls): return u'TrendPusher'
class IndexTopic(db.Model): id = db.Column(db.Integer, primary_key = True, autoincrement = True) topic = db.Column(db.Text) count = db.Column(db.Integer) # 微博数 user_count = db.Column(db.Integer) # 用户数 begin = db.Column(db.Integer()) # 起始时间 end = db.Column(db.Integer()) # 终止时间 area = db.Column(db.Text) # 地理区域 key_words = db.Column(db.Text) # 关键词 opinion = db.Column(db.Text) # 代表文本 media_opinion = db.Column(db.Text) # 媒体观点 def __init__(self, topic, count, user_count, begin, end, area, key_words, opinion, media_opinion): self.topic = topic self.count = count self.user_count = user_count self.begin = begin self.end = end self.area = area self.key_words = key_words self.opinion = opinion self.media_opinion = media_opinion @classmethod def _name(cls): return u'IndexTopic'
class Topics(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) def __init__(self, topic, start_ts, end_ts): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts @classmethod def _name(cls): return u'Topics'
class QuotaCoverage(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) coverage = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, coverage): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.coverage = coverage @classmethod def _name(cls): return u'QuotaCoverage'
class PlaceSensitivity(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) words = db.Column(db.Text) def __init__(self, topic, start_ts, end_ts, words): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.words = words @classmethod def _name(cls): return u'PlaceSensitivity'
class QuotaDurationExp(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) exp = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, exp): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.exp = exp @classmethod def _name(cls): return u'QuotaDurationExp'
class PersonSensitivity(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) person = db.Column(db.Text) def __init__(self, topic, start_ts, end_ts, person): self.topic = topic self.start_ts = start_ts self_end_ts = end_ts self.person = person @classmethod def _name(cls): return u'PersonSensitivity'
class QuotaPersonSensitivity(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) pr = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, pr): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.pr = pr @classmethod def _name(cls): return u'QuotaPersonSensitivity'
class QuotaSentiment(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) sratio = db.Column(db.Text) def __init__(self, topic, start_ts, end_ts, sratio): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.sratio = sratio @classmethod def _name(cls): return u'QuotaSentiment'
class QuotaGeoPenetration(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) pcount = db.Column(db.Text) def __init__(self, topic, start_ts, end_ts, pcount): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.pcount = pcount @classmethod def _name(cls): return u'QuotaGeoPenetration'
class CoverageExp(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts= db.Column(db.Integer()) end_ts = db.Column(db.Integer()) coverage_exp = db.Column(db.Integer) def __init__(self, topic, start_ts, end_ts, coverage_exp): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.coverage_exp = coverage_exp @classmethod def _name(cls): return u'CoverageExp'
class QuotaFInvolved(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) f_involved = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, f_involved): self.topic = topic self,start_ts = start_ts self.end_ts = end_ts self.f_involved = f_involved @classmethod def _name(cls): return u'QuotaFInvolved'
class OpinionTestTime(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) child_topic = db.Column(db.Text) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) def __init__(self, topic, child_topic, start_ts, end_ts): self.topic = topic self.child_topic = child_topic self.start_ts = start_ts self.end_ts = end_ts @classmethod def _name(cls): return u'OpinionTestTime'
class QuotaIndex(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) index = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, index): self.topic = topic self.start_ts =start_ts self.end_ts = end_ts self.index = index @classmethod def _name(cls): return u'QuotaIndex'
class QuotaMediaImportance(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) media_importance = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, media_importance): self.topic =topic self.start_ts = start_ts self.end_ts = end_ts self.media_importance = media_importance @classmethod def _name(cls): return u'QuotaMediaImportance'
class QuotaFTransmission(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts =db.Column(db.Integer()) end_ts = db.Column(db.Integer()) f_transmission = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, f_transmission): self.topic = topic self.start_ts =start_ts self.end_td = end_ts self.f_transmission = f_transmission @classmethod def _name(cls): return u'QuotaFTransmission'
class QuotaAttentionExp(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) exp = db.Column(db.Text) # exp={'media':x1, 'other':x2, 'opinion_leader':x3, 'oversea':x4, 'folk':x5} def __init__(self, topic, start_ts, end_ts, exp): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.exp = exp @classmethod def _name(cls): return u'QuotaAttentionExp'
class SentimentGeo(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) end = db.Column(db.Integer()) range = db.Column(db.Integer()) sentiment = db.Column(db.Integer()) geo_count = db.Column(db.Text) def __init__(self, topic, range, end, sentiment, geo_count): self.topic = topic self.range = range self.end = end self.sentiment = sentiment self.geo_count = geo_count @classmethod def _name(cls): return u'SentimentGeo'
class PropagateCountNews(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) end = db.Column(db.Integer()) range = db.Column(db.Integer()) mtype = db.Column(db.Integer()) dcount = db.Column(db.Text) # dcount={'other':count}领域对应的count def __init__(self, topic, range, end, mtype, dcount): self.topic = topic self.range = range self.end = end self.mtype = mtype self.dcount = dcount @classmethod def _name(cls): return u'PropagateCountNews'
class CityNews(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) end = db.Column(db.Integer()) range = db.Column(db.Integer()) limit = db.Column(db.Integer(), primary_key=True) news = db.Column(db.Text) # news=[news] def __init__(self, topic, end, range, limit, news): self.topic = topic self.end = end self.range = range self.limit = limit self.news = news @classmethod def _name(cls): return u'CityNews'
class QuotaSensitivity(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) classfication = db.Column(db.Integer()) # ['category':1, 'word':2, 'place':3] score = db.Column(db.Float) # 1<=score<=5 def __init__(self, topic, start_ts, end_ts, classfication, score): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.classfication = classfication self.score = score @classmethod def _name(cls): return u'QuotaSensitivity'
class QuotaImportance(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) score = db.Column(db.Float) weight = db.Column(db.Float) # 0<=weight<=1 def __init__(self, topic, start_ts, end_ts, score, weight): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.score = score # 0<=score<1 self.weight = weight @classmethod def _name(cls): return u'QuotaImportance'
class QuotaQuickness(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) domain = db.Column(db.String(20)) quickness = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, domain, quickness): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.domain = domain self.quickness = quickness @classmethod def _name(cls): return u'QuotaQuickness'
class SentimentCount(db.Model):#情绪绝对数量曲线--已改 id = db.Column(db.Integer, primary_key=True, autoincrement=True) query = db.Column(db.String(100)) end = db.Column(db.Integer()) range = db.Column(db.Integer()) sentiment = db.Column(db.Integer()) count = db.Column(db.Integer()) def __init__(self, query, range, end, sentiment, count): self.query = query self.range = range self.end = end self.sentiment = sentiment self.count = count @classmethod def _name(cls): return u'SentimentCount'
class FirstUserNews(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) timestamp = db.Column(db.Integer()) news_info = db.Column(db.Text) def __init__(self, topic, start_ts, end_ts, timestamp, news_info): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.timestamp = timestamp self.news_info = news_info @classmethod def _name(cls): return u'FirstUserNews'
class PropagateWeibos(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) end = db.Column(db.Integer()) range = db.Column(db.Integer()) mtype = db.Column(db.Integer()) limit = db.Column(db.Integer(), primary_key=True) weibos = db.Column(db.Text) # weibos=[weibos] def __init__(self, topic, end, range, mtype, limit, weibos): self.topic = topic self.end = end self.range = range self.mtype = mtype self.limit = limit self.weibos = weibos @classmethod def _name(cls): return u'PropagateWeibos'
class LocalBridge(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) date = db.Column(db.Date) windowsize = db.Column(db.Integer, default=1) a_node = db.Column(db.Integer()) b_node = db.Column(db.Integer()) span_ab = db.Column(db.Integer) def __init__(self, topic, date, windowsize, a_node, b_node, span_ab): self.topic = topic self.date = date self.windowsize = windowsize self.a_node = a_node self.b_node = b_node self.span_ab = span_ab @classmethod def _name(cls): return u'LocalBridge'
class SentimentWeibos(db.Model):#情绪微博--已改 id = db.Column(db.Integer, primary_key=True, autoincrement=True) query = db.Column(db.String(100)) end = db.Column(db.Integer()) range = db.Column(db.Integer()) limit = db.Column(db.Integer()) sentiment = db.Column(db.Integer()) weibos = db.Column(db.Text) def __init__(self, query, range, limit, end, sentiment, weibos): self.query = query self.range = range self.limit = limit self.end = end self.sentiment = sentiment self.weibos = weibos @classmethod def _name(cls): return u'SentimentWeibos'
class NewTopicStatus(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) module = db.Column(db.String(20)) start_ts = db.Column(db.Integer()) end_ts = db.Column(db.Integer()) category = db.Column(db.String(20)) db_date = db.Column(db.Date) status = db.Column(db.Integer) def __init__(self, module, start_ts, end_ts, category, db_date, status): self.module = module self.start_ts = start_ts self.end_ts = end_ts self.category = category self.db_date = db_date self.status = status @classmethod def _name(cls): return u'NewTopicStatus'
class TopicStatus(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) module = db.Column(db.String(10))# 显示是哪个模块---moodlens/evolution/propagate/identify status = db.Column(db.Integer)# 1: completed 0: computing, -1:not compute, -2:delete topic = db.Column(db.Text) start = db.Column(db.Integer())#起始时间 end = db.Column(db.Integer())#终止时间 db_date = db.Column(db.Integer())#入库时间❯ def __init__(self, module, status, topic, start, end, db_date): self.module = module self.status = status self.topic = topic self.start = start self.end = end self.db_date = db_date @classmethod def _name(cls): return u'TopicStatus'