Browse Source

Apply black

pull/1823/head
Hironsan 2 years ago
parent
commit
722a498eab
1 changed files with 3 additions and 3 deletions
  1. 6
      backend/labels/models.py

6
backend/labels/models.py

@ -46,7 +46,7 @@ class Span(Label):
end_offset = models.IntegerField()
def __str__(self):
text = self.example.text[self.start_offset:self.end_offset]
text = self.example.text[self.start_offset : self.end_offset]
return f"({text}, {self.start_offset}, {self.end_offset}, {self.label.text})"
def validate_unique(self, exclude=None):
@ -112,8 +112,8 @@ class Relation(Label):
def __str__(self):
text = self.example.text
from_span = text[self.from_id.start_offset: self.from_id.end_offset]
to_span = text[self.to_id.start_offset: self.to_id.end_offset]
from_span = text[self.from_id.start_offset : self.from_id.end_offset]
to_span = text[self.to_id.start_offset : self.to_id.end_offset]
type_text = self.type.text
return f"{from_span} - ({type_text}) -> {to_span}"

Loading…
Cancel
Save