recreate to_dict
and add relations
#1893
Annotations
2 errors
test:
flair/data.py#L1
Black format check
--- /home/runner/work/flair/flair/flair/data.py 2023-07-17 11:29:59.758499 +0000
+++ /home/runner/work/flair/flair/flair/data.py 2023-07-17 11:35:21.177525 +0000
@@ -965,11 +965,11 @@
return {
"text": self.to_original_text(),
"labels": [label.to_dict() for label in self.get_labels(tag_type) if label.data_point is self],
"entities": [span.to_dict(tag_type) for span in self.get_spans(tag_type)],
"relations": [relation.to_dict(tag_type) for relation in self.get_relations(tag_type)],
- "tokens": [token.to_dict(tag_type) for token in self.tokens]
+ "tokens": [token.to_dict(tag_type) for token in self.tokens],
}
def get_span(self, start: int, stop: int):
span_slice = slice(start, stop)
return self[span_slice]
|
test
Process completed with exit code 1.
|