Пример #1
0
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'
Пример #2
0
class OpinionWeibosNew(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(100))
    child_topic = db.Column(db.Text)
    weight = db.Column(db.Float)
    mid = db.Column(db.String(20))
    uid = db.Column(db.String(20))
    weibos = db.Column(db.Text)
    time = db.Column(db.String(20))    
    r_count = db.Column(db.Integer)
    c_count = db.Column(db.Integer)
    repeat = db.Column(db.Integer)

    def __init__(self, topic, child_topic, weight, mid, uid, weibos, time, r_count, c_count, repeat):
        self.topic = topic
        self.child_topic = child_topic
        self.weight = weight
        self.mid = mid
        self.uid = uid
        self.weibos = weibos
        self.time = time        
        self.r_count = r_count
        self.c_count = c_count
        self.repeat = repeat

    @classmethod
    def _name(cls):
        return u'OpinionWeibosNew'
Пример #3
0
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'
Пример #4
0
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'
Пример #5
0
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'
Пример #6
0
class OpinionWeibos(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    opinionTopic = db.Column(db.Integer)#话题、观点对应表中id字段
    mid = db.Column(db.String(20))#微博id
    weibos = db.Column(db.Text)#微博文本
    user = db.Column(db.String(20))#用户昵称
    userid = db.Column(db.String(20))#用户id
    posttime = db.Column(db.String(20))#发布时间
    weibourl = db.Column(db.String(20))#微博url(目前没啥用,都是‘#’)
    userurl = db.Column(db.String(20))#用户url(目前没啥用,都是‘#’)
    repost = db.Column(db.Integer)#转发数
    stype = db.Column(db.String(20))#情绪类型('happy','angry','sad')

    def __init__(self, opinionTopic, mid, weibos, user, userid, posttime, weibourl, userurl, repost, stype):
        self.opinionTopic = opinionTopic
        self.mid = mid
        self.weibos = weibos
        self.user = user
        self.userid = userid
        self.posttime = posttime
        self.weibourl = weibourl
        self.userurl = userurl
        self.repost = repost
        self.stype = stype

    @classmethod
    def _name(cls):
        return u'OpinionWeibos'
Пример #7
0
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'
Пример #8
0
class CityRepostNews(db.Model):
    id = db.Column(db.Integer, primary_key = True, autoincrement = True)
    original = db.Column(db.Integer())
    topic = db.Column(db.String(100))
    mid = db.Column(db.String(20)) # 新闻ID
    ts = db.Column(db.Integer())
    origin_location = db.Column(db.Text) # 原始新闻发布地点
    repost_location = db.Column(db.Text) # 转发新闻发布地点

    def __init__(self, original, topic, mid, ts, origin_location, repost_location ):
        self.topic = topic
        self.original = original
        self.mid = mid
        self.ts = ts
        self.origin_location = origin_location
        self.repost_location = repost_location

    @classmethod
    def _name(cls):
        return u'CityRepostNews'
Пример #9
0
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'
Пример #10
0
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'
Пример #11
0
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'
Пример #12
0
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'
Пример #13
0
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'
Пример #14
0
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'
Пример #15
0
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'
Пример #16
0
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'
Пример #17
0
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'
Пример #18
0
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'
Пример #19
0
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'
Пример #20
0
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'
Пример #21
0
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'
Пример #22
0
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'
Пример #23
0
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'
Пример #24
0
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'
Пример #25
0
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'
Пример #26
0
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'
Пример #27
0
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'
Пример #28
0
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'
Пример #29
0
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'
Пример #30
0
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'