We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 754bd7c + 7fe1666 commit 1807b5dCopy full SHA for 1807b5d
flair/data.py
@@ -917,7 +917,9 @@ def to_original_text(self) -> str:
917
if len(self) == 0:
918
return ""
919
# otherwise, return concatenation of tokens with the correct offsets
920
- return self[0].start_position * " " + "".join([t.text + t.whitespace_after * " " for t in self.tokens]).strip()
+ return (self[0].start_position - self.start_position) * " " + "".join(
921
+ [t.text + t.whitespace_after * " " for t in self.tokens]
922
+ ).strip()
923
924
def to_dict(self, tag_type: str = None):
925
labels = []
0 commit comments