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
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
class PropagateCount(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)) dcount = db.Column(db.Text) # dcount={domain: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
class CityTopicCount(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)) #message_type:原创-1、转发-2、评论-3 ccount = db.Column(db.Text) #city_count:{city:count} def __init__(self, topic, range, end, mtype, ccount): self.topic = query self.range = range self.end = end self.mtype = mtype self.ccount = ccount
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
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
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
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
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
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