class ClarityProject(BaseProject, db.Model): __tablename__ = 'clarity_project' n_summaries = db.Column(db.Integer, default=5) expire_duration = db.Column(db.INTEGER, nullable=False, default=3) summary_group_lists = db.relationship('SummaryGroupList', cascade='delete') proj_statuses = db.relationship('ProjectStatus', cascade='delete')
class ProjectStatus(db.Model): __tablename__ = 'project_status' id = db.Column(db.INTEGER, primary_key=True, nullable=False) # total_exp_results = db.Column(db.Integer, nullable=False, default=1) # total_results = db.Column(db.Integer, nullable=False, default=0) is_finished = db.Column(db.Boolean, nullable=False, default=False) is_active = db.Column(db.Boolean, nullable=False, default=False) validity = db.Column(db.Boolean, nullable=True, default=False) mturk_code = db.Column(db.String(255), nullable=True) good_summ_score = db.Column(db.INTEGER, nullable=True) mediocre_summ_score = db.Column(db.INTEGER, nullable=True) bad_summ_score = db.Column(db.INTEGER, nullable=True) expired_in = db.Column(db.DateTime, nullable=True) # Used in informativeness and fluency project # summary_id = db.Column(db.INTEGER, db.ForeignKey('summary.id'), nullable=True) # ref_summary_id = db.Column(db.INTEGER, db.ForeignKey('summary.id'), nullable=True) # Used in annotation project # doc_id = db.Column(db.INTEGER, db.ForeignKey('document.id'), nullable=True) eval_proj_id = db.Column(db.INTEGER, db.ForeignKey('evaluation_project.id'), nullable=True) fluency_proj_id = db.Column(db.INTEGER, db.ForeignKey('fluency_project.id'), nullable=True) clarity_proj_id = db.Column(db.INTEGER, db.ForeignKey('clarity_project.id'), nullable=True) sanity_summ_id = db.Column(db.INTEGER, db.ForeignKey('sanity_summary.id'), nullable=True) fluency_results = db.relationship('FluencyResult', cascade='delete') clarity_results = db.relationship('ClarityResult', cascade='delete')
class SummaryGroup(db.Model): """ For different model or reference group """ __tablename__ = 'summary_group' id = db.Column(db.INTEGER, primary_key=True, nullable=False) name = db.Column(db.String(255), nullable=False) is_ref = db.Column(db.Boolean, nullable=False, default=False) dataset_id = db.Column(db.INTEGER, db.ForeignKey('dataset.id'), nullable=False) summaries = db.relationship('Summary', backref='summary_group')
class Dataset(db.Model): __tablename__ = 'dataset' id = db.Column(db.INTEGER, primary_key=True, nullable=False) name = db.Column(db.String(255), nullable=False) summ_groups = db.relationship('SummaryGroup', backref='dataset', lazy=True)