Ejemplo n.º 1
0
class DegreeCentralityUser(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)
    rank  = db.Column(db.Integer)
    userid = db.Column(db.Integer())
    dc = db.Column(db.Float)

    def __init__(self, topic, date, windowsize, rank, userid, dc):
        self.topic = topic
        self.date = date
        self.windowsize = windowsize
        self.rank = rank
        self.userid = userid
        self.dc = dc

    @classmethod
    def _name(cls):
        return u'DegreeCentralityUser'
Ejemplo n.º 2
0
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'
Ejemplo n.º 3
0
class TsRank(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    topic = db.Column(db.String(100))
    rank = db.Column(db.Integer)
    uid = db.Column(db.Integer())
    date = db.Column(db.Date)
    windowsize = db.Column(db.Integer, default=1)
    tr = db.Column(db.Float)

    def __init__(self, topic, rank, uid, date, windowsize, tr):
        self.topic = topic
        self.rank = rank
        self.uid = uid
        self.date = date
        self.windowsize = windowsize
        self.tr = tr

    @classmethod
    def _name(cls):
        return u'TsRank'
Ejemplo n.º 4
0
class PropagateNews(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)
    news = db.Column(db.Text) # news=[news]

    def __init__(self, topic, end, range, mtype, limit, news):
        self.topic = topic
        self.end = end
        self.range = range
        self.mtype = mtype
        self.limit = limit
        self.news = news

    @classmethod
    def _name(cls):
        return u'PropagateNews'
Ejemplo n.º 5
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.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'
Ejemplo n.º 6
0
class PropagateKeywordsNews(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)
    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
        self.kcount = kcount

    @classmethod
    def _name(cls):
        return u'PropagateKeywordsNews'
Ejemplo n.º 7
0
class SentimentKeywords(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())
    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

    @classmethod
    def _name(cls):
        return u'SentimentKeywords'
Ejemplo n.º 8
0
class CityTopicCountNews(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())  #message_type:原创-1、转发-2
    ccount = db.Column(db.Text)                      #city_count:{city:count}
    first_item = db.Column(db.Text)          # 原创 初始微博 其他类型为空

    def __init__(self, topic, range, end, mtype, ccount, first_item):
        self.topic = query 
        self.range = range
        self.end = end
        self.mtype = mtype
        self.ccount = ccount
        self.first_item = first_item

    @classmethod
    def _name(cls):
        return u'CityTopicCountNews'
Ejemplo n.º 9
0
class SentimentCountRatio(db.Model):#情绪相对比例曲线--已改
    id = db.Column(db.Integer, primary_key=True)
    query = db.Column(db.String(100))#话题名
    end = db.Column(db.Integer())#时间
    range = db.Column(db.Integer())
    count = db.Column(db.Integer())
    allcount = db.Column(db.Integer())
    sentiment = db.Column(db.Integer())#情绪类型('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

    @classmethod
    def _name(cls):
        return u'SentimentCountRatio'
Ejemplo n.º 10
0
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'
Ejemplo n.º 11
0
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'