From 76b0454b7cf778a27c9dd765fdf91c06895c3646 Mon Sep 17 00:00:00 2001 From: ArneBinder Date: Thu, 4 Apr 2024 19:10:34 +0200 Subject: [PATCH] upgrade `pie`-related dependencies (#161) * upgrade pytorch-ie ^0.30, pie-datasets to ^0.9, pie-modules to ^0.11 * fix Attribute annotation * minor improvement --- requirements.txt | 6 +++--- src/document/types.py | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 289e569..d8f8ae8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # --------- pytorch-ie --------- # -pytorch-ie>=0.28.0,<0.30.0 -pie-datasets>=0.8.1,<0.9.0 -pie-modules>=0.10.9,<0.11.0 +pytorch-ie>=0.28.0,<0.31.0 +pie-datasets>=0.8.1,<0.10.0 +pie-modules>=0.10.9,<0.12.0 # --------- hydra --------- # hydra-core>=1.3.0 diff --git a/src/document/types.py b/src/document/types.py index 62c4592..1ccf46c 100644 --- a/src/document/types.py +++ b/src/document/types.py @@ -22,10 +22,9 @@ def __post_init__(self) -> None: raise ValueError("score must be a single float.") def __str__(self) -> str: - if self.target is not None: - result = f"label={self.label},annotation={self.annotation}" - else: - result = f"label={self.label}" + result = f"label={self.label}" + if self.is_attached: + result += f",annotation={self.annotation}" if self.type is not None: result += f",type={self.type}" if self.score is not None: