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 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 QuotaWeight(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) weight_dict = db.Column(db.Text) def __init__(self, weight_dict): self.weight_dict = weight_dict @classmethod def _name(cls): return u'QuotaWeight'
class OpinionTopic(db.Model): id = db.Column(db.Integer, primary_key=True) topic = db.Column(db.String(100))#话题 opinion = db.Column(db.String(20))#观点 def __init__(self, topic, opinion): self.topic = topic self.opinion = opinion @classmethod def _name(cls): return u'OpinionTopic'
class OpinionTestWeibos(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) child_topic = db.Column(db.String(100)) weibos = db.Column(db.Text) def __init__(self, topic, child_topic, weibos): self.topic = topic self.child_topic = child_topic self.weibos = weibos @classmethod def _name(cls): return u'OpinionTestWeibos'
class OpinionHot(db.Model): id = db.Column(db.Integer, primary_key=True) opinionTopic = db.Column(db.Integer)#话题、观点对应表中id字段 ts = db.Column(db.Integer())#时间 count = db.Column(db.Integer)#热度 def __init__(self, opinionTopic, ts, count): self.opinionTopic = opinionTopic self.ts = ts self.count = count @classmethod def _name(cls): return u'OpinionHot'
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 AllFrequentUser(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) db_time = db.Column(db.Date) ffu_kind = db.Column(db.String(20)) user_frequent = db.Column(db.Text) def __init__(self, db_time, ffu_kind, user_frequent): self.db_time = db_time self.ffu_kind = ffu_kind self.user_frequent = user_frequent @classmethod def _name(cls): return u'AllFrequentUser'
class SentimentPoint(db.Model):#情绪拐点 id = db.Column(db.Integer, primary_key=True) topic = db.Column(db.String(100))#话题名 stype = db.Column(db.String(20))#拐点情绪类型标签('happy','angry','sad') ts = db.Column(db.Integer())#拐点时间 def __init__(self, topic, stype, ts): self.topic = topic self.stype = stype self.ts = ts @classmethod def _name(cls): return u'SentimentPoint'
class OpinionTestRatio(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) #ts = db.clumns(db.BigInteger(10),unsigned=True) child_topic = db.Column(db.Text) ratio = db.Column(db.Float) def __init__(self, topic, child_topic, ratio): self.topc = topic self.child_topic = child_topic self.ratio = ratio @classmethod def _name(cls): return u'OpinionTestRatio'
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 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 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 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 Source(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) userid = db.Column(db.Integer()) def __init__(self, topic, date, windowsize, userid): self.topic = topic self.date = date self.windowsize = windowsize self.userid = userid @classmethod def _name(cls): return u'Source'
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 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 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 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 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 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 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 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 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 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 ProvinceWeibos(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()) province = db.Column(db.String(20)) city = db.Column(db.String(20)) weibos = db.Column(db.Text) def __init__(self, topic, end, range, limit, province,city,weibos): self.topic = topic self.end = end self.range = range self.limit = limit self.province = province self.city = city self.weibos = weibos @classmethod def _name(cls): return u'ProvinceWeibos'
class Opinion(db.Model): id = db.Column(db.Integer, primary_key=True) opinionTopic = db.Column(db.Integer)#话题、观点对应表中id字段 start = db.Column(db.Integer())#开始时间 end = db.Column(db.Integer())#结束时间 count = db.Column(db.Integer)#所占微博数量 opinionWord = db.Column(db.String(20))#关键词 positive = db.Column(db.Float)#正极性情绪比例 nagetive = db.Column(db.Float)#负极性情绪比例 def __init__(self, opinionTopic, start, end, count, opinionWord, positive, nagetive): self.opinionTopic = opinionTopic self.start = start self.end = end self.count = count self.opinionWord = opinionWord self.positive = positive self.nagetive = nagetive @classmethod def _name(cls): return u'Opinion'
class QuicknessCount(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()) domain = db.Column(db.String(20)) topnum = db.Column(db.Integer()) allnum = db.Column(db.Integer()) def __init__(self, topic, range, end, mtype, domain, topnum, allnum): self.topic = topic self.range = range self.end = end self.mtype = mtype self.domain = domain self.topnum = topnum self.allnum = allnum @classmethod def _name(cls): return u'QuicknessCount'
class TrendPusherNews(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()) news_id = db.Column(db.Text) timestamp = db.Column(db.Integer()) comments_count = db.Column(db.Integer) news_info = db.Column(db.Text) def __init__(self, topic, start_ts, end_ts, news_id, timestamp, comments_count, news_info): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.news_id = news_id self.timestamp = timestamp self.comments_count = comments_count self.news_info = news_info @classmethod def _name(cls): return u'TrendPusherNews'
class DsTopicIdentification(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(100)) rank = db.Column(db.Integer) userId = db.Column(db.Integer()) identifyDate = db.Column(db.Date) identifyWindow = db.Column(db.Integer, default=1) identifyMethod = db.Column(db.String(20), default='pagerank') pr = db.Column(db.String(20), default='pagerank') def __init__(self, topic, rank, userId, identifyDate, identifyWindow, identifyMethod, pr): self.topic = topic self.rank = rank self.userId = userId self.identifyDate = identifyDate self.identifyWindow = identifyWindow self.identifyMethod = identifyMethod self.pr = pr @classmethod def _name(cls): return u'DsTopicIdentification'