|
|
@ -137,7 +137,7 @@ class Document(models.Model): |
|
|
|
elif self.project.is_type_of(Project.SEQUENCE_LABELING): |
|
|
|
return self.seq_annotations.all() |
|
|
|
elif self.project.is_type_of(Project.Seq2seq): |
|
|
|
return self.seq2seq_annotations.all() |
|
|
|
return self.make_dataset_for_seq2seq() |
|
|
|
|
|
|
|
def make_dataset_for_classification(self): |
|
|
|
annotations = self.get_annotations() |
|
|
@ -145,6 +145,12 @@ class Document(models.Model): |
|
|
|
for a in annotations] |
|
|
|
return dataset |
|
|
|
|
|
|
|
def make_dataset_for_seq2seq(self): |
|
|
|
annotations = self.get_annotations() |
|
|
|
dataset = [[a.document.id, a.document.text, a.text, a.user.username] |
|
|
|
for a in annotations] |
|
|
|
return dataset |
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
return self.text[:50] |
|
|
|
|
|
|
|