示例#1
0
class OpinionTopic(db.Model):#话题、观点对应表
    id = db.Column(db.Integer, primary_key=True)
    topic = db.Column(db.String(20))#话题
    opinion = db.Column(db.String(20))#观点

    def __init__(self, topic, opinion):
        self.topic = topic
        self.opinion = opinion
示例#2
0
class OpinionTestWeibos(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    child_topic = db.Column(db.String(20))
    weibos = db.Column(db.Text)

    def __init__(self, topic, child_topic, weibos):
        self.topic = topic
        self.child_topic = child_topic
        self.weibos = weibos
示例#3
0
class OpinionTestKeywords(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    child_topic = db.Column(db.String(20))
    keywords = db.Column(db.Text)

    def __init__(self, topic, child_topic, keywords):
        self.topic = topic
        self.child_topic = child_topic
        self.keywords = keywords
示例#4
0
class SentimentPoint(db.Model):#情绪拐点
    id = db.Column(db.Integer, primary_key=True)
    topic = db.Column(db.String(20))#话题名
    stype = db.Column(db.String(20))#拐点情绪类型标签('happy','angry','sad')
    ts = db.Column(db.BigInteger(20, unsigned=True))#拐点时间

    def __init__(self, topic, stype, ts):
        self.topic = topic
        self.stype = stype
        self.ts = ts
示例#5
0
class OpinionHot(db.Model):#观点热度值
    id = db.Column(db.Integer, primary_key=True)
    opinionTopic = db.Column(db.Integer)#话题、观点对应表中id字段
    ts = db.Column(db.BigInteger(20, unsigned=True))#时间
    count = db.Column(db.Integer)#热度

    def __init__(self, opinionTopic, ts, count):
        self.opinionTopic = opinionTopic
        self.ts = ts
        self.count = count
示例#6
0
class Topics(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))

    def __init__(self, topic, start_ts, end_ts):
        self.topic = topic
        self.start_ts = start_ts
        self.end_ts = end_ts 
示例#7
0
class OpinionTestRatio(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    #ts = db.clumns(db.BigInteger(10),unsigned=True)
    child_topic = db.Column(db.String(20))
    ratio = db.Column(db.Float)

    def __init__(self, topic, child_topic, ratio):
        self.topc = topic
        self.child_topic = child_topic
        self.ratio = ratio
示例#8
0
class QuotaGeoPenetration(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    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
示例#9
0
class QuotaMediaImportance(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    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
示例#10
0
class QuotaAttentionExp(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    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
示例#11
0
class QuotaDurationExp(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    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
示例#12
0
class PersonSensitivity(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    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
示例#13
0
class QuotaCoverage(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    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
示例#14
0
class QuotaFInvolved(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    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
示例#15
0
class OpinionTestTime(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    child_topic = db.Column(db.Text)
    start_ts = db.Column(db.BigInteger(20, unsigned=True))
    end_ts = db.Column(db.BigInteger(20, unsigned=True))

    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
示例#16
0
class PlaceSensitivity(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    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
示例#17
0
class QuotaSentiment(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    #sentiment = db.Column(db.Integer(1, unsigned=True))
    #ratio = db.Column(db.Float)
    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
示例#18
0
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.BigInteger(10,unsigned = True)) # 起始时间
    end = db.Column(db.BigInteger(10,unsigned = True)) # 终止时间
    area = db.Column(db.Text) # 地理区域
    key_words = db.Column(db.Text) # 关键词
    opinion = db.Column(db.Text) # 代表文本

    def __init__(self, topic, count, user_count, begin, end, area, key_words, 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
示例#19
0
class QuicknessCount(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    end = db.Column(db.BigInteger(10, unsigned=True))
    range = db.Column(db.BigInteger(10, unsigned=True))
    mtype = db.Column(db.Integer(1, unsigned=True))   
    domain = db.Column(db.String(20))
    topnum = db.Column(db.BigInteger(20, unsigned=True))
    allnum = db.Column(db.BigInteger(20, unsigned=True))

    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
示例#20
0
class Opinion(db.Model):#观点
    id = db.Column(db.Integer, primary_key=True)
    opinionTopic = db.Column(db.Integer)#话题、观点对应表中id字段
    start = db.Column(db.BigInteger(20, unsigned=True))#开始时间
    end = db.Column(db.BigInteger(20, unsigned=True))#结束时间
    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
示例#21
0
class PropagateKeywords(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    end = db.Column(db.BigInteger(10, unsigned=True))
    range = db.Column(db.BigInteger(10, unsigned=True))
    mtype = db.Column(db.Integer(1, unsigned=True))
    limit = db.Column(db.BigInteger(10, unsigned=True), primary_key=True)
    kcount = db.Column(db.Text) # kcount=[terms]

    def __init__(self, topic, end, range, mtype, limit, kcount):
        self.topic = topic
        self.end = end
        self.range = range
        self.limit = limit
        self.mtype = mtype
示例#22
0
class SentimentCountRatio(db.Model):#情绪相对比例曲线--已改
    id = db.Column(db.Integer, primary_key=True)
    query = db.Column(db.String(20))#话题名
    end = db.Column(db.BigInteger(20, unsigned=True))#时间
    range = db.Column(db.BigInteger(10, unsigned=True))
    count = db.Column(db.BigInteger(20, unsigned=True))
    allcount = db.Column(db.BigInteger(20, unsigned=True))
    sentiment = db.Column(db.Integer(1, unsigned=True))#情绪类型('happy','angry','sad')

    def __init__(self, query, end, range, sentiment, count, allcount):
        self.query = query
        self.end = end
        self.ts = ts
        self.count = count
        self.allcount = allcount
        self.sentiment = sentiment
示例#23
0
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.BigInteger(10, unsigned=True))#起始时间
    end = db.Column(db.BigInteger(10, unsigned=True))#终止时间
    db_date = db.Column(db.BigInteger(10, unsigned=True))#入库时间❯

    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
示例#24
0
class PropagateWeibos(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    end = db.Column(db.BigInteger(10, unsigned=True))
    range = db.Column(db.BigInteger(10, unsigned=True))
    mtype = db.Column(db.Integer(1, unsigned=True))
    limit = db.Column(db.BigInteger(10, unsigned=True), 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
示例#25
0
class TopicIdentification(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    topic = db.Column(db.String(20))
    rank = db.Column(db.Integer)
    userId = db.Column(db.BigInteger(11, unsigned=True))
    identifyDate = db.Column(db.Date)
    identifyWindow = db.Column(db.Integer, default=1)
    identifyMethod = db.Column(db.String(20), default='pagerank')

    def __init__(self, topic, rank, userId, identifyDate, identifyWindow, identifyMethod):
        self.topic = topic
        self.rank = rank
        self.userId = userId
        self.identifyDate = identifyDate
        self.identifyWindow = identifyWindow
        self.identifyMethod = identifyMethod
示例#26
0
class SentimentKeywords(db.Model):#情绪关键词---已改
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    query = db.Column(db.String(20))
    end = db.Column(db.BigInteger(10, unsigned=True))
    range = db.Column(db.BigInteger(10, unsigned=True))
    limit = db.Column(db.BigInteger(10, unsigned=True))
    sentiment = db.Column(db.Integer(1, unsigned=True))
    kcount = db.Column(db.Text)

    def __init__(self, query, range, limit, end, sentiment, kcount):
        self.query = query 
        self.range = range
        self.limit = limit
        self.end = end
        self.sentiment = sentiment
        self.kcount = kcount
示例#27
0
class SentimentWeibos(db.Model):#情绪微博--已改
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    query = db.Column(db.String(20))
    end = db.Column(db.BigInteger(10, unsigned=True))
    range = db.Column(db.BigInteger(10, unsigned=True))
    limit = db.Column(db.BigInteger(10, unsigned=True))
    sentiment = db.Column(db.Integer(1, unsigned=True))
    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
示例#28
0
class SentimentCount(db.Model):#情绪绝对数量曲线--已改
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    query = db.Column(db.String(20))
    end = db.Column(db.BigInteger(10, unsigned=True))
    range = db.Column(db.BigInteger(10, unsigned=True))
    sentiment = db.Column(db.Integer(1, unsigned=True))
    count = db.Column(db.BigInteger(20, unsigned=True))

    def __init__(self, query, range, end, sentiment, count):
        self.query = query 
        self.range = range
        self.end = end
        self.sentiment = sentiment
        self.count = count
示例#29
0
class QuotaImportance(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    score = db.Column(db.Float)
    weight = db.Column(db.Float)

    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
示例#30
0
class QuotaSensitivity(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(20))
    start_ts = db.Column(db.BigInteger(10, unsigned=True))
    end_ts = db.Column(db.BigInteger(10, unsigned=True))
    classfication = db.Column(db.Integer(1, unsigned=True)) # ['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