class DocType(BaseEntity): doc_type_id = db.Column(db.Integer(), primary_key=True) doc_type_name = db.Column(db.String(255), nullable=False) doc_type_desc = db.Column(db.Text(), default="") is_favorite = db.Column(db.Boolean(), default=False) nlp_task_id = db.Column(db.Integer(), db.ForeignKey("nlp_task.nlp_task_id"), nullable=False) group_id = db.Column(db.Integer(), nullable=False, default=0)
class DocRelation(BaseEntity): doc_relation_id = db.Column(db.Integer(), primary_key=True) doc_relation_name = db.Column(db.String(256), nullable=False) doc_relation_color = db.Column(db.String(256), default="") doc_relation_desc = db.Column(db.Text(), default="") doc_type_id = db.Column(db.Integer(), db.ForeignKey('doc_type.doc_type_id'), nullable=False)
class EvaluateTask(BaseEntity): evaluate_task_id = db.Column(db.Integer(), primary_key=True) evaluate_task_name = db.Column(db.String(256), nullable=False) evaluate_task_desc = db.Column(db.Text(), default="") evaluate_task_status = db.Column(db.Integer(), db.ForeignKey("status.status_id"), nullable=False) evaluate_task_result = db.Column(db.JSON(), default={}) train_task_id = db.Column(db.Integer(), db.ForeignKey("train_task.train_task_id"), nullable=False)
class PredictJob(BaseEntity): predict_job_id = db.Column(db.Integer(), primary_key=True) doc_type_id = db.Column(db.Integer(), db.ForeignKey("doc_type.doc_type_id"), nullable=False) predict_job_name = db.Column(db.String(256), default="") predict_job_type = db.Column(db.Enum(FileTypeEnum)) predict_job_status = db.Column(db.Integer(), db.ForeignKey("status.status_id"), nullable=False) predict_job_desc = db.Column(db.Text(), default="")
class DocTerm(BaseEntity): doc_term_id = db.Column(db.Integer(), primary_key=True) doc_term_name = db.Column(db.String(256), nullable=False) doc_term_alias = db.Column(db.String(20), default="") doc_term_shortcut = db.Column(db.String(20), default="") doc_term_color = db.Column(db.String(256), default="") doc_term_desc = db.Column(db.Text(), default="") doc_term_index = db.Column(db.Integer(), default=1) doc_term_data_type = db.Column(db.String(256), default="") # 字符、数字、布尔 doc_type_id = db.Column(db.Integer(), db.ForeignKey('doc_type.doc_type_id'), nullable=False)
class TrainTask(BaseEntity): train_task_id = db.Column(db.Integer(), primary_key=True) train_model_name = db.Column(db.String(256), nullable=False) train_model_desc = db.Column(db.Text(), default="") train_config = db.Column(db.JSON(), default={}) train_status = db.Column(db.Integer(), db.ForeignKey("status.status_id"), nullable=False) model_version = db.Column(db.String(256), default="") train_job_id = db.Column(db.Integer(), db.ForeignKey("train_job.train_job_id"), nullable=False)
class TrainJob(BaseEntity): train_job_id = db.Column(db.Integer(), primary_key=True) train_job_name = db.Column(db.String(256), nullable=False) train_job_status = db.Column(db.Integer(), db.ForeignKey("status.status_id"), nullable=False) train_job_desc = db.Column(db.Text(), default="") doc_type_id = db.Column(db.Integer(), db.ForeignKey("doc_type.doc_type_id"), nullable=False) preprocess = db.Column(db.JSON(), default={"split_by_sentence": True}) # 抽取:短文本
class MarkJob(BaseEntity): mark_job_id = db.Column(db.Integer(), primary_key=True) doc_type_id = db.Column(db.Integer(), db.ForeignKey("doc_type.doc_type_id"), nullable=False) mark_job_name = db.Column(db.String(255), nullable=False) mark_job_desc = db.Column(db.Text(), default="") mark_job_type = db.Column(db.Enum(FileTypeEnum), nullable=False) # text, e_doc, ocr mark_job_status = db.Column(db.Integer(), db.ForeignKey("status.status_id"), default=int(StatusEnum.processing)) annotator_ids = db.Column(db.JSON(), default=[]) reviewer_ids = db.Column(db.JSON(), default=[]) assign_mode = db.Column(db.Enum(AssignModeEnum), nullable=False) # average,