Пример #1
0
class Assignment(db.DynamicDocument):
    name = db.StringField(required=True, unique_with=['instructor'])
    instructor = db.ReferenceField('User', required=True)
    annotators = db.ListField(db.ReferenceField('User'), default=[])
    data_set = db.ReferenceField('DataSet', required=True)
    queries = db.ListField(db.ReferenceField('Query'), default=[])
    ranker = db.StringField(required=True)
    params = db.DictField(required=True)
    num_results = db.IntField(default=5)
    queries_need_to_show = db.ListField(db.ReferenceField('Query'), default=[])
Пример #2
0
class Assignment(db.DynamicDocument):
    name = db.StringField(required=True)
    owner = db.ReferenceField('User', required=True)
    dataset = db.ReferenceField('Dataset')
    annotators = db.ListField(db.ReferenceField('User'), required=True)
    statuses = db.DictField(required=True)
    ranker = db.StringField(required=True)
    params = db.DictField(required=True)
    deadline = db.StringField(required=True)
    num_results = db.IntField(required=True)
Пример #3
0
class User(UserMixin, db.Document):
    meta = {'collection': 'test-user'}
    name = db.StringField(required=True, unique=True)
    email = db.StringField(required=True, unique=True)
    role = db.StringField(required=True, choices=('annotator', 'instructor'))
    password = db.StringField(required=True)
    credibility_score = db.FloatField(default=0.75)

    @staticmethod
    def hash_password(password):
        return generate_password_hash(password, method='sha256')

    def check_password(self, password):
        return check_password_hash(self.password, password)
Пример #4
0
class User(db.DynamicDocument):
    gitlab_id = db.IntField(require=True, unique=True)
    name = db.StringField(required=True)
    email = db.StringField(required=True, unique=True)
Пример #5
0
class Query(db.DynamicDocument):
    content = db.StringField(required=True, unique=True)
Пример #6
0
class DataSet(db.Document):
    author = db.ReferenceField('User', required=True)
    name = db.StringField(required=True, unique_with=['author'])
Пример #7
0
class Dataset(db.DynamicDocument):
    name = db.StringField(required=True)
    owner = db.ReferenceField("User", required=True)
    privacy = db.StringField(required=True)
    collaborators = db.ListField(db.ReferenceField('User'))
Пример #8
0
class Class(db.Document):
    owner = db.ReferenceField('User', required=True)
    name = db.StringField(required=True)
Пример #9
0
class Document(db.DynamicDocument):
    name = db.StringField(required=True)
    data_set = db.ReferenceField('DataSet', required=True)
    path = db.StringField(required=True, unique=True)
Пример #10
0
class Query(db.DynamicDocument):
    content = db.StringField(required=True)
    assignment = db.ReferenceField('Assignment', required=True)
    doc_scores = db.DictField(required=True)
    creator = db.ReferenceField('User', required=True)
    submitted = db.BooleanField(required=True)
Пример #11
0
class Annotation(db.DynamicDocument):
    annotator = db.ReferenceField('User', required=True)
    document = db.ReferenceField("Document", required=True)
    query = db.ReferenceField('Query', required=True)
    judgement = db.StringField(required=True)