class RelationM2mTerm(BaseEntity):
    id = db.Column(db.Integer(), primary_key=True)
    doc_relation_id = db.Column(db.Integer(),
                                db.ForeignKey('doc_relation.doc_relation_id'),
                                nullable=False)
    doc_term_id = db.Column(db.Integer(),
                            db.ForeignKey('doc_term.doc_term_id'),
                            nullable=False)
Exemplo n.º 2
0
class EvaluateM2mMark(BaseEntity):
    id = db.Column(db.Integer(), primary_key=True)
    evaluate_task_id = db.Column(
        db.Integer(),
        db.ForeignKey('evaluate_task.evaluate_task_id'),
        nullable=False)
    mark_job_id = db.Column(db.Integer(),
                            db.ForeignKey('mark_job.mark_job_id'),
                            nullable=False)
Exemplo n.º 3
0
class UserTask(BaseEntity):
    user_task_id = db.Column(db.Integer(), primary_key=True)
    mark_task_id = db.Column(db.Integer(),
                             db.ForeignKey('mark_task.mark_task_id'),
                             nullable=False)
    annotator_id = db.Column(db.Integer(), nullable=False)
    user_task_result = db.Column(db.JSON(), default={})
    user_task_status = db.Column(db.Integer(),
                                 db.ForeignKey("status.status_id"),
                                 default=int(StatusEnum.processing))
Exemplo n.º 4
0
class ExportJob(BaseEntity):
    export_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)
    export_file_path = db.Column(db.String(255), default="")
    export_job_status = db.Column(db.Integer(),
                                  db.ForeignKey("status.status_id"),
                                  nullable=False)
    export_mark_job_ids = db.Column(db.JSON(), default=[])
    export_predict_job_ids = db.Column(db.JSON(), default=[])
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
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="")
Exemplo n.º 7
0
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)
Exemplo n.º 8
0
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})  # 抽取:短文本
Exemplo n.º 9
0
class PredictTask(BaseEntity):
    predict_task_id = db.Column(db.Integer(), primary_key=True)
    doc_id = db.Column(db.Integer(),
                       db.ForeignKey("doc.doc_id"),
                       nullable=False)
    predict_task_status = db.Column(db.Integer(),
                                    db.ForeignKey("status.status_id"),
                                    nullable=False)
    predict_task_result = db.Column(db.JSON(), default={})
    predict_job_id = db.Column(db.Integer(),
                               db.ForeignKey("predict_job.predict_job_id"),
                               nullable=False)
Exemplo n.º 10
0
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)
Exemplo n.º 11
0
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,
Exemplo n.º 12
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 CustomAlgorithm(BaseEntity):
    custom_algorithm_id = db.Column(db.Integer(), primary_key=True)
    custom_algorithm_alias = db.Column(db.String(100), nullable=False)
    custom_algorithm_name = db.Column(db.String(100), nullable=False)
    custom_algorithm_desc = db.Column(db.String(256), default="")
    custom_algorithm_ip = db.Column(db.String(256), nullable=False)
    custom_algorithm_predict_port = db.Column(db.Integer(), nullable=False)
    custom_algorithm_evaluate_port = db.Column(db.Integer(), nullable=False)
    custom_algorithm_config = db.Column(db.JSON(), default={})
    custom_algorithm_status = db.Column(db.Integer(),
                                        db.ForeignKey("status.status_id"),
                                        nullable=False)
    nlp_task_id = db.Column(db.Integer(),
                            db.ForeignKey("nlp_task.nlp_task_id"),
                            nullable=False)
    preprocess = db.Column(db.JSON(), default={"split_by_sentence":
                                               True})  # 抽取:短文本
Exemplo n.º 14
0
class Doc(BaseEntity):
    doc_id = db.Column(db.Integer(), primary_key=True)
    doc_unique_name = db.Column(db.String(64), nullable=False)
    doc_raw_name = db.Column(db.String(255), nullable=False)
    doc_status = db.Column(db.Integer(),
                           db.ForeignKey("status.status_id"),
                           default=StatusEnum.processing.value,
                           nullable=False)
Exemplo n.º 15
0
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)
Exemplo n.º 16
0
class TrainM2mMark(BaseEntity):
    id = db.Column(db.Integer(), primary_key=True)
    train_job_id = db.Column(db.Integer(), db.ForeignKey('train_job.train_job_id'), nullable=False)
    mark_job_id = db.Column(db.Integer(), db.ForeignKey('mark_job.mark_job_id'), nullable=False)
Exemplo n.º 17
0
class MarkTask(BaseEntity):
    mark_task_id = db.Column(db.Integer(), primary_key=True)
    mark_job_id = db.Column(db.Integer(), db.ForeignKey('mark_job.mark_job_id'), nullable=False)
    doc_id = db.Column(db.Integer(), db.ForeignKey('doc.doc_id'), nullable=False)
    mark_task_result = db.Column(db.JSON(), default={})
    mark_task_status = db.Column(db.Integer(), db.ForeignKey("status.status_id"), default=int(StatusEnum.processing))
class ClassifyDocRule(BaseEntity):
    classify_rule_id = db.Column(db.Integer(), primary_key=True)
    rule_type = db.Column(db.String(255), nullable=False)
    rule_content = db.Column(db.JSON(), default={})
    doc_term_id = db.Column(db.Integer(), db.ForeignKey("doc_term.doc_term_id"), nullable=False)
    is_active = db.Column(db.Boolean(), default=True)